Skip to content

Commit 6e9c33d

Browse files
authored
Migrate PHPCS configuration to file (barryvdh#1633)
* Migrate phpcs cli configuration to phpcs.xml * Fix various codestyle errors
1 parent 6ffc30e commit 6e9c33d

File tree

4 files changed

+26
-8
lines changed

4 files changed

+26
-8
lines changed

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
}
5353
},
5454
"scripts": {
55-
"check-style": "phpcs -p --standard=PSR12 config/ src/ tests/ --ignore=src/Resources/* ",
56-
"fix-style": "phpcbf -p --standard=PSR12 config/ src/ tests/ --ignore=src/Resources*",
55+
"check-style": "phpcs",
56+
"fix-style": "phpcbf",
5757
"test": "phpunit"
5858
}
5959
}

phpcs.xml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0"?>
2+
<ruleset
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd"
5+
>
6+
<file>config</file>
7+
<file>src</file>
8+
<file>tests</file>
9+
10+
<exclude-pattern>src/Resources/*</exclude-pattern>
11+
<exclude-pattern>*.blade.php</exclude-pattern>
12+
13+
<arg value="p"/>
14+
15+
<rule ref="PSR12" />
16+
</ruleset>

src/LaravelDebugbar.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -853,9 +853,11 @@ protected function isDebugbarRequest()
853853
protected function isJsonRequest(Request $request)
854854
{
855855
// If XmlHttpRequest, Live or HTMX, return true
856-
if ($request->isXmlHttpRequest() ||
856+
if (
857+
$request->isXmlHttpRequest() ||
857858
$request->headers->has('X-Livewire') ||
858-
($request->headers->has('Hx-Request') && $request->headers->has('Hx-Target'))) {
859+
($request->headers->has('Hx-Request') && $request->headers->has('Hx-Target'))
860+
) {
859861
return true;
860862
}
861863

src/Storage/SocketStorage.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct($hostname, $port)
2323
/**
2424
* @inheritDoc
2525
*/
26-
function save($id, $data)
26+
public function save($id, $data)
2727
{
2828
$socketIsFresh = !$this->socket;
2929

@@ -76,23 +76,23 @@ protected function createSocket()
7676
/**
7777
* @inheritDoc
7878
*/
79-
function get($id)
79+
public function get($id)
8080
{
8181
//
8282
}
8383

8484
/**
8585
* @inheritDoc
8686
*/
87-
function find(array $filters = [], $max = 20, $offset = 0)
87+
public function find(array $filters = [], $max = 20, $offset = 0)
8888
{
8989
//
9090
}
9191

9292
/**
9393
* @inheritDoc
9494
*/
95-
function clear()
95+
public function clear()
9696
{
9797
//
9898
}

0 commit comments

Comments
 (0)