diff --git a/VERSION b/VERSION index 3e3c2f1..ccbccc3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.1 +2.2.0 diff --git a/src/Stack.php b/src/Stack.php index 222058c..bcddcd1 100644 --- a/src/Stack.php +++ b/src/Stack.php @@ -35,8 +35,9 @@ * @phpstan-type TTextSplit array{ * 'pos': int, * 'ord': int, - * 'wordwidth': float, * 'spaces': int, + * 'septype': string, + * 'wordwidth': float, * 'totwidth': float, * 'totspacewidth': float, * } @@ -44,9 +45,9 @@ * @phpstan-type TTextDims array{ * 'chars': int, * 'spaces': int, + * 'words': int, * 'totwidth': float, * 'totspacewidth': float, - * 'words': int, * 'split': array, * } * @@ -368,8 +369,9 @@ public function getOrdArrDims(array $uniarr): array $split[$words] = [ 'pos' => $idx, 'ord' => $ord, - 'wordwidth' => 0, 'spaces' => $spaces, + 'septype' => $unitype, + 'wordwidth' => 0, 'totwidth' => ($totwidth + ($fact * ($idx - 1))), 'totspacewidth' => ($totspacewidth + ($fact * ($spaces - 1))), ]; @@ -389,9 +391,9 @@ public function getOrdArrDims(array $uniarr): array return [ 'chars' => $chars, 'spaces' => $spaces, + 'words' => $words, 'totwidth' => $totwidth, 'totspacewidth' => $totspacewidth, - 'words' => $words, 'split' => $split, ]; } diff --git a/test/StackTest.php b/test/StackTest.php index 422d24c..1f4d072 100644 --- a/test/StackTest.php +++ b/test/StackTest.php @@ -126,6 +126,7 @@ public function testStack(): void $this->assertEquals(11, $widths['split'][5]['pos']); $this->assertEquals(8203, $widths['split'][5]['ord']); + $this->assertEquals('BN', $widths['split'][5]['septype']); $this->bcAssertEqualsWithDelta(4.92, $widths['split'][5]['wordwidth'], 0.0001); $this->assertEquals(2, $widths['split'][5]['spaces']); $this->bcAssertEqualsWithDelta(60.9384, $widths['split'][5]['totwidth'], 0.0001);