@@ -38,25 +38,21 @@ |
||
| 38 | 38 | if( ( $content = stream_get_contents( $file ) ) === false ) { |
| 39 | 39 | throw new \Aimeos\MW\Media\Exception( sprintf( 'Unable to read from stream' ) ); |
| 40 | 40 | } |
| 41 | - } |
|
| 42 | - elseif( $file instanceof \Psr\Http\Message\StreamInterface ) |
|
| 41 | + } elseif( $file instanceof \Psr\Http\Message\StreamInterface ) |
|
| 43 | 42 | { |
| 44 | 43 | $content = $file->getContents(); |
| 45 | - } |
|
| 46 | - elseif( is_string( $file ) ) |
|
| 44 | + } elseif( is_string( $file ) ) |
|
| 47 | 45 | { |
| 48 | 46 | if( strpos( $file, "\0" ) === false && is_file( $file ) ) |
| 49 | 47 | { |
| 50 | 48 | if( ( $content = file_get_contents( $file ) ) === false ) { |
| 51 | 49 | throw new \Aimeos\MW\Media\Exception( sprintf( 'Unable to read from file "%1$s"', $file ) ); |
| 52 | 50 | } |
| 53 | - } |
|
| 54 | - else |
|
| 51 | + } else |
|
| 55 | 52 | { |
| 56 | 53 | $content = $file; |
| 57 | 54 | } |
| 58 | - } |
|
| 59 | - else |
|
| 55 | + } else |
|
| 60 | 56 | { |
| 61 | 57 | throw new \Aimeos\MW\Media\Exception( 'Unsupported file parameter type' ); |
| 62 | 58 | } |