File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -125,11 +125,13 @@ public function mimeType() {
125125 * @return int
126126 */
127127 public function width () {
128- if ($ this ->valid () && (($ width = imagesx ($ this ->resource )) !== false )) {
129- return $ width ;
130- } else {
131- return -1 ;
128+ if ($ this ->valid ()) {
129+ $ width = imagesx ($ this ->resource );
130+ if ($ width !== false ) {
131+ return $ width ;
132+ }
132133 }
134+ return -1 ;
133135 }
134136
135137 /**
@@ -138,11 +140,13 @@ public function width() {
138140 * @return int
139141 */
140142 public function height () {
141- if ($ this ->valid () && (($ height = imagesy ($ this ->resource )) !== false )) {
142- return $ height ;
143- } else {
144- return -1 ;
143+ if ($ this ->valid ()) {
144+ $ height = imagesy ($ this ->resource );
145+ if ($ height !== false ) {
146+ return $ height ;
147+ }
145148 }
149+ return -1 ;
146150 }
147151
148152 /**
You can’t perform that action at this time.
0 commit comments