mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
+9
-3
@@ -12,11 +12,11 @@ namespace Barryvdh\LaravelIdeHelper;
|
||||
|
||||
class Alias
|
||||
{
|
||||
|
||||
protected $alias;
|
||||
protected $facade;
|
||||
protected $extends = null;
|
||||
protected $classType = 'class';
|
||||
protected $short;
|
||||
protected $namespace = '__root';
|
||||
protected $root = null;
|
||||
protected $classes = array();
|
||||
@@ -42,7 +42,6 @@ class Alias
|
||||
$facade = '\\' . ltrim($facade, '\\');
|
||||
$this->facade = $facade;
|
||||
|
||||
|
||||
$this->detectRoot();
|
||||
|
||||
if ((!$this->isTrait() && $this->root)) {
|
||||
@@ -55,7 +54,6 @@ class Alias
|
||||
$this->detectNamespace();
|
||||
$this->detectClassType();
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,6 +112,12 @@ class Alias
|
||||
return $this->alias;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the short name (without namespace)
|
||||
*/
|
||||
public function getShortName(){
|
||||
return $this->short;
|
||||
}
|
||||
/**
|
||||
* Get the namespace from the alias
|
||||
*
|
||||
@@ -145,6 +149,8 @@ class Alias
|
||||
$nsParts = explode('\\', $this->alias);
|
||||
$this->short = array_pop($nsParts);
|
||||
$this->namespace = implode('\\', $nsParts);
|
||||
}else{
|
||||
$this->short = $this->alias;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user