Skip to content

Commit 620269f

Browse files
committed
Updated php-cs-fixer config
1 parent 8f2569b commit 620269f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+292
-294
lines changed

.php_cs.dist

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22

33
return PhpCsFixer\Config::create()
44
->setRules([
5-
'@PSR2' => true,
5+
'@PSR12' => true,
66
'@Symfony' => true,
77
'@Symfony:risky' => true,
8-
'@PHPUnit84Migration:risky' => true
8+
'@PHP71Migration' => true,
9+
'@PHP71Migration:risky' => true,
10+
'@PHPUnit84Migration:risky' => true,
11+
// Causes too much problems for now, fix later
12+
'declare_strict_types' => false,
913
])
1014
->setFinder(
1115
PhpCsFixer\Finder::create()

src/VCR/CodeTransform/AbstractCodeTransform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
abstract class AbstractCodeTransform extends \php_user_filter
1212
{
13-
const NAME = 'vcr_abstract_filter';
13+
public const NAME = 'vcr_abstract_filter';
1414

1515
/**
1616
* Attaches the current filter to a stream.

src/VCR/CodeTransform/CurlCodeTransform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class CurlCodeTransform extends AbstractCodeTransform
88
{
9-
const NAME = 'vcr_curl';
9+
public const NAME = 'vcr_curl';
1010

1111
/**
1212
* @var array<string, string>

src/VCR/CodeTransform/SoapCodeTransform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class SoapCodeTransform extends AbstractCodeTransform
88
{
9-
const NAME = 'vcr_soap';
9+
public const NAME = 'vcr_soap';
1010

1111
/**
1212
* @var string[]

src/VCR/LibraryHooks/LibraryHook.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ interface LibraryHook
1010
/**
1111
* @var string enabled status for a hook
1212
*/
13-
const ENABLED = 'ENABLED';
13+
public const ENABLED = 'ENABLED';
1414

1515
/**
1616
* @var string disabled status for a hook
1717
*/
18-
const DISABLED = 'DISABLED';
18+
public const DISABLED = 'DISABLED';
1919

2020
/**
2121
* Enables library hook which means that all of this library

src/VCR/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public static function fromArray(array $request): self
107107
$requestObject = new self(
108108
$request['method'],
109109
$request['url'],
110-
isset($request['headers']) ? $request['headers'] : []
110+
$request['headers'] ?? []
111111
);
112112

113113
if (!empty($request['post_fields']) && \is_array($request['post_fields'])) {

src/VCR/Response.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function toArray(): array
8282
*/
8383
public static function fromArray(array $response): self
8484
{
85-
$body = isset($response['body']) ? $response['body'] : null;
85+
$body = $response['body'] ?? null;
8686

8787
$gzip = isset($response['headers']['Content-Type'])
8888
&& false !== strpos($response['headers']['Content-Type'], 'application/x-gzip');
@@ -96,10 +96,10 @@ public static function fromArray(array $response): self
9696
}
9797

9898
return new static(
99-
isset($response['status']) ? $response['status'] : 200,
100-
isset($response['headers']) ? $response['headers'] : [],
99+
$response['status'] ?? 200,
100+
$response['headers'] ?? [],
101101
$body,
102-
isset($response['curl_info']) ? $response['curl_info'] : []
102+
$response['curl_info'] ?? []
103103
);
104104
}
105105

src/VCR/Storage/Json.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,8 @@ protected function readNextRecord(): string
7878

7979
/**
8080
* Resets the storage to the beginning.
81-
*
82-
* @return void
8381
*/
84-
public function rewind()
82+
public function rewind(): void
8583
{
8684
rewind($this->handle);
8785
$this->isEOF = false;

src/VCR/Storage/Yaml.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,8 @@ public function storeRecording(array $recording): void
5151

5252
/**
5353
* Parses the next record.
54-
*
55-
* @return void
5654
*/
57-
public function next()
55+
public function next(): void
5856
{
5957
$recording = $this->yamlParser->parse($this->readNextRecord());
6058
$this->current = $recording[0] ?? null;
@@ -101,10 +99,8 @@ private function readNextRecord(): string
10199

102100
/**
103101
* Resets the storage to the beginning.
104-
*
105-
* @return void
106102
*/
107-
public function rewind()
103+
public function rewind(): void
108104
{
109105
rewind($this->handle);
110106
$this->isEOF = false;

src/VCR/Util/Assertion.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Assertion extends BaseAssertion
99
{
1010
protected static $exceptionClass = 'VCR\VCRException';
1111

12-
const INVALID_CALLABLE = 910;
12+
public const INVALID_CALLABLE = 910;
1313

1414
/**
1515
* Assert that the value is callable.

0 commit comments

Comments
 (0)