Skip to content

Commit

Permalink
[6.x] Improve @method docblocks on facades (#30631)
Browse files Browse the repository at this point in the history
* Add autocomplete support for EventFake assertions on the Event facade

* Fix @method docblocks for MailFake on Mail facade

* Fix @method docblocks for NotificationFake on Notification facade

* Add autocomplete support on the Storage facade
  • Loading branch information
sebdesign authored and taylorotwell committed Nov 20, 2019
1 parent 8acfa75 commit e334958
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/Illuminate/Support/Facades/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
* @method static void forget(string $event)
* @method static void forgetPushed()
* @method static \Illuminate\Events\Dispatcher setQueueResolver(callable $resolver)
* @method static void assertDispatched(string $event, callable|int $callback = null)
* @method static void assertDispatchedTimes(string $event, int $times = 1)
* @method static void assertNotDispatched(string $event, callable|int $callback = null)
*
* @see \Illuminate\Events\Dispatcher
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Illuminate/Support/Facades/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
* @method static array failures()
* @method static mixed queue(\Illuminate\Contracts\Mail\Mailable|string|array $view, string $queue = null)
* @method static mixed later(\DateTimeInterface|\DateInterval|int $delay, \Illuminate\Contracts\Mail\Mailable|string|array $view, string $queue = null)
* @method static void assertSent(string $mailable, \Closure|string $callback = null)
* @method static void assertNotSent(string $mailable, \Closure|string $callback = null)
* @method static void assertSent(string $mailable, callable|int $callback = null)
* @method static void assertNotSent(string $mailable, callable|int $callback = null)
* @method static void assertNothingSent()
* @method static void assertQueued(string $mailable, \Closure|string $callback = null)
* @method static void assertNotQueued(string $mailable, \Closure|string $callback = null)
* @method static void assertQueued(string $mailable, callable|int $callback = null)
* @method static void assertNotQueued(string $mailable, callable $callback = null)
* @method static void assertNothingQueued()
* @method static \Illuminate\Support\Collection sent(string $mailable, \Closure|string $callback = null)
* @method static bool hasSent(string $mailable)
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Support/Facades/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
* @method static void sendNow(\Illuminate\Support\Collection|array|mixed $notifiables, $notification)
* @method static mixed channel(string|null $name = null)
* @method static \Illuminate\Notifications\ChannelManager locale(string|null $locale)
* @method static void assertSentTo(\Illuminate\Support\Collection|array|mixed $notifiable, string $notification, callable $callback = null)
* @method static void assertSentTo(mixed $notifiable, string $notification, callable $callback = null)
* @method static void assertSentToTimes(mixed $notifiable, string $notification, int $times = 1)
* @method static void assertNotSentTo(\Illuminate\Support\Collection|array|mixed $notifiable, string $notification, callable $callback = null)
* @method static void assertNotSentTo(mixed $notifiable, string $notification, callable $callback = null)
* @method static void assertNothingSent()
* @method static void assertTimesSent(int $expectedCount, string $notification)
* @method static \Illuminate\Support\Collection sent(mixed $notifiable, string $notification, callable $callback = null)
Expand Down
22 changes: 22 additions & 0 deletions src/Illuminate/Support/Facades/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,28 @@

/**
* @method static \Illuminate\Contracts\Filesystem\Filesystem disk(string $name = null)
* @method static bool exists(string $path)
* @method static string get(string $path)
* @method static resource|null readStream(string $path)
* @method static bool put(string $path, string|resource $contents, mixed $options = [])
* @method static bool writeStream(string $path, resource $resource, array $options = [])
* @method static string getVisibility(string $path)
* @method static bool setVisibility(string $path, string $visibility)
* @method static bool prepend(string $path, string $data)
* @method static bool append(string $path, string $data)
* @method static bool delete(string|array $paths)
* @method static bool copy(string $from, string $to)
* @method static bool move(string $from, string $to)
* @method static int size(string $path)
* @method static int lastModified(string $path)
* @method static array files(string|null $directory = null, bool $recursive = false)
* @method static array allFiles(string|null $directory = null)
* @method static array directories(string|null $directory = null, bool $recursive = false)
* @method static array allDirectories(string|null $directory = null)
* @method static bool makeDirectory(string $path)
* @method static bool deleteDirectory(string $directory)
* @method static \Illuminate\Contracts\Filesystem\Filesystem assertExists(string|array $path)
* @method static \Illuminate\Contracts\Filesystem\Filesystem assertMissing(string|array $path)
*
* @see \Illuminate\Filesystem\FilesystemManager
*/
Expand Down

0 comments on commit e334958

Please sign in to comment.