Skip to content
This repository was archived by the owner on Apr 16, 2024. It is now read-only.

Commit c0e66d5

Browse files
committed
fix indentation
1 parent 49a0671 commit c0e66d5

File tree

1 file changed

+38
-40
lines changed

1 file changed

+38
-40
lines changed

src/Generators/FeatureGenerator.php

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,71 +11,69 @@
1111

1212
namespace Lucid\Console\Generators;
1313

14-
use Exception;
1514
use Lucid\Console\Str;
1615
use Lucid\Console\Components\Feature;
1716

1817
/**
1918
* @author Abed Halawi <[email protected]>
2019
*/
21-
class FeatureGenerator extends Generator
22-
{
23-
public function generate($feature, $service, array $jobs = [])
24-
{
25-
$feature = Str::feature($feature);
26-
$service = Str::service($service);
20+
class FeatureGenerator extends Generator
21+
{
22+
public function generate($feature, $service, array $jobs = [])
23+
{
24+
$feature = Str::feature($feature);
25+
$service = Str::service($service);
2726

28-
$path = $this->findFeaturePath($service, $feature);
27+
$path = $this->findFeaturePath($service, $feature);
2928

30-
if ($this->exists($path)) {
31-
$this->error('Feature already exists!');
29+
if ($this->exists($path)) {
30+
$this->error('Feature already exists!');
3231

33-
return false;
34-
}
32+
return false;
33+
}
3534

36-
$namespace = $this->findFeatureNamespace($service);
35+
$namespace = $this->findFeatureNamespace($service);
3736

38-
$content = file_get_contents($this->getStub());
37+
$content = file_get_contents($this->getStub());
3938

39+
$useJobs = ''; // stores the `use` statements of the jobs
40+
$runJobs = ''; // stores the `$this->run` statements of the jobs
4041

41-
$useJobs = ''; // stores the `use` statements of the jobs
42-
$runJobs = ''; // stores the `$this->run` statements of the jobs
43-
44-
foreach ($jobs as $index => $job) {
42+
foreach ($jobs as $index => $job) {
4543
$useJobs .= 'use '.$job['namespace'].'\\'.$job['className'].";\n";
46-
$runJobs .= "\t\t".'$this->run('.$job['className']."::class);";
44+
$runJobs .= "\t\t".'$this->run('.$job['className'].'::class);';
4745

4846
// only add carriage returns when it's not the last job
49-
if($index != count($jobs) - 1) {
47+
if ($index != count($jobs) - 1) {
5048
$runJobs .= "\n\n";
5149
}
52-
}
50+
}
5351

54-
$content = str_replace(
55-
['{{feature}}', '{{namespace}}', '{{foundation_namespace}}', '{{use_jobs}}', '{{run_jobs}}'],
56-
[$feature, $namespace, $this->findFoundationNamespace(), $useJobs, $runJobs],
57-
$content
58-
);
52+
$content = str_replace(
53+
['{{feature}}', '{{namespace}}', '{{foundation_namespace}}', '{{use_jobs}}', '{{run_jobs}}'],
54+
[$feature, $namespace, $this->findFoundationNamespace(), $useJobs, $runJobs],
55+
$content
56+
);
5957

60-
$this->createFile($path, $content);
58+
$this->createFile($path, $content);
6159

62-
return new Feature(
60+
return new Feature(
6361
$feature,
6462
basename($path),
6563
$path,
6664
$this->relativeFromReal($path),
6765
$this->findService($service),
6866
$content
6967
);
70-
}
71-
72-
/**
73-
* Get the stub file for the generator.
74-
*
75-
* @return string
76-
*/
77-
protected function getStub()
78-
{
79-
return __DIR__.'/stubs/feature.stub';
80-
}
81-
}
68+
}
69+
70+
/**
71+
* Get the stub file for the generator.
72+
*
73+
* @return string
74+
*/
75+
protected function getStub()
76+
{
77+
return __DIR__.'/stubs/feature.stub';
78+
}
79+
}

0 commit comments

Comments
 (0)