smiley 10 лет назад
Родитель
Сommit
ee94d97890
4 измененных файлов с 28 добавлено и 9 удалено
  1. 3 4
      src/Data/Kanji.php
  2. 22 0
      src/Data/QRCodeDataException.php
  3. 2 4
      src/Data/QRDataBase.php
  4. 1 1
      src/Data/QRDataInterface.php

+ 3 - 4
src/Data/Kanji.php

@@ -13,7 +13,6 @@
 namespace chillerlan\QRCode\Data;
 
 use chillerlan\QRCode\BitBuffer;
-use chillerlan\QRCode\QRCodeException;
 use chillerlan\QRCode\QRConst;
 
 /**
@@ -34,7 +33,7 @@ class Kanji extends QRDataBase implements QRDataInterface{
 	/**
 	 * @param \chillerlan\QRCode\BitBuffer $buffer
 	 *
-	 * @throws \chillerlan\QRCode\QRCodeException
+	 * @throws \chillerlan\QRCode\Data\QRCodeDataException
 	 */
 	public function write(BitBuffer &$buffer){
 
@@ -49,7 +48,7 @@ class Kanji extends QRDataBase implements QRDataInterface{
 				$c -= 0xC140;
 			}
 			else{
-				throw new QRCodeException('illegal char at '.($i + 1).' ('.$c.')');
+				throw new QRCodeDataException('illegal char at '.($i + 1).' ('.$c.')');
 			}
 
 			$buffer->put((($c >> 8)&0xff) * 0xC0 + ($c&0xff), 13);
@@ -57,7 +56,7 @@ class Kanji extends QRDataBase implements QRDataInterface{
 		}
 
 		if($i < $this->dataLength){
-			throw new QRCodeException('illegal char at '.($i + 1));
+			throw new QRCodeDataException('illegal char at '.($i + 1));
 		}
 
 	}

+ 22 - 0
src/Data/QRCodeDataException.php

@@ -0,0 +1,22 @@
+<?php
+/**
+ * Class QRCodeDataException
+ *
+ * @filesource   QRCodeDataException.php
+ * @created      09.12.2015
+ * @package      chillerlan\QRCode\Data
+ * @author       Smiley <smiley@chillerlan.net>
+ * @copyright    2015 Smiley
+ * @license      MIT
+ */
+
+namespace chillerlan\QRCode\Data;
+
+use Exception;
+
+/**
+ * Placeholder
+ */
+class QRCodeDataException extends Exception{
+
+}

+ 2 - 4
src/Data/QRDataBase.php

@@ -12,8 +12,6 @@
 
 namespace chillerlan\QRCode\Data;
 
-use chillerlan\QRCode\QRCodeException;
-
 /**
  *
  */
@@ -48,7 +46,7 @@ class QRDataBase{
 	 * @param int $type
 	 *
 	 * @return int
-	 * @throws \chillerlan\QRCode\QRCodeException
+	 * @throws \chillerlan\QRCode\Data\QRCodeDataException
 	 */
 	public function getLengthInBits($type){
 
@@ -57,7 +55,7 @@ class QRDataBase{
 			case $type <= 26              : return $this->lengthBits[1]; // 10 - 26
 			case $type <= 40              : return $this->lengthBits[2]; // 27 - 40
 			default:
-				throw new QRCodeException('$type: '.$type);
+				throw new QRCodeDataException('$type: '.$type);
 		}
 
 	}

+ 1 - 1
src/Data/QRDataInterface.php

@@ -28,7 +28,7 @@ interface QRDataInterface{
 	 * @param $type
 	 *
 	 * @return int
-	 * @throws \chillerlan\QRCode\QRCodeException
+	 * @throws \chillerlan\QRCode\Data\QRCodeDataException
 	 */
 	public function getLengthInBits($type);