@@ -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 ;
0 commit comments