mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-30 12:07:32 +00:00
:octocat: GenericGFPoly::$coefficients: remove property getter in favor of asymmetric visibility
This commit is contained in:
@@ -27,7 +27,7 @@ use function array_fill, array_slice, array_splice, count;
|
||||
final class GenericGFPoly{
|
||||
|
||||
/** @var int[] */
|
||||
private array $coefficients;
|
||||
private(set) array $coefficients;
|
||||
|
||||
/**
|
||||
* @param int[] $coefficients array coefficients as ints representing elements of GF(size), arranged
|
||||
@@ -75,13 +75,6 @@ final class GenericGFPoly{
|
||||
return $this->coefficients[(count($this->coefficients) - 1 - $degree)];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int[]
|
||||
*/
|
||||
public function getCoefficients():array{
|
||||
return $this->coefficients;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int $degree of this polynomial
|
||||
*/
|
||||
|
||||
@@ -96,8 +96,7 @@ final class ReedSolomonEncoder{
|
||||
|
||||
$modCoefficients = new GenericGFPoly($dataBytes, $rsPolyDegree)
|
||||
->mod($rsPoly)
|
||||
->getCoefficients()
|
||||
;
|
||||
->coefficients;
|
||||
|
||||
$ecBytes = array_fill(0, $rsPolyDegree, 0);
|
||||
$count = (count($modCoefficients) - $rsPolyDegree);
|
||||
|
||||
Reference in New Issue
Block a user