CS: PSR1/2

parent 1d2a3df4
......@@ -5,8 +5,8 @@ namespace Modules\Core\Console;
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
use Modules\User\Permissions\PermissionsRemover;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
class DeleteModuleCommand extends Command
{
......@@ -50,6 +50,7 @@ class DeleteModuleCommand extends Command
}
if ($this->confirm("Are you sure you wish to delete the [$module] module{$extra}?") === false) {
$this->info('Nothing was deleted');
return;
}
......@@ -57,11 +58,13 @@ class DeleteModuleCommand extends Command
if ($this->finder->exists($modulePath) === false) {
$this->error('This module does not exist');
return;
}
if (is_core_module($module) === true) {
$this->error('You cannot remove a core module.');
return;
}
......
......@@ -4,8 +4,8 @@ namespace Modules\Core\Console;
use Illuminate\Console\Command;
use Modules\Core\Downloader\Downloader;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Process\Process;
class DownloadModuleCommand extends Command
......@@ -39,6 +39,7 @@ class DownloadModuleCommand extends Command
$downloader->download($this->argument('name'));
} catch (\Exception $e) {
$this->output->writeln("<error>{$e->getMessage()}</error>");
return;
}
......@@ -46,7 +47,7 @@ class DownloadModuleCommand extends Command
$composer = $this->findComposer();
$commands = [
$composer.' dump-autoload',
$composer . ' dump-autoload',
];
if ($this->option('migrations') === true || $this->option('demo') === true) {
$commands[] = "php artisan module:migrate $name";
......@@ -100,6 +101,7 @@ class DownloadModuleCommand extends Command
if (str_contains($package, '/') === false) {
throw new \Exception('You need to use vendor/name structure');
}
return studly_case(substr(strrchr($package, '/'), 1));
}
......@@ -110,9 +112,10 @@ class DownloadModuleCommand extends Command
*/
protected function findComposer()
{
if (file_exists(getcwd().'/composer.phar')) {
return '"'.PHP_BINARY.'" composer.phar';
if (file_exists(getcwd() . '/composer.phar')) {
return '"' . PHP_BINARY . '" composer.phar';
}
return 'composer';
}
}
......@@ -53,6 +53,7 @@ class Downloader
if ($this->finder->isDirectory($directory) === true) {
$this->output->writeln("<error>The folder [Modules/{$this->extractPackageNameFrom($package)}] already exists.</error>");
return;
}
......@@ -99,7 +100,7 @@ class Downloader
$progress->setFormat('[%bar%] %elapsed:6s%');
$response = (new Client)->get($latestVersionUrl, [
'progress' => function($downloadTotal, $downloadedBytes, $uploadTotal, $uploadedBytes) use ($progress) {
'progress' => function ($downloadTotal, $downloadedBytes, $uploadTotal, $uploadedBytes) use ($progress) {
$progress->advance();
},
]);
......@@ -159,6 +160,7 @@ class Downloader
if (str_contains($package, '/') === false) {
throw new \Exception('You need to use vendor/name structure');
}
return studly_case(substr(strrchr($package, '/'), 1));
}
......
......@@ -2,11 +2,9 @@
namespace Modules\Page\Sidebar;
use Maatwebsite\Sidebar\Badge;
use Maatwebsite\Sidebar\Group;
use Maatwebsite\Sidebar\Item;
use Maatwebsite\Sidebar\Menu;
use Modules\Page\Repositories\PageRepository;
use Modules\User\Contracts\Authentication;
class SidebarExtender implements \Maatwebsite\Sidebar\SidebarExtender
......
......@@ -2,7 +2,6 @@
namespace Modules\Translation\Http\Controllers\Api;
use Cartalyst\Sentinel\Laravel\Facades\Sentinel;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Http\Request;
......
......@@ -28,7 +28,7 @@ class PermissionsRemoverTest extends BaseUserTestCase
$this->user->create([
'email' => 'n.widart@gmail.com',
'password' => 'demo1234',
'permissions' => ['dashboard.index' => true, 'user.users.index' => true, 'user.users.create' => true,]
'permissions' => ['dashboard.index' => true, 'user.users.index' => true, 'user.users.create' => true,],
]);
$this->app->config->set('asgard.user.permissions', [
'user.users' => [
......
......@@ -156,7 +156,6 @@ class SentinelUserRepositoryTest extends BaseUserTestCase
'password' => 'demo1234',
], ['User']);
$hasher = app('sentinel.hasher');
$this->assertTrue($hasher->check('demo1234', $userOne->password));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment