1
0
mirror of https://github.com/danog/PHPStruct.git synced 2024-11-30 04:19:08 +01:00
This commit is contained in:
danogentili 2016-07-15 15:07:47 +02:00
parent c45742bcbc
commit da3d4f5a11
2 changed files with 1 additions and 1321 deletions

1317
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -188,7 +188,7 @@ class Struct
}
break;
case 'bool':
//if(!is_bool($data[$command["datakey"]])) throw new StructException("Required argument is not a bool."); // Ignore boolean type
$data[$command['datakey']] = (bool) $data[$command['datakey']];
break;
default:
break;
@ -201,9 +201,6 @@ class Struct
$tempstring = pack('a'.($command['count'] - 1), $data[$command['datakey']]);
$curresult = pack('v', ($command['count'] - 1 > 255) ? 255 : $command['count'] - 1)[0].$tempstring;
break;
case '?':
$curresult = pack($command['phpformat'], (bool) $data[$command['datakey']]);
break;
default:
$curresult = pack($command['phpformat'].$command['count'], $data[$command['datakey']]); // Pack current char
break;