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 @@ -124,11 +124,13 @@ public function mimeType() {
124124 * @return int
125125 */
126126 public function width () {
127- if ($ this ->valid () && (($ width = imagesx ($ this ->resource )) !== false )) {
128- return $ width ;
129- } else {
130- return -1 ;
127+ if ($ this ->valid ()) {
128+ $ width = imagesx ($ this ->resource );
129+ if ($ width !== false ) {
130+ return $ width ;
131+ }
131132 }
133+ return -1 ;
132134 }
133135
134136 /**
@@ -137,11 +139,13 @@ public function width() {
137139 * @return int
138140 */
139141 public function height () {
140- if ($ this ->valid () && (($ height = imagesy ($ this ->resource )) !== false )) {
141- return $ height ;
142- } else {
143- return -1 ;
142+ if ($ this ->valid ()) {
143+ $ height = imagesy ($ this ->resource );
144+ if ($ height !== false ) {
145+ return $ height ;
146+ }
144147 }
148+ return -1 ;
145149 }
146150
147151 /**
You can’t perform that action at this time.
0 commit comments