Skip to content

Commit

Permalink
Updating the alias
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Sep 6, 2015
1 parent b85a23d commit c2b3b27
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 40 deletions.
2 changes: 1 addition & 1 deletion helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @return \Arcanedev\LogViewer\LogViewer
*/
function log_viewer() {
return app('log-viewer');
return app('arcanedev.log-viewer');
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Bases/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ abstract class Controller extends IlluminateController
*/
public function __construct()
{
$this->logViewer = app('log-viewer');
$this->logViewer = app('arcanedev.log-viewer');
}
}
2 changes: 1 addition & 1 deletion src/Entities/LogCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class LogCollection extends Collection
*/
public function __construct($items = [])
{
$this->setFilesystem(app('log-viewer.filesystem'));
$this->setFilesystem(app('arcanedev.log-viewer.filesystem'));

parent::__construct($items);

Expand Down
2 changes: 1 addition & 1 deletion src/Facades/LogViewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ class LogViewer extends Facade
*
* @return string
*/
protected static function getFacadeAccessor() { return 'log-viewer'; }
protected static function getFacadeAccessor() { return 'arcanedev.log-viewer'; }
}
14 changes: 8 additions & 6 deletions src/LogViewerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ public function boot()
*/
public function provides()
{
return ['log-viewer'];
return [
'arcanedev.log-viewer'
];
}

/* ------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -137,20 +139,20 @@ private function registerViews()
*/
private function registerLogViewer()
{
$this->app->singleton($this->package, function ($app) {
$this->app->singleton('arcanedev.log-viewer', function ($app) {
/**
* @var Contracts\FactoryInterface $factory
* @var Contracts\FilesystemInterface $filesystem
* @var Contracts\LogLevelsInterface $levels
*/
$factory = $app[$this->package . '.factory'];
$filesystem = $app[$this->package . '.filesystem'];
$levels = $app[$this->package . '.levels'];
$factory = $app['arcanedev.log-viewer.factory'];
$filesystem = $app['arcanedev.log-viewer.filesystem'];
$levels = $app['arcanedev.log-viewer.levels'];

return new LogViewer($factory, $filesystem, $levels);
});

$this->app->alias($this->package, LogViewer::class);
$this->app->alias('arcanedev.log-viewer', LogViewer::class);
$this->app->alias(Contracts\LogViewerInterface::class, LogViewer::class);

// Registering the Facade
Expand Down
6 changes: 3 additions & 3 deletions src/Providers/CommandsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function provides()
private function registerPublishCommand()
{
$this->registerCommand('publish', function ($app) {
$logViewer = $app['log-viewer'];
$logViewer = $app['arcanedev.log-viewer'];

return new PublishCommand($logViewer);
});
Expand All @@ -75,7 +75,7 @@ private function registerPublishCommand()
public function registerStatsCommand()
{
$this->registerCommand('stats', function ($app) {
$logViewer = $app['log-viewer'];
$logViewer = $app['arcanedev.log-viewer'];

return new StatsCommand($logViewer);
});
Expand All @@ -93,7 +93,7 @@ public function registerStatsCommand()
*/
private function registerCommand($name, Closure $callback)
{
$command = "log-viewer.commands.$name";
$command = "arcanedev.log-viewer.commands.$name";

$this->app->singleton($command, $callback);

Expand Down
22 changes: 11 additions & 11 deletions src/Providers/UtilitiesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ private function registerLogLevels()
return new LogLevels($trans);
});

$this->app->alias('log-viewer.levels', LogLevels::class);
$this->app->alias(LogLevelsInterface::class, LogLevels::class);
$this->app->alias('arcanedev.log-viewer.levels', LogLevels::class);
$this->app->alias(LogLevelsInterface::class, LogLevels::class);
}

/**
Expand All @@ -89,8 +89,8 @@ private function registerLogMenu()
return new LogMenu($config, $trans);
});

$this->app->alias('log-viewer.menu', LogMenu::class);
$this->app->alias(LogMenuInterface::class, LogMenu::class);
$this->app->alias('arcanedev.log-viewer.menu', LogMenu::class);
$this->app->alias(LogMenuInterface::class, LogMenu::class);
}

/**
Expand All @@ -105,8 +105,8 @@ private function registerFilesystem()
return new Filesystem($files, $path);
});

$this->app->alias('log-viewer.filesystem', Filesystem::class);
$this->app->alias(FilesystemInterface::class, Filesystem::class);
$this->app->alias('arcanedev.log-viewer.filesystem', Filesystem::class);
$this->app->alias(FilesystemInterface::class, Filesystem::class);
}

/**
Expand All @@ -119,14 +119,14 @@ private function registerFactory()
* @var FilesystemInterface $filesystem
* @var LogLevelsInterface $level
*/
$filesystem = $app['log-viewer.filesystem'];
$level = $app['log-viewer.levels'];
$filesystem = $app['arcanedev.log-viewer.filesystem'];
$level = $app['arcanedev.log-viewer.levels'];

return new Factory($filesystem, $level);
});

$this->app->alias('log-viewer.factory', Factory::class);
$this->app->alias(FactoryInterface::class, Factory::class);
$this->app->alias('arcanedev.log-viewer.factory', Factory::class);
$this->app->alias(FactoryInterface::class, Factory::class);
}

/* ------------------------------------------------------------------------------------------------
Expand All @@ -141,7 +141,7 @@ private function registerFactory()
*/
private function registerUtility($name, Closure $callback)
{
$name = "log-viewer.$name";
$name = "arcanedev.log-viewer.$name";

$this->app->singleton($name, $callback);

Expand Down
2 changes: 1 addition & 1 deletion tests/LogViewerServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function tearDown()
public function it_can_get_provides_list()
{
$provided = $this->provider->provides();
$defaults = ['log-viewer'];
$defaults = ['arcanedev.log-viewer'];

$this->assertCount(count($defaults), $provided);
$this->assertEquals($defaults, $provided);
Expand Down
2 changes: 1 addition & 1 deletion tests/LogViewerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function setUp()
{
parent::setUp();

$this->logViewer = $this->app['log-viewer'];
$this->logViewer = $this->app['arcanedev.log-viewer'];
}

public function tearDown()
Expand Down
4 changes: 2 additions & 2 deletions tests/Providers/CommandsServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class CommandsServiceProviderTest extends TestCase

/** @var array */
private $commands = [
'log-viewer.commands.publish',
'log-viewer.commands.stats',
'arcanedev.log-viewer.commands.publish',
'arcanedev.log-viewer.commands.stats',
];

/* ------------------------------------------------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions tests/Providers/UtilitiesServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ class UtilitiesServiceProviderTest extends TestCase

/** @var array */
private $utilities = [
'log-viewer.levels',
'log-viewer.menu',
'log-viewer.filesystem',
'log-viewer.factory',
'arcanedev.log-viewer.levels',
'arcanedev.log-viewer.menu',
'arcanedev.log-viewer.filesystem',
'arcanedev.log-viewer.factory',
];

/* ------------------------------------------------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions tests/Tables/StatsTableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public function setUp()
parent::setUp();

$this->table = new StatsTable(
$this->rawData = $this->app['log-viewer']->stats(),
$this->app['log-viewer.levels']
$this->rawData = $this->app['arcanedev.log-viewer']->stats(),
$this->app['arcanedev.log-viewer.levels']
);
}

Expand All @@ -56,8 +56,8 @@ public function it_can_be_instantiated()
public function it_can_make_instance()
{
$this->table = StatsTable::make(
$this->app['log-viewer']->stats(),
$this->app['log-viewer.levels']
$this->app['arcanedev.log-viewer']->stats(),
$this->app['arcanedev.log-viewer.levels']
);

$this->assertTable($this->table);
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ public function illuminateFile()
*/
protected function filesystem()
{
return $this->app['log-viewer.filesystem'];
return $this->app['arcanedev.log-viewer.filesystem'];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Utilities/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function setUp()
{
parent::setUp();

$this->logFactory = $this->app['log-viewer.factory'];
$this->logFactory = $this->app['arcanedev.log-viewer.factory'];
}

public function tearDown()
Expand Down
2 changes: 1 addition & 1 deletion tests/Utilities/LogLevelsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function setUp()
{
parent::setUp();

$this->levels = $this->app['log-viewer.levels'];
$this->levels = $this->app['arcanedev.log-viewer.levels'];
}

public function tearDown()
Expand Down
2 changes: 1 addition & 1 deletion tests/Utilities/LogMenuTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function setUp()
{
parent::setUp();

$this->menu = $this->app['log-viewer.menu'];
$this->menu = $this->app['arcanedev.log-viewer.menu'];
}

public function tearDown()
Expand Down

0 comments on commit c2b3b27

Please sign in to comment.