Skip to content

Commit

Permalink
Merge pull request #119 from williamdes/phpstan
Browse files Browse the repository at this point in the history
Some phpdoc and type fixes
  • Loading branch information
DASPRiD authored Dec 7, 2022
2 parents fc62b92 + 7f2e94c commit 3c6b551
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/Common/CharacterSetEci.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ final class CharacterSetEci extends AbstractEnum
*/
private static $nameToEci;

/**
* @param int[] $values
*/
public function __construct(array $values, string ...$otherEncodingNames)
{
$this->values = $values;
Expand Down
2 changes: 1 addition & 1 deletion src/Common/FormatInformation.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class FormatInformation
/**
* Offset i holds the number of 1 bits in the binary representation of i.
*
* @var array
* @var int[]
*/
private const BITS_SET_IN_HALF_BYTE = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4];

Expand Down
3 changes: 3 additions & 0 deletions src/Common/Mode.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ final class Mode extends AbstractEnum
*/
private $bits;

/**
* @param int[] $characterCountBitsForVersions
*/
protected function __construct(array $characterCountBitsForVersions, int $bits)
{
$this->characterCountBitsForVersions = $characterCountBitsForVersions;
Expand Down
2 changes: 1 addition & 1 deletion src/Encoder/Encoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final class Encoder
/**
* Codec cache.
*
* @var array
* @var array<string,ReedSolomonCodec>
*/
private static $codecs = [];

Expand Down
4 changes: 2 additions & 2 deletions src/Renderer/Image/SvgImageBackEnd.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ private function createGradientFill(Gradient $gradient, float $x, float $y, floa
$this->xmlWriter->writeAttribute('stop-color', $this->getColorString($startColor));

if ($startColor instanceof Alpha) {
$this->xmlWriter->writeAttribute('stop-opacity', $startColor->getAlpha());
$this->xmlWriter->writeAttribute('stop-opacity', (string) $startColor->getAlpha());
}

$this->xmlWriter->endElement();
Expand All @@ -344,7 +344,7 @@ private function createGradientFill(Gradient $gradient, float $x, float $y, floa
$this->xmlWriter->writeAttribute('stop-color', $this->getColorString($endColor));

if ($endColor instanceof Alpha) {
$this->xmlWriter->writeAttribute('stop-opacity', $endColor->getAlpha());
$this->xmlWriter->writeAttribute('stop-opacity', (string) $endColor->getAlpha());
}

$this->xmlWriter->endElement();
Expand Down
2 changes: 1 addition & 1 deletion src/Renderer/Module/EdgeIterator/EdgeIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct(ByteMatrix $matrix)
}

/**
* @return Edge[]
* @return Traversable<Edge>
*/
public function getIterator() : Traversable
{
Expand Down
2 changes: 1 addition & 1 deletion src/Renderer/Path/EllipticArc.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function toCurves(float $fromX, float $fromY) : array
/**
* @return Curve[]
*/
private function createCurves(float $fromX, $fromY) : array
private function createCurves(float $fromX, float $fromY) : array
{
$xAngle = deg2rad($this->xAxisAngle);
list($centerX, $centerY, $radiusX, $radiusY, $startAngle, $deltaAngle) =
Expand Down

0 comments on commit 3c6b551

Please sign in to comment.