From 8c306035aa8a16b6871a50fdd7684cc3ba9e70b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Lef=C3=A8vre?= Date: Mon, 13 Feb 2017 12:52:36 +0100 Subject: [PATCH] Fix facades fullpath autocomplete (#441) * Add method to retrieve namespace of extended class * Regroup classes by namespace of the class they extends * Restore facades shortnames * Fix classnames used for methods declaration --- resources/views/helper.php | 2 +- src/Alias.php | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/resources/views/helper.php b/resources/views/helper.php index 2cba643..38ab30c 100644 --- a/resources/views/helper.php +++ b/resources/views/helper.php @@ -15,7 +15,7 @@ namespace { namespace { - getClassType() ?> getShortName() ?> { + getClassType() ?> getExtendsCLass() ?> { getMethods() as $method): ?> getDocComment(' ')) ?> diff --git a/src/Alias.php b/src/Alias.php index d1f9ca6..3112491 100644 --- a/src/Alias.php +++ b/src/Alias.php @@ -15,6 +15,7 @@ class Alias protected $alias; protected $facade; protected $extends = null; + protected $extendsClass = null; protected $extendsNamespace = null; protected $classType = 'class'; protected $short; @@ -107,6 +108,16 @@ class Alias return $this->extends; } + /** + * Get the class short name which this alias extends + * + * @return null|string + */ + public function getExtendsClass() + { + return $this->extendsClass; + } + /** * Get the namespace of the class which this alias extends * @@ -177,7 +188,7 @@ class Alias { if (strpos($this->extends, '\\') !== false) { $nsParts = explode('\\', $this->extends); - array_pop($nsParts); + $this->extendsClass = array_pop($nsParts); $this->extendsNamespace = implode('\\', $nsParts); } }