Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
199 lars 1
<?php namespace Clockwork\Helpers;
2
 
3
// A single frame of a stack trace
4
class StackFrame
5
{
6
	public $call;
7
	public $function;
8
	public $line;
9
	public $file;
10
	public $class;
11
	public $object;
12
	public $type;
13
	public $args = [];
14
	public $shortPath;
15
	public $vendor;
16
 
17
	public function __construct(array $data = [], $basePath = '', $vendorPath = '')
18
	{
19
		foreach ($data as $key => $value) {
20
			$this->$key = $value;
21
		}
22
 
23
		$this->call = $this->formatCall();
24
 
25
		$this->shortPath = $this->file ? str_replace($basePath, '', $this->file) : null;
26
		$this->vendor = ($this->file && strpos($this->file, $vendorPath) === 0)
27
			? explode(DIRECTORY_SEPARATOR, str_replace($vendorPath, '', $this->file))[0] : null;
28
	}
29
 
30
	protected function formatCall()
31
	{
32
		if ($this->class) {
33
			return "{$this->class}{$this->type}{$this->function}()";
34
		} else {
35
			return "{$this->function}()";
36
		}
37
	}
38
}