Completed
Push — master ( 382c63...5355c1 )
by rugk
02:29
created
vendor/composer/ClassLoader.php 3 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -341,6 +341,10 @@
 block discarded – undo
341 341
         return $file;
342 342
     }
343 343
 
344
+    /**
345
+     * @param string $class
346
+     * @param string $ext
347
+     */
344 348
     private function findFileWithExtension($class, $ext)
345 349
     {
346 350
         // PSR-4 lookup
Please login to merge, or discard this patch.
Indentation   +359 added lines, -359 removed lines patch added patch discarded remove patch
@@ -42,364 +42,364 @@  discard block
 block discarded – undo
42 42
  */
43 43
 class ClassLoader
44 44
 {
45
-    // PSR-4
46
-    private $prefixLengthsPsr4 = array();
47
-    private $prefixDirsPsr4 = array();
48
-    private $fallbackDirsPsr4 = array();
49
-
50
-    // PSR-0
51
-    private $prefixesPsr0 = array();
52
-    private $fallbackDirsPsr0 = array();
53
-
54
-    private $useIncludePath = false;
55
-    private $classMap = array();
56
-
57
-    private $classMapAuthoritative = false;
58
-
59
-    public function getPrefixes()
60
-    {
61
-        if (!empty($this->prefixesPsr0)) {
62
-            return call_user_func_array('array_merge', $this->prefixesPsr0);
63
-        }
64
-
65
-        return array();
66
-    }
67
-
68
-    public function getPrefixesPsr4()
69
-    {
70
-        return $this->prefixDirsPsr4;
71
-    }
72
-
73
-    public function getFallbackDirs()
74
-    {
75
-        return $this->fallbackDirsPsr0;
76
-    }
77
-
78
-    public function getFallbackDirsPsr4()
79
-    {
80
-        return $this->fallbackDirsPsr4;
81
-    }
82
-
83
-    public function getClassMap()
84
-    {
85
-        return $this->classMap;
86
-    }
87
-
88
-    /**
89
-     * @param array $classMap Class to filename map
90
-     */
91
-    public function addClassMap(array $classMap)
92
-    {
93
-        if ($this->classMap) {
94
-            $this->classMap = array_merge($this->classMap, $classMap);
95
-        } else {
96
-            $this->classMap = $classMap;
97
-        }
98
-    }
99
-
100
-    /**
101
-     * Registers a set of PSR-0 directories for a given prefix, either
102
-     * appending or prepending to the ones previously set for this prefix.
103
-     *
104
-     * @param string       $prefix  The prefix
105
-     * @param array|string $paths   The PSR-0 root directories
106
-     * @param bool         $prepend Whether to prepend the directories
107
-     */
108
-    public function add($prefix, $paths, $prepend = false)
109
-    {
110
-        if (!$prefix) {
111
-            if ($prepend) {
112
-                $this->fallbackDirsPsr0 = array_merge(
113
-                    (array) $paths,
114
-                    $this->fallbackDirsPsr0
115
-                );
116
-            } else {
117
-                $this->fallbackDirsPsr0 = array_merge(
118
-                    $this->fallbackDirsPsr0,
119
-                    (array) $paths
120
-                );
121
-            }
122
-
123
-            return;
124
-        }
125
-
126
-        $first = $prefix[0];
127
-        if (!isset($this->prefixesPsr0[$first][$prefix])) {
128
-            $this->prefixesPsr0[$first][$prefix] = (array) $paths;
129
-
130
-            return;
131
-        }
132
-        if ($prepend) {
133
-            $this->prefixesPsr0[$first][$prefix] = array_merge(
134
-                (array) $paths,
135
-                $this->prefixesPsr0[$first][$prefix]
136
-            );
137
-        } else {
138
-            $this->prefixesPsr0[$first][$prefix] = array_merge(
139
-                $this->prefixesPsr0[$first][$prefix],
140
-                (array) $paths
141
-            );
142
-        }
143
-    }
144
-
145
-    /**
146
-     * Registers a set of PSR-4 directories for a given namespace, either
147
-     * appending or prepending to the ones previously set for this namespace.
148
-     *
149
-     * @param string       $prefix  The prefix/namespace, with trailing '\\'
150
-     * @param array|string $paths   The PSR-4 base directories
151
-     * @param bool         $prepend Whether to prepend the directories
152
-     *
153
-     * @throws \InvalidArgumentException
154
-     */
155
-    public function addPsr4($prefix, $paths, $prepend = false)
156
-    {
157
-        if (!$prefix) {
158
-            // Register directories for the root namespace.
159
-            if ($prepend) {
160
-                $this->fallbackDirsPsr4 = array_merge(
161
-                    (array) $paths,
162
-                    $this->fallbackDirsPsr4
163
-                );
164
-            } else {
165
-                $this->fallbackDirsPsr4 = array_merge(
166
-                    $this->fallbackDirsPsr4,
167
-                    (array) $paths
168
-                );
169
-            }
170
-        } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
171
-            // Register directories for a new namespace.
172
-            $length = strlen($prefix);
173
-            if ('\\' !== $prefix[$length - 1]) {
174
-                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
175
-            }
176
-            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
177
-            $this->prefixDirsPsr4[$prefix] = (array) $paths;
178
-        } elseif ($prepend) {
179
-            // Prepend directories for an already registered namespace.
180
-            $this->prefixDirsPsr4[$prefix] = array_merge(
181
-                (array) $paths,
182
-                $this->prefixDirsPsr4[$prefix]
183
-            );
184
-        } else {
185
-            // Append directories for an already registered namespace.
186
-            $this->prefixDirsPsr4[$prefix] = array_merge(
187
-                $this->prefixDirsPsr4[$prefix],
188
-                (array) $paths
189
-            );
190
-        }
191
-    }
192
-
193
-    /**
194
-     * Registers a set of PSR-0 directories for a given prefix,
195
-     * replacing any others previously set for this prefix.
196
-     *
197
-     * @param string       $prefix The prefix
198
-     * @param array|string $paths  The PSR-0 base directories
199
-     */
200
-    public function set($prefix, $paths)
201
-    {
202
-        if (!$prefix) {
203
-            $this->fallbackDirsPsr0 = (array) $paths;
204
-        } else {
205
-            $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
206
-        }
207
-    }
208
-
209
-    /**
210
-     * Registers a set of PSR-4 directories for a given namespace,
211
-     * replacing any others previously set for this namespace.
212
-     *
213
-     * @param string       $prefix The prefix/namespace, with trailing '\\'
214
-     * @param array|string $paths  The PSR-4 base directories
215
-     *
216
-     * @throws \InvalidArgumentException
217
-     */
218
-    public function setPsr4($prefix, $paths)
219
-    {
220
-        if (!$prefix) {
221
-            $this->fallbackDirsPsr4 = (array) $paths;
222
-        } else {
223
-            $length = strlen($prefix);
224
-            if ('\\' !== $prefix[$length - 1]) {
225
-                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
226
-            }
227
-            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
228
-            $this->prefixDirsPsr4[$prefix] = (array) $paths;
229
-        }
230
-    }
231
-
232
-    /**
233
-     * Turns on searching the include path for class files.
234
-     *
235
-     * @param bool $useIncludePath
236
-     */
237
-    public function setUseIncludePath($useIncludePath)
238
-    {
239
-        $this->useIncludePath = $useIncludePath;
240
-    }
241
-
242
-    /**
243
-     * Can be used to check if the autoloader uses the include path to check
244
-     * for classes.
245
-     *
246
-     * @return bool
247
-     */
248
-    public function getUseIncludePath()
249
-    {
250
-        return $this->useIncludePath;
251
-    }
252
-
253
-    /**
254
-     * Turns off searching the prefix and fallback directories for classes
255
-     * that have not been registered with the class map.
256
-     *
257
-     * @param bool $classMapAuthoritative
258
-     */
259
-    public function setClassMapAuthoritative($classMapAuthoritative)
260
-    {
261
-        $this->classMapAuthoritative = $classMapAuthoritative;
262
-    }
263
-
264
-    /**
265
-     * Should class lookup fail if not found in the current class map?
266
-     *
267
-     * @return bool
268
-     */
269
-    public function isClassMapAuthoritative()
270
-    {
271
-        return $this->classMapAuthoritative;
272
-    }
273
-
274
-    /**
275
-     * Registers this instance as an autoloader.
276
-     *
277
-     * @param bool $prepend Whether to prepend the autoloader or not
278
-     */
279
-    public function register($prepend = false)
280
-    {
281
-        spl_autoload_register(array($this, 'loadClass'), true, $prepend);
282
-    }
283
-
284
-    /**
285
-     * Unregisters this instance as an autoloader.
286
-     */
287
-    public function unregister()
288
-    {
289
-        spl_autoload_unregister(array($this, 'loadClass'));
290
-    }
291
-
292
-    /**
293
-     * Loads the given class or interface.
294
-     *
295
-     * @param  string    $class The name of the class
296
-     * @return bool|null True if loaded, null otherwise
297
-     */
298
-    public function loadClass($class)
299
-    {
300
-        if ($file = $this->findFile($class)) {
301
-            includeFile($file);
302
-
303
-            return true;
304
-        }
305
-    }
306
-
307
-    /**
308
-     * Finds the path to the file where the class is defined.
309
-     *
310
-     * @param string $class The name of the class
311
-     *
312
-     * @return string|false The path if found, false otherwise
313
-     */
314
-    public function findFile($class)
315
-    {
316
-        // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
317
-        if ('\\' == $class[0]) {
318
-            $class = substr($class, 1);
319
-        }
320
-
321
-        // class map lookup
322
-        if (isset($this->classMap[$class])) {
323
-            return $this->classMap[$class];
324
-        }
325
-        if ($this->classMapAuthoritative) {
326
-            return false;
327
-        }
328
-
329
-        $file = $this->findFileWithExtension($class, '.php');
330
-
331
-        // Search for Hack files if we are running on HHVM
332
-        if ($file === null && defined('HHVM_VERSION')) {
333
-            $file = $this->findFileWithExtension($class, '.hh');
334
-        }
335
-
336
-        if ($file === null) {
337
-            // Remember that this class does not exist.
338
-            return $this->classMap[$class] = false;
339
-        }
340
-
341
-        return $file;
342
-    }
343
-
344
-    private function findFileWithExtension($class, $ext)
345
-    {
346
-        // PSR-4 lookup
347
-        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
348
-
349
-        $first = $class[0];
350
-        if (isset($this->prefixLengthsPsr4[$first])) {
351
-            foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
352
-                if (0 === strpos($class, $prefix)) {
353
-                    foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
354
-                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
355
-                            return $file;
356
-                        }
357
-                    }
358
-                }
359
-            }
360
-        }
361
-
362
-        // PSR-4 fallback dirs
363
-        foreach ($this->fallbackDirsPsr4 as $dir) {
364
-            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
365
-                return $file;
366
-            }
367
-        }
368
-
369
-        // PSR-0 lookup
370
-        if (false !== $pos = strrpos($class, '\\')) {
371
-            // namespaced class name
372
-            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
373
-                . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
374
-        } else {
375
-            // PEAR-like class name
376
-            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
377
-        }
378
-
379
-        if (isset($this->prefixesPsr0[$first])) {
380
-            foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
381
-                if (0 === strpos($class, $prefix)) {
382
-                    foreach ($dirs as $dir) {
383
-                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
384
-                            return $file;
385
-                        }
386
-                    }
387
-                }
388
-            }
389
-        }
390
-
391
-        // PSR-0 fallback dirs
392
-        foreach ($this->fallbackDirsPsr0 as $dir) {
393
-            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
394
-                return $file;
395
-            }
396
-        }
397
-
398
-        // PSR-0 include paths.
399
-        if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
400
-            return $file;
401
-        }
402
-    }
45
+	// PSR-4
46
+	private $prefixLengthsPsr4 = array();
47
+	private $prefixDirsPsr4 = array();
48
+	private $fallbackDirsPsr4 = array();
49
+
50
+	// PSR-0
51
+	private $prefixesPsr0 = array();
52
+	private $fallbackDirsPsr0 = array();
53
+
54
+	private $useIncludePath = false;
55
+	private $classMap = array();
56
+
57
+	private $classMapAuthoritative = false;
58
+
59
+	public function getPrefixes()
60
+	{
61
+		if (!empty($this->prefixesPsr0)) {
62
+			return call_user_func_array('array_merge', $this->prefixesPsr0);
63
+		}
64
+
65
+		return array();
66
+	}
67
+
68
+	public function getPrefixesPsr4()
69
+	{
70
+		return $this->prefixDirsPsr4;
71
+	}
72
+
73
+	public function getFallbackDirs()
74
+	{
75
+		return $this->fallbackDirsPsr0;
76
+	}
77
+
78
+	public function getFallbackDirsPsr4()
79
+	{
80
+		return $this->fallbackDirsPsr4;
81
+	}
82
+
83
+	public function getClassMap()
84
+	{
85
+		return $this->classMap;
86
+	}
87
+
88
+	/**
89
+	 * @param array $classMap Class to filename map
90
+	 */
91
+	public function addClassMap(array $classMap)
92
+	{
93
+		if ($this->classMap) {
94
+			$this->classMap = array_merge($this->classMap, $classMap);
95
+		} else {
96
+			$this->classMap = $classMap;
97
+		}
98
+	}
99
+
100
+	/**
101
+	 * Registers a set of PSR-0 directories for a given prefix, either
102
+	 * appending or prepending to the ones previously set for this prefix.
103
+	 *
104
+	 * @param string       $prefix  The prefix
105
+	 * @param array|string $paths   The PSR-0 root directories
106
+	 * @param bool         $prepend Whether to prepend the directories
107
+	 */
108
+	public function add($prefix, $paths, $prepend = false)
109
+	{
110
+		if (!$prefix) {
111
+			if ($prepend) {
112
+				$this->fallbackDirsPsr0 = array_merge(
113
+					(array) $paths,
114
+					$this->fallbackDirsPsr0
115
+				);
116
+			} else {
117
+				$this->fallbackDirsPsr0 = array_merge(
118
+					$this->fallbackDirsPsr0,
119
+					(array) $paths
120
+				);
121
+			}
122
+
123
+			return;
124
+		}
125
+
126
+		$first = $prefix[0];
127
+		if (!isset($this->prefixesPsr0[$first][$prefix])) {
128
+			$this->prefixesPsr0[$first][$prefix] = (array) $paths;
129
+
130
+			return;
131
+		}
132
+		if ($prepend) {
133
+			$this->prefixesPsr0[$first][$prefix] = array_merge(
134
+				(array) $paths,
135
+				$this->prefixesPsr0[$first][$prefix]
136
+			);
137
+		} else {
138
+			$this->prefixesPsr0[$first][$prefix] = array_merge(
139
+				$this->prefixesPsr0[$first][$prefix],
140
+				(array) $paths
141
+			);
142
+		}
143
+	}
144
+
145
+	/**
146
+	 * Registers a set of PSR-4 directories for a given namespace, either
147
+	 * appending or prepending to the ones previously set for this namespace.
148
+	 *
149
+	 * @param string       $prefix  The prefix/namespace, with trailing '\\'
150
+	 * @param array|string $paths   The PSR-4 base directories
151
+	 * @param bool         $prepend Whether to prepend the directories
152
+	 *
153
+	 * @throws \InvalidArgumentException
154
+	 */
155
+	public function addPsr4($prefix, $paths, $prepend = false)
156
+	{
157
+		if (!$prefix) {
158
+			// Register directories for the root namespace.
159
+			if ($prepend) {
160
+				$this->fallbackDirsPsr4 = array_merge(
161
+					(array) $paths,
162
+					$this->fallbackDirsPsr4
163
+				);
164
+			} else {
165
+				$this->fallbackDirsPsr4 = array_merge(
166
+					$this->fallbackDirsPsr4,
167
+					(array) $paths
168
+				);
169
+			}
170
+		} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
171
+			// Register directories for a new namespace.
172
+			$length = strlen($prefix);
173
+			if ('\\' !== $prefix[$length - 1]) {
174
+				throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
175
+			}
176
+			$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
177
+			$this->prefixDirsPsr4[$prefix] = (array) $paths;
178
+		} elseif ($prepend) {
179
+			// Prepend directories for an already registered namespace.
180
+			$this->prefixDirsPsr4[$prefix] = array_merge(
181
+				(array) $paths,
182
+				$this->prefixDirsPsr4[$prefix]
183
+			);
184
+		} else {
185
+			// Append directories for an already registered namespace.
186
+			$this->prefixDirsPsr4[$prefix] = array_merge(
187
+				$this->prefixDirsPsr4[$prefix],
188
+				(array) $paths
189
+			);
190
+		}
191
+	}
192
+
193
+	/**
194
+	 * Registers a set of PSR-0 directories for a given prefix,
195
+	 * replacing any others previously set for this prefix.
196
+	 *
197
+	 * @param string       $prefix The prefix
198
+	 * @param array|string $paths  The PSR-0 base directories
199
+	 */
200
+	public function set($prefix, $paths)
201
+	{
202
+		if (!$prefix) {
203
+			$this->fallbackDirsPsr0 = (array) $paths;
204
+		} else {
205
+			$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
206
+		}
207
+	}
208
+
209
+	/**
210
+	 * Registers a set of PSR-4 directories for a given namespace,
211
+	 * replacing any others previously set for this namespace.
212
+	 *
213
+	 * @param string       $prefix The prefix/namespace, with trailing '\\'
214
+	 * @param array|string $paths  The PSR-4 base directories
215
+	 *
216
+	 * @throws \InvalidArgumentException
217
+	 */
218
+	public function setPsr4($prefix, $paths)
219
+	{
220
+		if (!$prefix) {
221
+			$this->fallbackDirsPsr4 = (array) $paths;
222
+		} else {
223
+			$length = strlen($prefix);
224
+			if ('\\' !== $prefix[$length - 1]) {
225
+				throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
226
+			}
227
+			$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
228
+			$this->prefixDirsPsr4[$prefix] = (array) $paths;
229
+		}
230
+	}
231
+
232
+	/**
233
+	 * Turns on searching the include path for class files.
234
+	 *
235
+	 * @param bool $useIncludePath
236
+	 */
237
+	public function setUseIncludePath($useIncludePath)
238
+	{
239
+		$this->useIncludePath = $useIncludePath;
240
+	}
241
+
242
+	/**
243
+	 * Can be used to check if the autoloader uses the include path to check
244
+	 * for classes.
245
+	 *
246
+	 * @return bool
247
+	 */
248
+	public function getUseIncludePath()
249
+	{
250
+		return $this->useIncludePath;
251
+	}
252
+
253
+	/**
254
+	 * Turns off searching the prefix and fallback directories for classes
255
+	 * that have not been registered with the class map.
256
+	 *
257
+	 * @param bool $classMapAuthoritative
258
+	 */
259
+	public function setClassMapAuthoritative($classMapAuthoritative)
260
+	{
261
+		$this->classMapAuthoritative = $classMapAuthoritative;
262
+	}
263
+
264
+	/**
265
+	 * Should class lookup fail if not found in the current class map?
266
+	 *
267
+	 * @return bool
268
+	 */
269
+	public function isClassMapAuthoritative()
270
+	{
271
+		return $this->classMapAuthoritative;
272
+	}
273
+
274
+	/**
275
+	 * Registers this instance as an autoloader.
276
+	 *
277
+	 * @param bool $prepend Whether to prepend the autoloader or not
278
+	 */
279
+	public function register($prepend = false)
280
+	{
281
+		spl_autoload_register(array($this, 'loadClass'), true, $prepend);
282
+	}
283
+
284
+	/**
285
+	 * Unregisters this instance as an autoloader.
286
+	 */
287
+	public function unregister()
288
+	{
289
+		spl_autoload_unregister(array($this, 'loadClass'));
290
+	}
291
+
292
+	/**
293
+	 * Loads the given class or interface.
294
+	 *
295
+	 * @param  string    $class The name of the class
296
+	 * @return bool|null True if loaded, null otherwise
297
+	 */
298
+	public function loadClass($class)
299
+	{
300
+		if ($file = $this->findFile($class)) {
301
+			includeFile($file);
302
+
303
+			return true;
304
+		}
305
+	}
306
+
307
+	/**
308
+	 * Finds the path to the file where the class is defined.
309
+	 *
310
+	 * @param string $class The name of the class
311
+	 *
312
+	 * @return string|false The path if found, false otherwise
313
+	 */
314
+	public function findFile($class)
315
+	{
316
+		// work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
317
+		if ('\\' == $class[0]) {
318
+			$class = substr($class, 1);
319
+		}
320
+
321
+		// class map lookup
322
+		if (isset($this->classMap[$class])) {
323
+			return $this->classMap[$class];
324
+		}
325
+		if ($this->classMapAuthoritative) {
326
+			return false;
327
+		}
328
+
329
+		$file = $this->findFileWithExtension($class, '.php');
330
+
331
+		// Search for Hack files if we are running on HHVM
332
+		if ($file === null && defined('HHVM_VERSION')) {
333
+			$file = $this->findFileWithExtension($class, '.hh');
334
+		}
335
+
336
+		if ($file === null) {
337
+			// Remember that this class does not exist.
338
+			return $this->classMap[$class] = false;
339
+		}
340
+
341
+		return $file;
342
+	}
343
+
344
+	private function findFileWithExtension($class, $ext)
345
+	{
346
+		// PSR-4 lookup
347
+		$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
348
+
349
+		$first = $class[0];
350
+		if (isset($this->prefixLengthsPsr4[$first])) {
351
+			foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
352
+				if (0 === strpos($class, $prefix)) {
353
+					foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
354
+						if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
355
+							return $file;
356
+						}
357
+					}
358
+				}
359
+			}
360
+		}
361
+
362
+		// PSR-4 fallback dirs
363
+		foreach ($this->fallbackDirsPsr4 as $dir) {
364
+			if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
365
+				return $file;
366
+			}
367
+		}
368
+
369
+		// PSR-0 lookup
370
+		if (false !== $pos = strrpos($class, '\\')) {
371
+			// namespaced class name
372
+			$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
373
+				. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
374
+		} else {
375
+			// PEAR-like class name
376
+			$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
377
+		}
378
+
379
+		if (isset($this->prefixesPsr0[$first])) {
380
+			foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
381
+				if (0 === strpos($class, $prefix)) {
382
+					foreach ($dirs as $dir) {
383
+						if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
384
+							return $file;
385
+						}
386
+					}
387
+				}
388
+			}
389
+		}
390
+
391
+		// PSR-0 fallback dirs
392
+		foreach ($this->fallbackDirsPsr0 as $dir) {
393
+			if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
394
+				return $file;
395
+			}
396
+		}
397
+
398
+		// PSR-0 include paths.
399
+		if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
400
+			return $file;
401
+		}
402
+	}
403 403
 }
404 404
 
405 405
 /**
@@ -409,5 +409,5 @@  discard block
 block discarded – undo
409 409
  */
410 410
 function includeFile($file)
411 411
 {
412
-    include $file;
412
+	include $file;
413 413
 }
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -110,13 +110,13 @@  discard block
 block discarded – undo
110 110
         if (!$prefix) {
111 111
             if ($prepend) {
112 112
                 $this->fallbackDirsPsr0 = array_merge(
113
-                    (array) $paths,
113
+                    (array)$paths,
114 114
                     $this->fallbackDirsPsr0
115 115
                 );
116 116
             } else {
117 117
                 $this->fallbackDirsPsr0 = array_merge(
118 118
                     $this->fallbackDirsPsr0,
119
-                    (array) $paths
119
+                    (array)$paths
120 120
                 );
121 121
             }
122 122
 
@@ -125,19 +125,19 @@  discard block
 block discarded – undo
125 125
 
126 126
         $first = $prefix[0];
127 127
         if (!isset($this->prefixesPsr0[$first][$prefix])) {
128
-            $this->prefixesPsr0[$first][$prefix] = (array) $paths;
128
+            $this->prefixesPsr0[$first][$prefix] = (array)$paths;
129 129
 
130 130
             return;
131 131
         }
132 132
         if ($prepend) {
133 133
             $this->prefixesPsr0[$first][$prefix] = array_merge(
134
-                (array) $paths,
134
+                (array)$paths,
135 135
                 $this->prefixesPsr0[$first][$prefix]
136 136
             );
137 137
         } else {
138 138
             $this->prefixesPsr0[$first][$prefix] = array_merge(
139 139
                 $this->prefixesPsr0[$first][$prefix],
140
-                (array) $paths
140
+                (array)$paths
141 141
             );
142 142
         }
143 143
     }
@@ -158,34 +158,34 @@  discard block
 block discarded – undo
158 158
             // Register directories for the root namespace.
159 159
             if ($prepend) {
160 160
                 $this->fallbackDirsPsr4 = array_merge(
161
-                    (array) $paths,
161
+                    (array)$paths,
162 162
                     $this->fallbackDirsPsr4
163 163
                 );
164 164
             } else {
165 165
                 $this->fallbackDirsPsr4 = array_merge(
166 166
                     $this->fallbackDirsPsr4,
167
-                    (array) $paths
167
+                    (array)$paths
168 168
                 );
169 169
             }
170 170
         } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
171 171
             // Register directories for a new namespace.
172 172
             $length = strlen($prefix);
173
-            if ('\\' !== $prefix[$length - 1]) {
173
+            if ('\\' !== $prefix[$length-1]) {
174 174
                 throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
175 175
             }
176 176
             $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
177
-            $this->prefixDirsPsr4[$prefix] = (array) $paths;
177
+            $this->prefixDirsPsr4[$prefix] = (array)$paths;
178 178
         } elseif ($prepend) {
179 179
             // Prepend directories for an already registered namespace.
180 180
             $this->prefixDirsPsr4[$prefix] = array_merge(
181
-                (array) $paths,
181
+                (array)$paths,
182 182
                 $this->prefixDirsPsr4[$prefix]
183 183
             );
184 184
         } else {
185 185
             // Append directories for an already registered namespace.
186 186
             $this->prefixDirsPsr4[$prefix] = array_merge(
187 187
                 $this->prefixDirsPsr4[$prefix],
188
-                (array) $paths
188
+                (array)$paths
189 189
             );
190 190
         }
191 191
     }
@@ -200,9 +200,9 @@  discard block
 block discarded – undo
200 200
     public function set($prefix, $paths)
201 201
     {
202 202
         if (!$prefix) {
203
-            $this->fallbackDirsPsr0 = (array) $paths;
203
+            $this->fallbackDirsPsr0 = (array)$paths;
204 204
         } else {
205
-            $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
205
+            $this->prefixesPsr0[$prefix[0]][$prefix] = (array)$paths;
206 206
         }
207 207
     }
208 208
 
@@ -218,14 +218,14 @@  discard block
 block discarded – undo
218 218
     public function setPsr4($prefix, $paths)
219 219
     {
220 220
         if (!$prefix) {
221
-            $this->fallbackDirsPsr4 = (array) $paths;
221
+            $this->fallbackDirsPsr4 = (array)$paths;
222 222
         } else {
223 223
             $length = strlen($prefix);
224
-            if ('\\' !== $prefix[$length - 1]) {
224
+            if ('\\' !== $prefix[$length-1]) {
225 225
                 throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
226 226
             }
227 227
             $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
228
-            $this->prefixDirsPsr4[$prefix] = (array) $paths;
228
+            $this->prefixDirsPsr4[$prefix] = (array)$paths;
229 229
         }
230 230
     }
231 231
 
@@ -344,14 +344,14 @@  discard block
 block discarded – undo
344 344
     private function findFileWithExtension($class, $ext)
345 345
     {
346 346
         // PSR-4 lookup
347
-        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
347
+        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR).$ext;
348 348
 
349 349
         $first = $class[0];
350 350
         if (isset($this->prefixLengthsPsr4[$first])) {
351 351
             foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
352 352
                 if (0 === strpos($class, $prefix)) {
353 353
                     foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
354
-                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
354
+                        if (file_exists($file = $dir.DIRECTORY_SEPARATOR.substr($logicalPathPsr4, $length))) {
355 355
                             return $file;
356 356
                         }
357 357
                     }
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 
362 362
         // PSR-4 fallback dirs
363 363
         foreach ($this->fallbackDirsPsr4 as $dir) {
364
-            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
364
+            if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr4)) {
365 365
                 return $file;
366 366
             }
367 367
         }
@@ -369,18 +369,18 @@  discard block
 block discarded – undo
369 369
         // PSR-0 lookup
370 370
         if (false !== $pos = strrpos($class, '\\')) {
371 371
             // namespaced class name
372
-            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
373
-                . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
372
+            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos+1)
373
+                . strtr(substr($logicalPathPsr4, $pos+1), '_', DIRECTORY_SEPARATOR);
374 374
         } else {
375 375
             // PEAR-like class name
376
-            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
376
+            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR).$ext;
377 377
         }
378 378
 
379 379
         if (isset($this->prefixesPsr0[$first])) {
380 380
             foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
381 381
                 if (0 === strpos($class, $prefix)) {
382 382
                     foreach ($dirs as $dir) {
383
-                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
383
+                        if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) {
384 384
                             return $file;
385 385
                         }
386 386
                     }
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 
391 391
         // PSR-0 fallback dirs
392 392
         foreach ($this->fallbackDirsPsr0 as $dir) {
393
-            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
393
+            if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) {
394 394
                 return $file;
395 395
             }
396 396
         }
Please login to merge, or discard this patch.
vendor/composer/autoload_real.php 2 patches
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -4,67 +4,67 @@
 block discarded – undo
4 4
 
5 5
 class ComposerAutoloaderInit3c2653ee0122271a747f790f301ba7fb
6 6
 {
7
-    private static $loader;
7
+	private static $loader;
8 8
 
9
-    public static function loadClassLoader($class)
10
-    {
11
-        if ('Composer\Autoload\ClassLoader' === $class) {
12
-            require __DIR__ . '/ClassLoader.php';
13
-        }
14
-    }
9
+	public static function loadClassLoader($class)
10
+	{
11
+		if ('Composer\Autoload\ClassLoader' === $class) {
12
+			require __DIR__ . '/ClassLoader.php';
13
+		}
14
+	}
15 15
 
16
-    public static function getLoader()
17
-    {
18
-        if (null !== self::$loader) {
19
-            return self::$loader;
20
-        }
16
+	public static function getLoader()
17
+	{
18
+		if (null !== self::$loader) {
19
+			return self::$loader;
20
+		}
21 21
 
22
-        spl_autoload_register(array('ComposerAutoloaderInit3c2653ee0122271a747f790f301ba7fb', 'loadClassLoader'), true, true);
23
-        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
-        spl_autoload_unregister(array('ComposerAutoloaderInit3c2653ee0122271a747f790f301ba7fb', 'loadClassLoader'));
22
+		spl_autoload_register(array('ComposerAutoloaderInit3c2653ee0122271a747f790f301ba7fb', 'loadClassLoader'), true, true);
23
+		self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+		spl_autoload_unregister(array('ComposerAutoloaderInit3c2653ee0122271a747f790f301ba7fb', 'loadClassLoader'));
25 25
 
26
-        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
27
-        if ($useStaticLoader) {
28
-            require_once __DIR__ . '/autoload_static.php';
26
+		$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
27
+		if ($useStaticLoader) {
28
+			require_once __DIR__ . '/autoload_static.php';
29 29
 
30
-            call_user_func(\Composer\Autoload\ComposerStaticInit3c2653ee0122271a747f790f301ba7fb::getInitializer($loader));
31
-        } else {
32
-            $map = require __DIR__ . '/autoload_namespaces.php';
33
-            foreach ($map as $namespace => $path) {
34
-                $loader->set($namespace, $path);
35
-            }
30
+			call_user_func(\Composer\Autoload\ComposerStaticInit3c2653ee0122271a747f790f301ba7fb::getInitializer($loader));
31
+		} else {
32
+			$map = require __DIR__ . '/autoload_namespaces.php';
33
+			foreach ($map as $namespace => $path) {
34
+				$loader->set($namespace, $path);
35
+			}
36 36
 
37
-            $map = require __DIR__ . '/autoload_psr4.php';
38
-            foreach ($map as $namespace => $path) {
39
-                $loader->setPsr4($namespace, $path);
40
-            }
37
+			$map = require __DIR__ . '/autoload_psr4.php';
38
+			foreach ($map as $namespace => $path) {
39
+				$loader->setPsr4($namespace, $path);
40
+			}
41 41
 
42
-            $classMap = require __DIR__ . '/autoload_classmap.php';
43
-            if ($classMap) {
44
-                $loader->addClassMap($classMap);
45
-            }
46
-        }
42
+			$classMap = require __DIR__ . '/autoload_classmap.php';
43
+			if ($classMap) {
44
+				$loader->addClassMap($classMap);
45
+			}
46
+		}
47 47
 
48
-        $loader->register(true);
48
+		$loader->register(true);
49 49
 
50
-        if ($useStaticLoader) {
51
-            $includeFiles = Composer\Autoload\ComposerStaticInit3c2653ee0122271a747f790f301ba7fb::$files;
52
-        } else {
53
-            $includeFiles = require __DIR__ . '/autoload_files.php';
54
-        }
55
-        foreach ($includeFiles as $fileIdentifier => $file) {
56
-            composerRequire3c2653ee0122271a747f790f301ba7fb($fileIdentifier, $file);
57
-        }
50
+		if ($useStaticLoader) {
51
+			$includeFiles = Composer\Autoload\ComposerStaticInit3c2653ee0122271a747f790f301ba7fb::$files;
52
+		} else {
53
+			$includeFiles = require __DIR__ . '/autoload_files.php';
54
+		}
55
+		foreach ($includeFiles as $fileIdentifier => $file) {
56
+			composerRequire3c2653ee0122271a747f790f301ba7fb($fileIdentifier, $file);
57
+		}
58 58
 
59
-        return $loader;
60
-    }
59
+		return $loader;
60
+	}
61 61
 }
62 62
 
63 63
 function composerRequire3c2653ee0122271a747f790f301ba7fb($fileIdentifier, $file)
64 64
 {
65
-    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
-        require $file;
65
+	if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
+		require $file;
67 67
 
68
-        $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
69
-    }
68
+		$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
69
+	}
70 70
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
     public static function loadClassLoader($class)
10 10
     {
11 11
         if ('Composer\Autoload\ClassLoader' === $class) {
12
-            require __DIR__ . '/ClassLoader.php';
12
+            require __DIR__.'/ClassLoader.php';
13 13
         }
14 14
     }
15 15
 
@@ -25,21 +25,21 @@  discard block
 block discarded – undo
25 25
 
26 26
         $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
27 27
         if ($useStaticLoader) {
28
-            require_once __DIR__ . '/autoload_static.php';
28
+            require_once __DIR__.'/autoload_static.php';
29 29
 
30 30
             call_user_func(\Composer\Autoload\ComposerStaticInit3c2653ee0122271a747f790f301ba7fb::getInitializer($loader));
31 31
         } else {
32
-            $map = require __DIR__ . '/autoload_namespaces.php';
32
+            $map = require __DIR__.'/autoload_namespaces.php';
33 33
             foreach ($map as $namespace => $path) {
34 34
                 $loader->set($namespace, $path);
35 35
             }
36 36
 
37
-            $map = require __DIR__ . '/autoload_psr4.php';
37
+            $map = require __DIR__.'/autoload_psr4.php';
38 38
             foreach ($map as $namespace => $path) {
39 39
                 $loader->setPsr4($namespace, $path);
40 40
             }
41 41
 
42
-            $classMap = require __DIR__ . '/autoload_classmap.php';
42
+            $classMap = require __DIR__.'/autoload_classmap.php';
43 43
             if ($classMap) {
44 44
                 $loader->addClassMap($classMap);
45 45
             }
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         if ($useStaticLoader) {
51 51
             $includeFiles = Composer\Autoload\ComposerStaticInit3c2653ee0122271a747f790f301ba7fb::$files;
52 52
         } else {
53
-            $includeFiles = require __DIR__ . '/autoload_files.php';
53
+            $includeFiles = require __DIR__.'/autoload_files.php';
54 54
         }
55 55
         foreach ($includeFiles as $fileIdentifier => $file) {
56 56
             composerRequire3c2653ee0122271a747f790f301ba7fb($fileIdentifier, $file);
Please login to merge, or discard this patch.
vendor/composer/autoload_static.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -6,14 +6,14 @@
 block discarded – undo
6 6
 
7 7
 class ComposerStaticInit3c2653ee0122271a747f790f301ba7fb
8 8
 {
9
-    public static $files = array (
10
-        'bc8607b1e7bad99fd7a60868b2df2530' => __DIR__ . '/../..' . '/source/bootstrap.php',
11
-    );
9
+	public static $files = array (
10
+		'bc8607b1e7bad99fd7a60868b2df2530' => __DIR__ . '/../..' . '/source/bootstrap.php',
11
+	);
12 12
 
13
-    public static function getInitializer(ClassLoader $loader)
14
-    {
15
-        return \Closure::bind(function () use ($loader) {
13
+	public static function getInitializer(ClassLoader $loader)
14
+	{
15
+		return \Closure::bind(function () use ($loader) {
16 16
 
17
-        }, null, ClassLoader::class);
18
-    }
17
+		}, null, ClassLoader::class);
18
+	}
19 19
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,13 +6,13 @@
 block discarded – undo
6 6
 
7 7
 class ComposerStaticInit3c2653ee0122271a747f790f301ba7fb
8 8
 {
9
-    public static $files = array (
10
-        'bc8607b1e7bad99fd7a60868b2df2530' => __DIR__ . '/../..' . '/source/bootstrap.php',
9
+    public static $files = array(
10
+        'bc8607b1e7bad99fd7a60868b2df2530' => __DIR__.'/../..'.'/source/bootstrap.php',
11 11
     );
12 12
 
13 13
     public static function getInitializer(ClassLoader $loader)
14 14
     {
15
-        return \Closure::bind(function () use ($loader) {
15
+        return \Closure::bind(function() use ($loader) {
16 16
 
17 17
         }, null, ClassLoader::class);
18 18
     }
Please login to merge, or discard this patch.
vendor/composer/autoload_files.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
 $baseDir = dirname($vendorDir);
7 7
 
8 8
 return array(
9
-    'bc8607b1e7bad99fd7a60868b2df2530' => $baseDir . '/source/bootstrap.php',
9
+	'bc8607b1e7bad99fd7a60868b2df2530' => $baseDir . '/source/bootstrap.php',
10 10
 );
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
 $baseDir = dirname($vendorDir);
7 7
 
8 8
 return array(
9
-    'bc8607b1e7bad99fd7a60868b2df2530' => $baseDir . '/source/bootstrap.php',
9
+    'bc8607b1e7bad99fd7a60868b2df2530' => $baseDir.'/source/bootstrap.php',
10 10
 );
Please login to merge, or discard this patch.
vendor/autoload.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,6 +2,6 @@
 block discarded – undo
2 2
 
3 3
 // autoload.php @generated by Composer
4 4
 
5
-require_once __DIR__ . '/composer' . '/autoload_real.php';
5
+require_once __DIR__.'/composer'.'/autoload_real.php';
6 6
 
7 7
 return ComposerAutoloaderInit3c2653ee0122271a747f790f301ba7fb::getLoader();
Please login to merge, or discard this patch.