Skip to content

Commit 6f464e7

Browse files
authored
Merge pull request #2 from cracker182/analysis-q2bBdR
Apply fixes from StyleCI
2 parents be73f06 + 2038afe commit 6f464e7

File tree

4 files changed

+26
-25
lines changed

4 files changed

+26
-25
lines changed

src/Console/Commands/ModuleMigrateResetCommand.php

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,21 @@ protected function reset()
9292

9393
$migrations = array_reverse($this->migrator->getRepository()->getRan());
9494

95-
if(count($migrations) == 0){
96-
$this->output("Nothing to rollback.");
95+
if (count($migrations) == 0) {
96+
$this->output('Nothing to rollback.');
9797
} else {
9898
$this->migrator->requireFiles($files);
9999

100-
foreach($migrations as $migration){
101-
if(!array_key_exists($migration, $files)){
100+
foreach ($migrations as $migration) {
101+
if (!array_key_exists($migration, $files)) {
102102
continue;
103103
}
104104

105-
$this->runDown($files[$migration], (object) ["migration" => $migration]);
105+
$this->runDown($files[$migration], (object) ['migration' => $migration]);
106106
}
107107
}
108108

109-
foreach($this->migrator->getNotes() as $note){
109+
foreach ($this->migrator->getNotes() as $note) {
110110
$this->output->writeln($note);
111111
}
112112
}
@@ -128,15 +128,16 @@ protected function runDown($file, $migration)
128128

129129
$this->migrator->getRepository()->delete($migration);
130130

131-
$this->info("Rolledback: ".$file);
131+
$this->info('Rolledback: '.$file);
132132
}
133133

134134
/**
135135
* Generate a list of all migration paths, given the arguments/operations supplied.
136136
*
137137
* @return array
138138
*/
139-
protected function getMigrationPaths(){
139+
protected function getMigrationPaths()
140+
{
140141
$migrationPaths = [];
141142

142143
foreach ($this->getSlugsToReset() as $slug) {
@@ -153,16 +154,17 @@ protected function getMigrationPaths(){
153154
*
154155
* @return array
155156
*/
156-
protected function getSlugsToReset(){
157-
if($this->validSlugProvided()){
158-
return [$this->argument("slug")];
157+
protected function getSlugsToReset()
158+
{
159+
if ($this->validSlugProvided()) {
160+
return [$this->argument('slug')];
159161
}
160162

161-
if($this->option("force")){
162-
return $this->module->all()->pluck("slug");
163+
if ($this->option('force')) {
164+
return $this->module->all()->pluck('slug');
163165
}
164166

165-
return $this->module->enabled()->pluck("slug");
167+
return $this->module->enabled()->pluck('slug');
166168
}
167169

168170
/**
@@ -172,16 +174,17 @@ protected function getSlugsToReset(){
172174
*
173175
* @return bool
174176
*/
175-
protected function validSlugProvided(){
176-
if(empty($this->argument("slug"))){
177+
protected function validSlugProvided()
178+
{
179+
if (empty($this->argument('slug'))) {
177180
return false;
178181
}
179182

180-
if($this->module->isEnabled($this->argument("slug"))){
183+
if ($this->module->isEnabled($this->argument('slug'))) {
181184
return true;
182185
}
183186

184-
if($this->option("force")){
187+
if ($this->option('force')) {
185188
return true;
186189
}
187190

src/Console/Generators/MakeModuleCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ public function fire()
7373
$this->container['description'] = 'This is the description for the '.$this->container['name'].' module.';
7474

7575
if ($this->option('quick')) {
76-
$this->container['basename'] = studly_case($this->container['slug']);
77-
$this->container['namespace'] = config('modules.namespace').$this->container['basename'];
76+
$this->container['basename'] = studly_case($this->container['slug']);
77+
$this->container['namespace'] = config('modules.namespace').$this->container['basename'];
78+
7879
return $this->generate();
7980
}
8081

src/Providers/BladeServiceProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public function register()
3333
$bladeCompiler->directive('endmodule', function () {
3434
return '<?php endif; ?>';
3535
});
36-
3736
});
3837
}
3938
}

src/Repositories/LocalRepository.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,11 @@ public function get($property, $default = null)
111111
}
112112

113113
/**
114-
* returns all properties from a given module
115-
*/
114+
* returns all properties from a given module.
115+
*/
116116
public function getProperties($slug)
117117
{
118118
return $this->where('slug', $slug);
119-
120119
}
121120

122121
/**
@@ -141,7 +140,6 @@ public function set($property, $value)
141140
$this->files->put($this->getManifestPath($slug), json_encode($module, JSON_PRETTY_PRINT));
142141

143142
return $this->optimize();
144-
145143
}
146144

147145
/**

0 commit comments

Comments
 (0)