Simplify substr usages
This commit is contained in:
parent
30ec11c7fa
commit
453f8f1821
|
@ -217,7 +217,7 @@ class BIFFwriter
|
||||||
// Retrieve the last chunk of data
|
// Retrieve the last chunk of data
|
||||||
$header = pack('vv', $record, strlen($data) - $i);
|
$header = pack('vv', $record, strlen($data) - $i);
|
||||||
$tmp .= $header;
|
$tmp .= $header;
|
||||||
$tmp .= substr($data, $i, strlen($data) - $i);
|
$tmp .= substr($data, $i);
|
||||||
|
|
||||||
return $tmp;
|
return $tmp;
|
||||||
}
|
}
|
||||||
|
|
|
@ -561,7 +561,7 @@ class Parser
|
||||||
private function convertString($string)
|
private function convertString($string)
|
||||||
{
|
{
|
||||||
// chop away beggining and ending quotes
|
// chop away beggining and ending quotes
|
||||||
$string = substr($string, 1, strlen($string) - 2);
|
$string = substr($string, 1, -2);
|
||||||
if (strlen($string) > 255) {
|
if (strlen($string) > 255) {
|
||||||
throw new WriterException('String is too long');
|
throw new WriterException('String is too long');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue