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

Commit 8218251

Browse files
authored
Merge pull request #45 from lextira/laravel-7.x
Laravel 7.x update
2 parents c310e00 + 586c1cc commit 8218251

12 files changed

+69
-28
lines changed

composer.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,17 @@
1717
"bin": ["lucid"],
1818
"minimum-stability": "stable",
1919
"require": {
20-
"symfony/console": "^4.1",
21-
"symfony/process": "^4.1",
22-
"symfony/finder": "^4.1",
23-
"symfony/filesystem": "^4.1",
24-
"phploc/phploc": "~4.0"
20+
"symfony/console": "^5.0",
21+
"symfony/process": "^5.0",
22+
"symfony/finder": "^5.0",
23+
"symfony/filesystem": "^5.0",
24+
"phploc/phploc": "^6.0"
25+
},
26+
"extra": {
27+
"laravel": {
28+
"providers": [
29+
"Lucid\\Console\\LucidServiceProvider"
30+
]
31+
}
2532
}
2633
}

src/Commands/ControllerMakeCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Lucid\Console\Finder;
1515
use Lucid\Console\Command;
1616
use Lucid\Console\Filesystem;
17+
use Lucid\Console\Str;
1718
use Symfony\Component\Console\Input\InputOption;
1819
use Lucid\Console\Generators\ControllerGenerator;
1920
use Symfony\Component\Console\Input\InputArgument;
@@ -110,7 +111,7 @@ protected function getOptions()
110111
*/
111112
protected function parseName($name)
112113
{
113-
return studly_case(preg_replace('/Controller(\.php)?$/', '', $name).'Controller');
114+
return Str::studly(preg_replace('/Controller(\.php)?$/', '', $name).'Controller');
114115
}
115116

116117
/**

src/Commands/FeatureMakeCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class FeatureMakeCommand extends SymfonyCommand
5757
public function handle()
5858
{
5959
try {
60-
$service = studly_case($this->argument('service'));
60+
$service = Str::studly($this->argument('service'));
6161
$title = $this->parseName($this->argument('feature'));
6262

6363
$generator = new FeatureGenerator();

src/Commands/JobDeleteCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class JobDeleteCommand extends SymfonyCommand
5656
public function handle()
5757
{
5858
try {
59-
$domain = studly_case($this->argument('domain'));
59+
$domain = Str::studly($this->argument('domain'));
6060
$title = $this->parseName($this->argument('job'));
6161

6262
if (!$this->exists($job = $this->findJobPath($domain, $title))) {

src/Commands/JobMakeCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function handle()
5959
{
6060
$generator = new JobGenerator();
6161

62-
$domain = studly_case($this->argument('domain'));
62+
$domain = Str::studly($this->argument('domain'));
6363
$title = $this->parseName($this->argument('job'));
6464
$isQueueable = $this->option('queue');
6565
try {

src/Commands/OperationMakeCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function handle()
5959
{
6060
$generator = new OperationGenerator();
6161

62-
$service = studly_case($this->argument('service'));
62+
$service = Str::studly($this->argument('service'));
6363
$title = $this->parseName($this->argument('operation'));
6464
$isQueueable = $this->option('queue');
6565
try {

src/Components/Service.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Lucid\Console\Components;
1313

14+
use Lucid\Console\Str;
15+
1416
/**
1517
* @author Abed Halawi <[email protected]>
1618
*/
@@ -20,7 +22,7 @@ public function __construct($name, $realPath, $relativePath)
2022
{
2123
$this->setAttributes([
2224
'name' => $name,
23-
'slug' => snake_case($name),
25+
'slug' => Str::snake($name),
2426
'realPath' => $realPath,
2527
'relativePath' => $relativePath,
2628
]);

src/Generators/JobGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private function generateTestFile($job, $domain)
7676

7777
$content = str_replace(
7878
['{{namespace}}', '{{testclass}}', '{{job}}', '{{job_namespace}}'],
79-
[$namespace, $testClass, snake_case($job), $jobNamespace],
79+
[$namespace, $testClass, Str::snake($job), $jobNamespace],
8080
$content
8181
);
8282

src/Generators/ServiceGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class ServiceGenerator extends Generator
4949
public function generate($name)
5050
{
5151
$name = Str::service($name);
52-
$slug = snake_case($name);
52+
$slug = Str::snake($name);
5353
$path = $this->findServicePath($name);
5454

5555
if ($this->exists($path)) {

src/Http/Controller.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace Lucid\Console\Http;
4+
5+
use Lucid\Console\Finder;
6+
7+
class Controller
8+
{
9+
use Finder;
10+
}

0 commit comments

Comments
 (0)