Skip to content

Commit 93c18c2

Browse files
author
Xavier Barbosa
authored
Merge pull request #9 from madewithlove/feature/php-cs-fixer
Added php cs fixer
2 parents 97e018e + 3fc325f commit 93c18c2

File tree

10 files changed

+29
-15
lines changed

10 files changed

+29
-15
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
build
22
composer.lock
3-
vendor
3+
vendor
4+
.php_cs.cache

.php_cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
require 'vendor/autoload.php';
3+
4+
// Laravel version 5.1 needs at least support for php version 5.5.9
5+
return Madewithlove\PhpCsFixer\Config::fromFolders(['src'], '5.5.9')->mergeRules([
6+
'line_ending' => true,
7+
]);

composer.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,11 @@
2525
]
2626
}
2727
},
28-
"minimum-stability": "stable"
28+
"minimum-stability": "stable",
29+
"require-dev": {
30+
"madewithlove/php-cs-fixer-config": "^1.8"
31+
},
32+
"scripts": {
33+
"lint": "php-cs-fixer fix"
34+
}
2935
}

src/Console/Debug.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace Madewithlove\LaravelDebugConsole\Console;
44

55
use Illuminate\Console\Command;
6-
use Madewithlove\LaravelDebugConsole\Renderers\RenderersFactory;
76
use Illuminate\Contracts\Filesystem\FileNotFoundException;
7+
use Madewithlove\LaravelDebugConsole\Renderers\RenderersFactory;
88
use Madewithlove\LaravelDebugConsole\StorageRepository;
99
use React\EventLoop\Factory;
1010

@@ -30,9 +30,9 @@ class Debug extends Command
3030
private $repository;
3131

3232
/**
33-
* @var null|string
33+
* @var string|null
3434
*/
35-
private $currentRequest = null;
35+
private $currentRequest;
3636

3737
/**
3838
* @var \React\EventLoop\LoopInterface

src/Renderers/Exception.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public function render(array $data)
1313

1414
foreach (array_get($data, 'exceptions.exceptions', []) as $exception) {
1515
$this->block(array_get($exception, 'message'), array_get($exception, 'type'), 'fg=white;bg=red', ' ', true);
16-
$this->text(array_get($exception, 'file') . '#' . array_get($exception, 'line'));
16+
$this->text(array_get($exception, 'file').'#'.array_get($exception, 'line'));
1717
$this->newLine();
1818
$this->block(array_get($exception, 'surrounding_lines'), null, 'fg=yellow', ' ! ');
1919
}

src/Renderers/General.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ public function render(array $data)
2020
], [
2121
[
2222
array_get($data, '__meta.datetime'),
23-
array_get($data, '__meta.method') . ' ' . str_limit(array_get($data, '__meta.uri'), 20),
23+
array_get($data, '__meta.method').' '.str_limit(array_get($data, '__meta.uri'), 20),
2424
array_get($data, 'memory.peak_usage_str'),
2525
array_get($data, 'time.duration_str'),
26-
array_get($data, 'php.version')
26+
array_get($data, 'php.version'),
2727
],
2828
]);
2929
}

src/Renderers/Message.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ public function render(array $data)
2323
$this->warning($message);
2424
break;
2525
case 'info':
26-
default;
26+
default:
2727
$this->block($message, $label, 'fg=black;bg=blue', ' ', true);
2828
}
29-
3029
}, array_get($data, 'messages.messages', []));
3130
}
3231
}

src/Renderers/RenderersFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class RenderersFactory
99
{
1010
/**
11-
* @param \Symfony\Component\Console\Input\InputInterface $input
11+
* @param \Symfony\Component\Console\Input\InputInterface $input
1212
* @param \Symfony\Component\Console\Output\OutputInterface $output
1313
*
1414
* @return array
@@ -25,4 +25,4 @@ public static function create(InputInterface $input, OutputInterface $output)
2525
'request' => new Request($input, $output),
2626
];
2727
}
28-
}
28+
}

src/ServiceProvider.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
namespace Madewithlove\LaravelDebugConsole;
44

5+
use Barryvdh\Debugbar\ServiceProvider as DebugbarServiceProvider;
6+
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
57
use Madewithlove\LaravelDebugConsole\Console\Debug;
6-
use \Illuminate\Support\ServiceProvider as BaseServiceProvider;
78

89
class ServiceProvider extends BaseServiceProvider
910
{
@@ -34,6 +35,6 @@ public function boot()
3435
*/
3536
public function register()
3637
{
37-
$this->app->register(\Barryvdh\Debugbar\ServiceProvider::class);
38+
$this->app->register(DebugbarServiceProvider::class);
3839
}
3940
}

src/StorageRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(StorageInterface $storage)
2222
}
2323

2424
/**
25-
* Returns an array with the latest stored laravel debug bar data
25+
* Returns an array with the latest stored laravel debug bar data.
2626
*
2727
* @return array
2828
*/

0 commit comments

Comments
 (0)