Skip to content

Commit

Permalink
Merge pull request #1 from KodiCMS/analysis-877OE8
Browse files Browse the repository at this point in the history
Applied fixes from StyleCI
  • Loading branch information
butschster committed Nov 4, 2015
2 parents 11508d7 + 79c9ebe commit 051ed44
Show file tree
Hide file tree
Showing 17 changed files with 117 additions and 206 deletions.
21 changes: 8 additions & 13 deletions src/AppModuleContainer.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace KodiCMS\ModulesLoader;

class AppModuleContainer extends ModuleContainer
{

/**
* @var string
*/
Expand All @@ -14,22 +14,20 @@ class AppModuleContainer extends ModuleContainer
*/
protected $isPublishable = false;


/**
* @param \Illuminate\Foundation\Application $app
*
* @return $this
*/
public function boot($app)
{
if ( ! $this->isBooted) {
if (!$this->isBooted) {
$this->isBooted = true;
}

return $this;
}


/**
* @param \Illuminate\Foundation\Application $app
*
Expand All @@ -42,40 +40,37 @@ public function register($app)
return $this;
}


/**
* @return string
*/
public function getRoutesPath()
{
return $this->getPath([ 'app', 'Http', 'routes.php' ]);
return $this->getPath(['app', 'Http', 'routes.php']);
}


/**
* @return string
*/
public function getServiceProviderPath()
{
return $this->getPath([ 'app', 'Providers', 'ModuleServiceProvider.php' ]);
return $this->getPath(['app', 'Providers', 'ModuleServiceProvider.php']);
}


/**
* Register a config file namespace.
*
* @return void
*/
public function loadConfig()
{
return [ ];
return [];
}


/**
* @return array
*/
public function getPublishPath()
{
return [ ];
return [];
}
}
}
17 changes: 8 additions & 9 deletions src/Console/Commands/ModulesList.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace KodiCMS\ModulesLoader\Console\Commands;

use ModulesLoader;
Expand All @@ -7,7 +8,6 @@

class ModulesList extends Command
{

/**
* The console command name.
*
Expand All @@ -22,33 +22,32 @@ class ModulesList extends Command
*/
protected $headers = [
'Name',
''
'',
];


/**
* Execute the console command.
*
* @return mixed
*/
public function fire()
{
$modules = [ ];
$modules = [];

foreach (ModulesLoader::getRegisteredModules() as $module) {
$modules[] = [
$module->getName() . ' [' . get_class($module) . ']',
''
$module->getName().' ['.get_class($module).']',
'',
];
$modules[] = new TableSeparator;
$modules[] = new TableSeparator();
foreach ($module->toArray() as $key => $value) {
$modules[] = [
studly_case($key),
is_string($value) ? $value : stripslashes(json_encode($value))
is_string($value) ? $value : stripslashes(json_encode($value)),
];
}

$modules[] = new TableSeparator;
$modules[] = new TableSeparator();
}

$this->table($this->headers, $modules);
Expand Down
6 changes: 2 additions & 4 deletions src/Console/Commands/ModulesMigrateCommand.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace KodiCMS\ModulesLoader\Console\Commands;

use Illuminate\Console\Command;
Expand All @@ -9,21 +10,19 @@

class ModulesMigrateCommand extends Command
{

use ConfirmableTrait;

/**
* The console command name.
*/
protected $name = 'modules:migrate';


/**
* Execute the console command.
*/
public function fire()
{
if ( ! $this->confirmToProceed()) {
if (!$this->confirmToProceed()) {
return;
}

Expand Down Expand Up @@ -54,7 +53,6 @@ public function fire()
}
}


/**
* Get the console command options.
*
Expand Down
6 changes: 2 additions & 4 deletions src/Console/Commands/ModulesSeedCommand.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace KodiCMS\ModulesLoader\Console\Commands;

use Illuminate\Console\Command;
Expand All @@ -9,21 +10,19 @@

class ModulesSeedCommand extends Command
{

use ConfirmableTrait;

/**
* The console command name.
*/
protected $name = 'modules:seed';


/**
* Execute the console command.
*/
public function fire()
{
if ( ! $this->confirmToProceed()) {
if (!$this->confirmToProceed()) {
return;
}

Expand All @@ -38,7 +37,6 @@ public function fire()
}
}


/**
* Get the console command options.
*
Expand Down
16 changes: 2 additions & 14 deletions src/Contracts/ModuleContainerInterface.php
Original file line number Diff line number Diff line change
@@ -1,91 +1,79 @@
<?php

namespace KodiCMS\ModulesLoader\Contracts;

use Illuminate\Routing\Router;

interface ModuleContainerInterface
{

/**
* @param string $moduleName
* @param null|string $modulePath
* @param null|string $namespace
*/
public function __construct($moduleName, $modulePath = null, $namespace = null);


/**
* @return string
*/
public function getName();


/**
* @return string
*/
public function getNamespace();


/**
* @return string
*/
public function getControllerNamespace();


/**
* @param strimg|null $sub
*
* @return string
*/
public function getPath($sub = null);


/**
* @return string
*/
public function getLocalePath();


/**
* @return string
*/
public function getViewsPath();


/**
* @return string
*/
public function getConfigPath();


/**
* @return string
*/
public function getRoutesPath();


/**
* @return string
*/
public function getServiceProviderPath();


/**
* @return array
*/
public function getPublishPath();


/**
* @return array
*/
public function loadConfig();


/**
* @param Router $router
*
* @return void
*/
public function loadRoutes(Router $router);
}
}
4 changes: 2 additions & 2 deletions src/Exceptions/ModuleLoaderException.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

namespace KodiCMS\ModulesLoader\Exceptions;

class ModuleLoaderException extends \RuntimeException
{

}
}
Loading

0 comments on commit 051ed44

Please sign in to comment.