Skip to content

Commit 9977c51

Browse files
committed
:octocat: let QRDataModeInterface::write() return $this
1 parent a7758f7 commit 9977c51

File tree

6 files changed

+11
-6
lines changed

6 files changed

+11
-6
lines changed

src/Data/AlphaNum.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static function validateString(string $string):bool{
6969
/**
7070
* @inheritDoc
7171
*/
72-
public function write(BitBuffer $bitBuffer, int $versionNumber):void{
72+
public function write(BitBuffer $bitBuffer, int $versionNumber):QRDataModeInterface{
7373
$len = $this->getCharCount();
7474

7575
$bitBuffer
@@ -87,6 +87,7 @@ public function write(BitBuffer $bitBuffer, int $versionNumber):void{
8787
$bitBuffer->put(self::CHAR_TO_ORD[$this->data[$i]], 6);
8888
}
8989

90+
return $this;
9091
}
9192

9293
/**

src/Data/Byte.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static function validateString(string $string):bool{
4444
/**
4545
* @inheritDoc
4646
*/
47-
public function write(BitBuffer $bitBuffer, int $versionNumber):void{
47+
public function write(BitBuffer $bitBuffer, int $versionNumber):QRDataModeInterface{
4848
$len = $this->getCharCount();
4949

5050
$bitBuffer
@@ -59,6 +59,7 @@ public function write(BitBuffer $bitBuffer, int $versionNumber):void{
5959
$i++;
6060
}
6161

62+
return $this;
6263
}
6364

6465
/**

src/Data/Hanzi.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public static function validateString(string $string):bool{
120120
*
121121
* @throws \chillerlan\QRCode\Data\QRCodeDataException on an illegal character occurence
122122
*/
123-
public function write(BitBuffer $bitBuffer, int $versionNumber):void{
123+
public function write(BitBuffer $bitBuffer, int $versionNumber):QRDataModeInterface{
124124

125125
$bitBuffer
126126
->put($this::$datamode, 4)
@@ -150,6 +150,7 @@ public function write(BitBuffer $bitBuffer, int $versionNumber):void{
150150
throw new QRCodeDataException(sprintf('illegal char at %d', ($i + 1)));
151151
}
152152

153+
return $this;
153154
}
154155

155156
/**

src/Data/Kanji.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public static function validateString(string $string):bool{
118118
*
119119
* @throws \chillerlan\QRCode\Data\QRCodeDataException on an illegal character occurence
120120
*/
121-
public function write(BitBuffer $bitBuffer, int $versionNumber):void{
121+
public function write(BitBuffer $bitBuffer, int $versionNumber):QRDataModeInterface{
122122

123123
$bitBuffer
124124
->put($this::$datamode, 4)
@@ -147,6 +147,7 @@ public function write(BitBuffer $bitBuffer, int $versionNumber):void{
147147
throw new QRCodeDataException(sprintf('illegal char at %d', ($i + 1)));
148148
}
149149

150+
return $this;
150151
}
151152

152153
/**

src/Data/Number.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static function validateString(string $string):bool{
6262
/**
6363
* @inheritDoc
6464
*/
65-
public function write(BitBuffer $bitBuffer, int $versionNumber):void{
65+
public function write(BitBuffer $bitBuffer, int $versionNumber):QRDataModeInterface{
6666
$len = $this->getCharCount();
6767

6868
$bitBuffer
@@ -91,6 +91,7 @@ public function write(BitBuffer $bitBuffer, int $versionNumber):void{
9191

9292
}
9393

94+
return $this;
9495
}
9596

9697
/**

src/Data/QRDataModeInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static function validateString(string $string):bool;
4444
*
4545
* @see \chillerlan\QRCode\Data\QRData::writeBitBuffer()
4646
*/
47-
public function write(BitBuffer $bitBuffer, int $versionNumber):void;
47+
public function write(BitBuffer $bitBuffer, int $versionNumber):QRDataModeInterface;
4848

4949
/**
5050
* reads a segment from the BitBuffer and decodes in the current data mode

0 commit comments

Comments
 (0)