Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
tiamo committed Jun 28, 2020
1 parent 8a8b76d commit 52b1798
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Sav/Record/Info/LongStringMissingValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function write(Buffer $buffer)
foreach ($this->data as $varName => $values) {
$localBuffer->writeInt(mb_strlen($varName));
$localBuffer->writeString($varName);
$localBuffer->write(\chr(is_countable($values) ? \count($values) : 0), 1);
$localBuffer->write(\chr(\is_countable($values) ? \count($values) : 0), 1);
$localBuffer->writeInt(8);
foreach ($values as $value) {
$localBuffer->writeString($value, 8);
Expand Down
2 changes: 1 addition & 1 deletion src/Sav/Record/Info/LongStringValueLabels.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function write(Buffer $buffer)
$localBuffer->writeInt(mb_strlen($varName));
$localBuffer->writeString($varName);
$localBuffer->writeInt($width);
$localBuffer->writeInt(is_countable($data['values']) ? \count($data['values']) : 0);
$localBuffer->writeInt(\is_countable($data['values']) ? \count($data['values']) : 0);
foreach ($data['values'] as $value => $label) {
$localBuffer->writeInt($width);
$localBuffer->writeString($value, $width);
Expand Down
2 changes: 1 addition & 1 deletion src/Sav/Writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function write($data)
}

// TODO: refactory
$dataCount = is_countable($var->data) ? \count($var->data) : 0;
$dataCount = \count($var->data);

if ($dataCount > $this->header->casesCount) {
$this->header->casesCount = $dataCount;
Expand Down

0 comments on commit 52b1798

Please sign in to comment.