| @@ 159-171 (lines=13) @@ | ||
| 156 | ||
| 157 | restore_error_handler(); |
|
| 158 | ||
| 159 | if (null !== $errorMessage) { |
|
| 160 | if (false !== $pos = strpos($errorMessage, '): ')) { |
|
| 161 | // cut "file_get_contents(%path%):" to make message more readable |
|
| 162 | $errorMessage = substr($errorMessage, $pos + 3); |
|
| 163 | } |
|
| 164 | ||
| 165 | throw new IOException(sprintf( |
|
| 166 | 'Could not read %s: %s (%s)', |
|
| 167 | $path, |
|
| 168 | $errorMessage, |
|
| 169 | $errorCode |
|
| 170 | ), $errorCode); |
|
| 171 | } |
|
| 172 | ||
| 173 | try { |
|
| 174 | return $this->decode($content, $schema); |
|
| @@ 292-304 (lines=13) @@ | ||
| 289 | ||
| 290 | restore_error_handler(); |
|
| 291 | ||
| 292 | if (null !== $errorMessage) { |
|
| 293 | if (false !== $pos = strpos($errorMessage, '): ')) { |
|
| 294 | // cut "file_put_contents(%path%):" to make message more readable |
|
| 295 | $errorMessage = substr($errorMessage, $pos + 3); |
|
| 296 | } |
|
| 297 | ||
| 298 | throw new IOException(sprintf( |
|
| 299 | 'Could not write %s: %s (%s)', |
|
| 300 | $path, |
|
| 301 | $errorMessage, |
|
| 302 | $errorCode |
|
| 303 | ), $errorCode); |
|
| 304 | } |
|
| 305 | } |
|
| 306 | ||
| 307 | /** |
|