added PHP7 scalar type hints, cleanup

This commit is contained in:
smiley
2017-02-10 22:23:29 +01:00
parent 209f7d9a6d
commit f66213f24e
15 changed files with 169 additions and 156 deletions
+4 -3
View File
@@ -37,20 +37,21 @@ abstract class QRDataAbstract implements QRDataInterface{
*
* @param string $data
*/
public function __construct($data){
public function __construct(string $data){
$this->data = $data;
$this->dataLength = strlen($data);
}
/**
* @see QRCode::createData()
*
* @param int $type
*
* @return int
* @throws \chillerlan\QRCode\Data\QRCodeDataException
* @see QRCode::createData()
* @codeCoverageIgnore
*/
public function getLengthInBits($type){
public function getLengthInBits(int $type):int {
switch(true){
case $type >= 1 && $type <= 9: