-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong namespaces generated in _ide_helper.php
file
#1659
Comments
@chack1172 can you check? |
@barryvdh I can take a look in the weekend. We should fix them in ReflectionDocBlock. |
@barryvdh fixed in ReflectionDocBlock: barryvdh/ReflectionDocBlock#27 |
Merged and tagged, thanks! |
Tested with /**
* @see \Illuminate\Events\Dispatcher
* @see \Illuminate\Support\Testing\Fakes\EventFake
*/
class Event
{
/**
* Register an event listener with the dispatcher.
*
* @param \Illuminate\Events\Queued\Closure|callable|array|class-string|string $events
* @param \Illuminate\Events\Queued\Closure|callable|array|class-string|null $listener
* @return void
*
* @static
*/
public static function listen($events, $listener = null)
{
/** @var \Illuminate\Events\Dispatcher $instance */
$instance->listen($events, $listener);
}
... Looking at /**
* Register an event listener with the dispatcher.
*
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string|string $events
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string|null $listener
* @return void
*/
public function listen($events, $listener = null) So in this case, |
@barryvdh this change is causing the last issue. Do you remember what was it for? |
I went to my vendors folder and commented out those 3 lines, everything works as expected, including the vendor\barryvdh\laravel-ide-helper\src\Method.php protected function convertKeywords($string)
{
// $string = str_replace('\Closure', 'Closure', $string);
// $string = str_replace('Closure', '\Closure', $string);
// $string = str_replace('dynamic', 'mixed', $string);
return $string;
} I also didn't see any |
Versions:
Description:
Recent version fixed namespaces for
@template
andphpdoc types
, but there are some types still getting wrong namespaces prepended to them.These are the ones I could find in
_ide_helper.php
file:\Illuminate\Cache\array{ **shape** }
, should bearray{ **shape** }
\Illuminate\Events\Queued\Closure
, should be\Closure
\Illuminate\Foundation\'waterfall'
|\Illuminate\Foundation\'aggressive'
, should be'waterfall'|'aggressive'
\Illuminate\Database\Eloquent\callable(something)
| \Symfony\Component\HttpFoundation\callable(something) should becallable(something)
Examples of wrong namespaces:
array shape
wrong
@param \Illuminate\Cache\array{ 0: \DateTimeInterface|\DateInterval|int, 1: \DateTimeInterface|\DateInterval|int } $ttl
correct
@param array{ 0: \DateTimeInterface|\DateInterval|int, 1: \DateTimeInterface|\DateInterval|int } $ttl
\Closure
wrong
@param \Illuminate\Events\Queued\Closure|callable|array|class-string|string $events
correct
@param \Closure|callable|array|class-string|string $events
specific string
wrong
@param \Illuminate\Foundation\'waterfall'|\Illuminate\Foundation\'aggressive'|null $strategy
correct
@param 'waterfall'|'aggressive'|null $strategy
callable
wrong
@param \Illuminate\Database\Eloquent\callable(\Illuminate\Support\Collection<int, TValue>, int): mixed $callback
correct
@param callable(\Illuminate\Support\Collection<int, TValue>, int): mixed $callback
The text was updated successfully, but these errors were encountered: