Skip to content

Commit

Permalink
various formatting and cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 3, 2018
1 parent 434b348 commit 043bd5e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 16 deletions.
17 changes: 16 additions & 1 deletion src/Illuminate/Foundation/Console/ChannelMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,22 @@ class ChannelMakeCommand extends GeneratorCommand
*
* @var string
*/
protected $type = 'Broadcasting Channel';
protected $type = 'Channel';

/**
* Build the class with the given name.
*
* @param string $name
* @return string
*/
protected function buildClass($name)
{
return str_replace(
'DummyUser',
class_basename(config('auth.providers.users.model')),
parent::buildClass($name)
);
}

/**
* Get the stub file for the generator.
Expand Down
9 changes: 6 additions & 3 deletions src/Illuminate/Foundation/Console/stubs/channel.stub
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

namespace DummyNamespace;

use NamespacedDummyUserModel;

class DummyClass
{
/**
* Create a new broadcasting channel instance.
* Create a new channel instance.
*
* @return void
*/
Expand All @@ -17,9 +19,10 @@ class DummyClass
/**
* Authenticates the channel.
*
* @return mixed
* @param \NamespacedDummyUserModel $user
* @return array|bool
*/
public function join()
public function join(DummyUser $user)
{
//
}
Expand Down
24 changes: 12 additions & 12 deletions src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,18 @@ protected function registerCacheTableCommand()
});
}

/**
* Register the command.
*
* @return void
*/
protected function registerChannelMakeCommand()
{
$this->app->singleton('command.channel.make', function ($app) {
return new ChannelMakeCommand($app['files']);
});
}

/**
* Register the command.
*
Expand Down Expand Up @@ -400,18 +412,6 @@ protected function registerJobMakeCommand()
});
}

/**
* Register the command.
*
* @return void
*/
protected function registerChannelMakeCommand()
{
$this->app->singleton('command.channel.make', function ($app) {
return new ChannelMakeCommand($app['files']);
});
}

/**
* Register the command.
*
Expand Down

0 comments on commit 043bd5e

Please sign in to comment.