Passed
Branch master (372f40)
by Matthieu
02:30
created
Category
src/ResourceStream.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         if (is_null($this->stream)) {
57 57
             throw new StreamException(sprintf("Cannot read from closed (null) stream"));
58 58
         }
59
-        if ($length <= 0) {
59
+        if ($length<=0) {
60 60
             throw new \InvalidArgumentException("Cannot read zero ot negative count of bytes from a stream");
61 61
         }
62 62
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     /**
73 73
      * {@inheritDoc}
74 74
      */
75
-    public function write(string $string, $length=null) : int
75
+    public function write(string $string, $length = null) : int
76 76
     {
77 77
         if (is_null($this->stream)) {
78 78
             throw new StreamException(sprintf("Cannot write to closed (null) stream"));
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         $hasBeenClosed = false;
96 96
         if (!is_null($this->stream)) {
97 97
             $hasBeenClosed = @fclose($this->stream);
98
-            $this->stream=null;
98
+            $this->stream = null;
99 99
         }
100 100
         if (false === $hasBeenClosed) {
101 101
             throw new StreamException("Error closing stream");
Please login to merge, or discard this patch.
src/Stream.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
      * @return int the numer of writen bytes
47 47
      * @throws mracine\Streams\Exception\StreamsException when an error appends
48 48
      */
49
-    public function write(string $string, $length=-1) : int;
49
+    public function write(string $string, $length = -1) : int;
50 50
 
51 51
     /**
52 52
      * Close a stream
Please login to merge, or discard this patch.
src/StringStream.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
             // returns all
62 62
             $result = $this->buffer;
63 63
             // No more in the buffer
64
-            $this->buffer='';
64
+            $this->buffer = '';
65 65
         } else {
66 66
             // acquire $length characters from the buffer
67 67
             $result = substr($this->buffer, 0, $length);
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      *
78 78
      * {@inheritDoc}
79 79
      */
80
-    public function write(string $data, $length=null) : int
80
+    public function write(string $data, $length = null) : int
81 81
     {
82 82
         if (is_null($this->buffer)) {
83 83
             throw new StreamException(sprintf("Cannot write to closed (null) stream"));
Please login to merge, or discard this patch.