Skip to content

Commit 043bd5e

Browse files
committed
various formatting and cleaning
1 parent 434b348 commit 043bd5e

File tree

3 files changed

+34
-16
lines changed

3 files changed

+34
-16
lines changed

src/Illuminate/Foundation/Console/ChannelMakeCommand.php

+16-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,22 @@ class ChannelMakeCommand extends GeneratorCommand
2525
*
2626
* @var string
2727
*/
28-
protected $type = 'Broadcasting Channel';
28+
protected $type = 'Channel';
29+
30+
/**
31+
* Build the class with the given name.
32+
*
33+
* @param string $name
34+
* @return string
35+
*/
36+
protected function buildClass($name)
37+
{
38+
return str_replace(
39+
'DummyUser',
40+
class_basename(config('auth.providers.users.model')),
41+
parent::buildClass($name)
42+
);
43+
}
2944

3045
/**
3146
* Get the stub file for the generator.

src/Illuminate/Foundation/Console/stubs/channel.stub

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
namespace DummyNamespace;
44

5+
use NamespacedDummyUserModel;
6+
57
class DummyClass
68
{
79
/**
8-
* Create a new broadcasting channel instance.
10+
* Create a new channel instance.
911
*
1012
* @return void
1113
*/
@@ -17,9 +19,10 @@ class DummyClass
1719
/**
1820
* Authenticates the channel.
1921
*
20-
* @return mixed
22+
* @param \NamespacedDummyUserModel $user
23+
* @return array|bool
2124
*/
22-
public function join()
25+
public function join(DummyUser $user)
2326
{
2427
//
2528
}

src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php

+12-12
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,18 @@ protected function registerCacheTableCommand()
244244
});
245245
}
246246

247+
/**
248+
* Register the command.
249+
*
250+
* @return void
251+
*/
252+
protected function registerChannelMakeCommand()
253+
{
254+
$this->app->singleton('command.channel.make', function ($app) {
255+
return new ChannelMakeCommand($app['files']);
256+
});
257+
}
258+
247259
/**
248260
* Register the command.
249261
*
@@ -400,18 +412,6 @@ protected function registerJobMakeCommand()
400412
});
401413
}
402414

403-
/**
404-
* Register the command.
405-
*
406-
* @return void
407-
*/
408-
protected function registerChannelMakeCommand()
409-
{
410-
$this->app->singleton('command.channel.make', function ($app) {
411-
return new ChannelMakeCommand($app['files']);
412-
});
413-
}
414-
415415
/**
416416
* Register the command.
417417
*

0 commit comments

Comments
 (0)