mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
Use forked ContextFactory (#1643)
* Use forked ContextFactory * composer fix-style * Trim slashes --------- Co-authored-by: laravel-ide-helper <[email protected]>
This commit is contained in:
co-authored by
laravel-ide-helper
parent
791ba555f4
commit
e509790805
+2
-3
@@ -22,14 +22,13 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": "^8.2",
|
"php": "^8.2",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"barryvdh/reflection-docblock": "^2.2",
|
"barryvdh/reflection-docblock": "^2.3",
|
||||||
"composer/class-map-generator": "^1.0",
|
"composer/class-map-generator": "^1.0",
|
||||||
"illuminate/console": "^11.15",
|
"illuminate/console": "^11.15",
|
||||||
"illuminate/database": "^11.15",
|
"illuminate/database": "^11.15",
|
||||||
"illuminate/filesystem": "^11.15",
|
"illuminate/filesystem": "^11.15",
|
||||||
"illuminate/support": "^11.15",
|
"illuminate/support": "^11.15",
|
||||||
"nikic/php-parser": "^4.18 || ^5",
|
"nikic/php-parser": "^4.18 || ^5"
|
||||||
"phpdocumentor/type-resolver": "^1.1.0"
|
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"ext-pdo_sqlite": "*",
|
"ext-pdo_sqlite": "*",
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ use Barryvdh\LaravelIdeHelper\Generator;
|
|||||||
use Barryvdh\LaravelIdeHelper\Parsers\PhpDocReturnTypeParser;
|
use Barryvdh\LaravelIdeHelper\Parsers\PhpDocReturnTypeParser;
|
||||||
use Barryvdh\Reflection\DocBlock;
|
use Barryvdh\Reflection\DocBlock;
|
||||||
use Barryvdh\Reflection\DocBlock\Context;
|
use Barryvdh\Reflection\DocBlock\Context;
|
||||||
|
use Barryvdh\Reflection\DocBlock\ContextFactory;
|
||||||
use Barryvdh\Reflection\DocBlock\Serializer as DocBlockSerializer;
|
use Barryvdh\Reflection\DocBlock\Serializer as DocBlockSerializer;
|
||||||
use Barryvdh\Reflection\DocBlock\Tag;
|
use Barryvdh\Reflection\DocBlock\Tag;
|
||||||
use Composer\ClassMapGenerator\ClassMapGenerator;
|
use Composer\ClassMapGenerator\ClassMapGenerator;
|
||||||
@@ -49,7 +50,6 @@ use Illuminate\Support\Arr;
|
|||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Illuminate\View\Factory as ViewFactory;
|
use Illuminate\View\Factory as ViewFactory;
|
||||||
use phpDocumentor\Reflection\Types\ContextFactory;
|
|
||||||
use ReflectionClass;
|
use ReflectionClass;
|
||||||
use ReflectionNamedType;
|
use ReflectionNamedType;
|
||||||
use ReflectionObject;
|
use ReflectionObject;
|
||||||
@@ -1571,7 +1571,9 @@ class ModelsCommand extends Command
|
|||||||
*/
|
*/
|
||||||
protected function getUsedClassNames(ReflectionClass $reflection): array
|
protected function getUsedClassNames(ReflectionClass $reflection): array
|
||||||
{
|
{
|
||||||
$namespaceAliases = array_flip((new ContextFactory())->createFromReflector($reflection)->getNamespaceAliases());
|
$namespaceAliases = array_flip(array_map(function ($alias) {
|
||||||
|
return ltrim($alias, '\\');
|
||||||
|
}, (new ContextFactory())->createFromReflector($reflection)->getNamespaceAliases()));
|
||||||
$namespaceAliases[$reflection->getName()] = $reflection->getShortName();
|
$namespaceAliases[$reflection->getName()] = $reflection->getShortName();
|
||||||
|
|
||||||
return $namespaceAliases;
|
return $namespaceAliases;
|
||||||
|
|||||||
Reference in New Issue
Block a user