Skip to content

Commit

Permalink
CS Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gravitano committed Jun 5, 2015
1 parent 498da67 commit f8680b8
Show file tree
Hide file tree
Showing 56 changed files with 445 additions and 380 deletions.
5 changes: 3 additions & 2 deletions Collection.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php namespace Pingpong\Modules;
<?php

namespace Pingpong\Modules;

use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Support\Collection as BaseCollection;

class Collection extends BaseCollection
{

/**
* Get items collections.
*
Expand Down
8 changes: 5 additions & 3 deletions Commands/CommandCommand.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Pingpong\Modules\Commands;
<?php

namespace Pingpong\Modules\Commands;

use Illuminate\Support\Str;
use Pingpong\Support\Stub;
Expand Down Expand Up @@ -66,7 +68,7 @@ protected function getTemplateContents()
return (new Stub('/command.stub', [
'COMMAND_NAME' => $this->getCommandName(),
'NAMESPACE' => $this->getClassNamespace($module),
'CLASS' => $this->getClass()
'CLASS' => $this->getClass(),
]))->render();
}

Expand All @@ -79,7 +81,7 @@ protected function getDestinationFilePath()

$seederPath = $this->laravel['modules']->config('paths.generator.command');

return $path . $seederPath . '/' . $this->getFileName() . '.php';
return $path.$seederPath.'/'.$this->getFileName().'.php';
}

/**
Expand Down
12 changes: 7 additions & 5 deletions Commands/ControllerCommand.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Pingpong\Modules\Commands;
<?php

namespace Pingpong\Modules\Commands;

use Pingpong\Support\Stub;
use Pingpong\Modules\Traits\ModuleCommandTrait;
Expand Down Expand Up @@ -40,7 +42,7 @@ public function getDestinationFilePath()

$controllerPath = $this->laravel['modules']->config('paths.generator.controller');

return $path . $controllerPath . '/' . $this->getControllerName() . '.php';
return $path.$controllerPath.'/'.$this->getControllerName().'.php';
}

/**
Expand All @@ -56,7 +58,7 @@ protected function getTemplateContents()
'CLASS' => $this->getClass(),
'NAMESPACE' => $module->getLowername(),
'MODULE_NAMESPACE' => $this->laravel['modules']->config('namespace'),
'CLASS_NAMESPACE' => $this->getClassNamespace($module)
'CLASS_NAMESPACE' => $this->getClassNamespace($module),
]))->render();
}

Expand All @@ -80,8 +82,8 @@ protected function getControllerName()
{
$controller = studly_case($this->argument('controller'));

if (! str_contains(strtolower($controller), 'controller')) {
$controller = $controller . 'Controller';
if (!str_contains(strtolower($controller), 'controller')) {
$controller = $controller.'Controller';
}

return $controller;
Expand Down
5 changes: 3 additions & 2 deletions Commands/DisableCommand.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php namespace Pingpong\Modules\Commands;
<?php

namespace Pingpong\Modules\Commands;

use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputArgument;

class DisableCommand extends Command
{

/**
* The console command name.
*
Expand Down
7 changes: 4 additions & 3 deletions Commands/DumpCommand.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php namespace Pingpong\Modules\Commands;
<?php

namespace Pingpong\Modules\Commands;

use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputArgument;

class DumpCommand extends Command
{

/**
* The console command name.
*
Expand All @@ -27,7 +28,7 @@ class DumpCommand extends Command
*/
public function fire()
{
$this->info("Generating optimized autoload modules.");
$this->info('Generating optimized autoload modules.');

if ($module = $this->argument('module')) {
$this->dump($module);
Expand Down
5 changes: 3 additions & 2 deletions Commands/EnableCommand.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php namespace Pingpong\Modules\Commands;
<?php

namespace Pingpong\Modules\Commands;

use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputArgument;

class EnableCommand extends Command
{

/**
* The console command name.
*
Expand Down
10 changes: 6 additions & 4 deletions Commands/GenerateFilterCommand.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Pingpong\Modules\Commands;
<?php

namespace Pingpong\Modules\Commands;

use Illuminate\Support\Str;
use Pingpong\Support\Stub;
Expand Down Expand Up @@ -49,10 +51,10 @@ protected function getArguments()
protected function getTemplateContents()
{
$module = $this->laravel['modules']->findOrFail($this->getModuleName());

return (new Stub('/filter.stub', [
'NAMESPACE' => $this->getClassNamespace($module),
'CLASS' => $this->getClass()
'CLASS' => $this->getClass(),
]))->render();
}

Expand All @@ -65,7 +67,7 @@ protected function getDestinationFilePath()

$seederPath = $this->laravel['modules']->config('paths.generator.filter');

return $path . $seederPath . '/' . $this->getFileName() . '.php';
return $path.$seederPath.'/'.$this->getFileName().'.php';
}

/**
Expand Down
9 changes: 5 additions & 4 deletions Commands/GenerateProviderCommand.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Pingpong\Modules\Commands;
<?php

namespace Pingpong\Modules\Commands;

use Illuminate\Support\Str;
use Pingpong\Support\Stub;
Expand All @@ -8,7 +10,6 @@

class GenerateProviderCommand extends GeneratorCommand
{

use ModuleCommandTrait;

/**
Expand Down Expand Up @@ -69,7 +70,7 @@ protected function getTemplateContents()
return (new Stub('/'.$stub.'.stub', [
'NAMESPACE' => $this->getClassNamespace($module),
'CLASS' => $this->getClass(),
'LOWER_NAME' => $module->getLowerName()
'LOWER_NAME' => $module->getLowerName(),
]))->render();
}

Expand All @@ -82,7 +83,7 @@ protected function getDestinationFilePath()

$generatorPath = $this->laravel['modules']->config('paths.generator.provider');

return $path . $generatorPath . '/' . $this->getFileName() . '.php';
return $path.$generatorPath.'/'.$this->getFileName().'.php';
}

/**
Expand Down
9 changes: 5 additions & 4 deletions Commands/GenerateRouteProviderCommand.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php namespace Pingpong\Modules\Commands;
<?php

namespace Pingpong\Modules\Commands;

use Pingpong\Support\Stub;
use Pingpong\Modules\Traits\ModuleCommandTrait;
use Symfony\Component\Console\Input\InputArgument;

class GenerateRouteProviderCommand extends GeneratorCommand
{

use ModuleCommandTrait;

/**
Expand Down Expand Up @@ -45,7 +46,7 @@ protected function getTemplateContents()
return (new Stub('/route-provider.stub', [
'MODULE' => $this->getModuleName(),
'NAME' => $this->getFileName(),
'MODULE_NAMESPACE' => $this->laravel['modules']->config('namespace')
'MODULE_NAMESPACE' => $this->laravel['modules']->config('namespace'),
]))->render();
}

Expand All @@ -60,7 +61,7 @@ protected function getDestinationFilePath()

$generatorPath = $this->laravel['modules']->config('paths.generator.provider');

return $path . $generatorPath . '/' . $this->getFileName() . '.php';
return $path.$generatorPath.'/'.$this->getFileName().'.php';
}

/**
Expand Down
15 changes: 9 additions & 6 deletions Commands/GeneratorCommand.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Pingpong\Modules\Commands;
<?php

namespace Pingpong\Modules\Commands;

use Illuminate\Console\Command;
use Pingpong\Modules\Generators\FileAlreadyExistException;
Expand Down Expand Up @@ -34,7 +36,7 @@ public function fire()
{
$path = str_replace('\\', '/', $this->getDestinationFilePath());

if (! $this->laravel['files']->isDirectory($dir = dirname($path))) {
if (!$this->laravel['files']->isDirectory($dir = dirname($path))) {
$this->laravel['files']->makeDirectory($dir, 0777, true);
}

Expand Down Expand Up @@ -72,7 +74,8 @@ public function getDefaultNamespace()
/**
* Get class namespace.
*
* @param \Pingpong\Module\Module $module
* @param \Pingpong\Module\Module $module
*
* @return string
*/
public function getClassNamespace($module)
Expand All @@ -83,11 +86,11 @@ public function getClassNamespace($module)

$namespace = $this->laravel['modules']->config('namespace');

$namespace.= '\\' . $module->getStudlyName();
$namespace .= '\\'.$module->getStudlyName();

$namespace.= '\\' . $this->getDefaultNamespace();
$namespace .= '\\'.$this->getDefaultNamespace();

$namespace.= '\\' . $extra;
$namespace .= '\\'.$extra;

return rtrim($namespace, '\\');
}
Expand Down
30 changes: 13 additions & 17 deletions Commands/InstallCommand.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Pingpong\Modules\Commands;
<?php

namespace Pingpong\Modules\Commands;

use Illuminate\Console\Command;
use Pingpong\Modules\Process\Installer;
Expand All @@ -8,7 +10,6 @@

class InstallCommand extends Command
{

/**
* The console command name.
*
Expand All @@ -25,8 +26,6 @@ class InstallCommand extends Command

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
Expand Down Expand Up @@ -56,19 +55,17 @@ public function fire()

/**
* Install modules from modules.json file.
*
* @return void
*/
protected function installFromFile()
{
if (! file_exists($path = base_path('modules.json'))) {
if (!file_exists($path = base_path('modules.json'))) {
$this->error("File 'modules.json' does not exist in your project root.");

return;
}

$modules = Json::make($path);

$dependencies = $modules->get('require', []);

foreach ($dependencies as $module) {
Expand All @@ -85,11 +82,10 @@ protected function installFromFile()
/**
* Install the specified module.
*
* @param string $name
* @param string $version
* @param string $type
* @param boolean $tree
* @return void
* @param string $name
* @param string $version
* @param string $type
* @param bool $tree
*/
protected function install($name, $version = 'dev-master', $type = 'composer', $tree = false)
{
Expand All @@ -101,7 +97,7 @@ protected function install($name, $version = 'dev-master', $type = 'composer', $
);

$installer->setRepository($this->laravel['modules']);

$installer->setConsole($this);

if ($timeout = $this->option('timeout')) {
Expand All @@ -114,9 +110,9 @@ protected function install($name, $version = 'dev-master', $type = 'composer', $

$installer->run();

if (! $this->option('no-update')) {
if (!$this->option('no-update')) {
$this->call('module:update', [
'module' => $installer->getModuleName()
'module' => $installer->getModuleName(),
]);
}
}
Expand Down
5 changes: 3 additions & 2 deletions Commands/ListCommand.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php namespace Pingpong\Modules\Commands;
<?php

namespace Pingpong\Modules\Commands;

use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;

class ListCommand extends Command
{

/**
* The console command name.
*
Expand Down
6 changes: 3 additions & 3 deletions Commands/MakeCommand.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Pingpong\Modules\Commands;
<?php

namespace Pingpong\Modules\Commands;

use Illuminate\Console\Command;
use Pingpong\Modules\Generators\ModuleGenerator;
Expand All @@ -7,7 +9,6 @@

class MakeCommand extends Command
{

/**
* The console command name.
*
Expand Down Expand Up @@ -43,7 +44,6 @@ public function fire()
}
}


/**
* Get the console command arguments.
*
Expand Down
Loading

0 comments on commit f8680b8

Please sign in to comment.