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

Commit 5f8e2b9

Browse files
authored
Merge pull request repejota#95 from repejota/feature/lint-psr2
Feature/lint psr2
2 parents dc3ba75 + 2baae18 commit 5f8e2b9

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ before_script:
1818
script:
1919
- mkdir -p build/logs
2020
- make lint-php
21+
- make lint-psr2
2122
- make test
2223
after_script:
2324
- php vendor/bin/coveralls

src/Nats/Connection.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function __construct(ConnectionOptions $options = null)
130130
$this->pubs = 0;
131131
$this->subscriptions = [];
132132
$this->options = $options;
133-
if(version_compare(phpversion(), '7.0', '>')){
133+
if (version_compare(phpversion(), '7.0', '>')) {
134134
$this->randomGenerator = new Php71RandomGenerator();
135135
} else {
136136
$randomFactory = new Factory();
@@ -212,7 +212,9 @@ private function getStream($address, $timeout)
212212
$errno = null;
213213
$errstr = null;
214214

215-
set_error_handler(function(){return true;});
215+
set_error_handler(function () {
216+
return true;
217+
});
216218
$fp = stream_socket_client($address, $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT);
217219
restore_error_handler();
218220

src/Nats/Php71RandomGenerator.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
namespace Nats;
55

6-
7-
86
class Php71RandomGenerator
97
{
108
/**
@@ -13,7 +11,8 @@ class Php71RandomGenerator
1311
* @param $len
1412
* @return string
1513
*/
16-
public function generateString($len) {
14+
public function generateString($len)
15+
{
1716
return bin2hex(random_bytes($len));
1817
}
19-
}
18+
}

0 commit comments

Comments
 (0)