:octocat: shortcut for Mode::getLengthBitsForVersion()

This commit is contained in:
smiley
2022-07-25 20:04:21 +02:00
parent 633c7c3926
commit fd3709d1bb
5 changed files with 17 additions and 8 deletions
+9
View File
@@ -10,6 +10,8 @@
namespace chillerlan\QRCode\Data;
use chillerlan\QRCode\Common\Mode;
/**
*/
abstract class QRDataModeAbstract implements QRDataModeInterface{
@@ -52,4 +54,11 @@ abstract class QRDataModeAbstract implements QRDataModeInterface{
return $this::$datamode;
}
/**
* shortcut
*/
protected static function getLengthBits(int $versionNumber):int{
return Mode::getLengthBitsForVersion(static::$datamode, $versionNumber);
}
}