Skip to content

Commit cda63b7

Browse files
authored
Merge pull request #20 from qhxin/master
fixed InvalidArgumentException namespacing
2 parents cf3369f + 2731d10 commit cda63b7

File tree

9 files changed

+23
-23
lines changed

9 files changed

+23
-23
lines changed

lib/GDLuminanceSource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct($gdImage,
3434
}
3535
parent::__construct($width, $height);
3636
if ($left + $width > $dataWidth || $top + $height > $dataHeight) {
37-
throw new InvalidArgumentException("Crop rectangle does not fit within image data.");
37+
throw new \InvalidArgumentException("Crop rectangle does not fit within image data.");
3838
}
3939
$this->luminances = $gdImage;
4040
$this->dataWidth = $dataWidth;
@@ -112,7 +112,7 @@ public function GDLuminanceSource($gdImage, $width, $height)
112112
//@Override
113113
public function getRow($y, $row=null) {
114114
if ($y < 0 || $y >= $this->getHeight()) {
115-
throw new InvalidArgumentException("Requested row is outside the image: " + y);
115+
throw new \InvalidArgumentException("Requested row is outside the image: " + y);
116116
}
117117
$width = $this->getWidth();
118118
if ($row == null || count($row) < $width) {

lib/IMagickLuminanceSource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct($image,
3434
}
3535
parent::__construct($width, $height);
3636
if ($left + $width > $dataWidth || $top + $height > $dataHeight) {
37-
throw new InvalidArgumentException("Crop rectangle does not fit within image data.");
37+
throw new \InvalidArgumentException("Crop rectangle does not fit within image data.");
3838
}
3939
$this->luminances = $image;
4040
$this->dataWidth = $dataWidth;
@@ -88,7 +88,7 @@ public function _IMagickLuminanceSource($image, $width, $height)
8888
//@Override
8989
public function getRow($y, $row=null) {
9090
if ($y < 0 || $y >= $this->getHeight()) {
91-
throw new InvalidArgumentException("Requested row is outside the image: " + y);
91+
throw new \InvalidArgumentException("Requested row is outside the image: " + y);
9292
}
9393
$width = $this->getWidth();
9494
if ($row == null || count($row) < $width) {

lib/RGBLuminanceSource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct($pixels,
4848
}
4949
parent::__construct($width, $height);
5050
if ($left + $width > $dataWidth || $top + $height > $dataHeight) {
51-
throw new InvalidArgumentException("Crop rectangle does not fit within image data.");
51+
throw new \InvalidArgumentException("Crop rectangle does not fit within image data.");
5252
}
5353
$this->luminances = $pixels;
5454
$this->dataWidth = $dataWidth;
@@ -249,7 +249,7 @@ function grayScaleToBitmap ($grayScale)
249249
//@Override
250250
public function getRow($y, $row=null) {
251251
if ($y < 0 || $y >= $this->getHeight()) {
252-
throw new InvalidArgumentException("Requested row is outside the image: " + y);
252+
throw new \InvalidArgumentException("Requested row is outside the image: " + y);
253253
}
254254
$width = $this->getWidth();
255255
if ($row == null || count($row) < $width) {

lib/common/BitArray.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public function setBulk($i, $newBits) {
166166
*/
167167
public function setRange($start, $end) {
168168
if ($end < $start) {
169-
throw new InvalidArgumentException();
169+
throw new \InvalidArgumentException();
170170
}
171171
if ($end == $start) {
172172
return;
@@ -211,7 +211,7 @@ public function clear() {
211211
*/
212212
public function isRange($start, $end, $value) {
213213
if ($end < $start) {
214-
throw new InvalidArgumentException();
214+
throw new \InvalidArgumentException();
215215
}
216216
if ($end == $start) {
217217
return true; // empty range matches
@@ -259,7 +259,7 @@ public function appendBit($bit) {
259259
*/
260260
public function appendBits($value, $numBits) {
261261
if ($numBits < 0 || $numBits > 32) {
262-
throw new InvalidArgumentException("Num bits must be between 0 and 32");
262+
throw new \InvalidArgumentException("Num bits must be between 0 and 32");
263263
}
264264
$this->ensureCapacity($this->size + $numBits);
265265
for ($numBitsLeft = $numBits; $numBitsLeft > 0; $numBitsLeft--) {
@@ -277,7 +277,7 @@ public function appendBitArray($other) {
277277

278278
public function _xor($other) {
279279
if (count($this->bits) != count($other->bits)) {
280-
throw new InvalidArgumentException("Sizes don't match");
280+
throw new \InvalidArgumentException("Sizes don't match");
281281
}
282282
for ($i = 0; $i < count($this->bits); $i++) {
283283
// The last byte could be incomplete (i.e. not have 8 bits in

lib/common/BitMatrix.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function __construct($width, $height=false, $rowSize=false, $bits=false)
2525
}
2626
public static function parse($stringRepresentation, $setString, $unsetString){
2727
if (!$stringRepresentation) {
28-
throw new InvalidArgumentException();
28+
throw new \InvalidArgumentException();
2929
}
3030
$bits = array();
3131
$bitsPos = 0;
@@ -41,7 +41,7 @@ public static function parse($stringRepresentation, $setString, $unsetString){
4141
$rowLength = $bitsPos - $rowStartPos;
4242
}
4343
else if ($bitsPos - $rowStartPos != $rowLength) {
44-
throw new InvalidArgumentException("row lengths do not match");
44+
throw new \InvalidArgumentException("row lengths do not match");
4545
}
4646
$rowStartPos = $bitsPos;
4747
$nRows++;
@@ -58,7 +58,7 @@ public static function parse($stringRepresentation, $setString, $unsetString){
5858
$bits[$bitsPos] = false;
5959
$bitsPos++;
6060
} else {
61-
throw new InvalidArgumentException(
61+
throw new \InvalidArgumentException(
6262
"illegal character encountered: " . substr($stringRepresentation,$pos));
6363
}
6464
}
@@ -68,7 +68,7 @@ public static function parse($stringRepresentation, $setString, $unsetString){
6868
if($rowLength == -1) {
6969
$rowLength = $bitsPos - $rowStartPos;
7070
} else if ($bitsPos - $rowStartPos != $rowLength) {
71-
throw new InvalidArgumentException("row lengths do not match");
71+
throw new \InvalidArgumentException("row lengths do not match");
7272
}
7373
$nRows++;
7474
}
@@ -151,7 +151,7 @@ public function flip($x, $y) {
151151
public function _xor($mask) {//было xor, php не позволяет использовать xor
152152
if ($this->width != $mask->getWidth() || $this->height != $mask->getHeight()
153153
|| $this->rowSize != $mask->getRowSize()) {
154-
throw new InvalidArgumentException("input matrix dimensions do not match");
154+
throw new \InvalidArgumentException("input matrix dimensions do not match");
155155
}
156156
$rowArray = new BitArray($this->width / 32 + 1);
157157
for ($y = 0; $y < $this->height; $y++) {
@@ -183,15 +183,15 @@ public function clear() {
183183
*/
184184
public function setRegion($left, $top, $width, $height) {
185185
if ($top < 0 || $left < 0) {
186-
throw new InvalidArgumentException("Left and top must be nonnegative");
186+
throw new \InvalidArgumentException("Left and top must be nonnegative");
187187
}
188188
if ($height < 1 || $width < 1) {
189-
throw new InvalidArgumentException("Height and width must be at least 1");
189+
throw new \InvalidArgumentException("Height and width must be at least 1");
190190
}
191191
$right = $left + $width;
192192
$bottom = $top + $height;
193193
if ($bottom > $this->height || $right > $this->width) { //> this.height || right > this.width
194-
throw new InvalidArgumentException("The region must fit inside the matrix");
194+
throw new \InvalidArgumentException("The region must fit inside the matrix");
195195
}
196196
for ($y = $top; $y < $bottom; $y++) {
197197
$offset = $y * $this->rowSize;

lib/common/reedsolomon/GenericGF.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ function getOne() {
108108
*/
109109
function buildMonomial($degree, $coefficient) {
110110
if ($degree < 0) {
111-
throw new InvalidArgumentException();
111+
throw new \InvalidArgumentException();
112112
}
113113
if ($coefficient == 0) {
114114
return $this->zero;
@@ -139,7 +139,7 @@ function exp($a) {
139139
*/
140140
function log($a) {
141141
if ($a == 0) {
142-
throw new InvalidArgumentException();
142+
throw new \InvalidArgumentException();
143143
}
144144
return $this->logTable[$a];
145145
}

lib/qrcode/decoder/DataMask.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ abstract function isMasked($i, $j);
8585
static function forReference($reference)
8686
{
8787
if ($reference < 0 || $reference > 7) {
88-
throw new InvalidArgumentException();
88+
throw new \InvalidArgumentException();
8989
}
9090
return self::$DATA_MASKS[$reference];
9191
}

lib/qrcode/decoder/ErrorCorrectionLevel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function getOrdinal() {
7474
*/
7575
public static function forBits($bits) {
7676
if ($bits < 0 || $bits >= count(self::$FOR_BITS)) {
77-
throw new InvalidArgumentException();
77+
throw new \InvalidArgumentException();
7878
}
7979
$level = self::$FOR_BITS[$bits];
8080
// $lev = self::$$bit;

lib/qrcode/decoder/Version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public static function getProvisionalVersionForDimension($dimension)
118118
public static function getVersionForNumber($versionNumber)
119119
{
120120
if ($versionNumber < 1 || $versionNumber > 40) {
121-
throw new InvalidArgumentException();
121+
throw new \InvalidArgumentException();
122122
}
123123
if(!self::$VERSIONS){
124124

0 commit comments

Comments
 (0)