| @@ 277-289 (lines=13) @@ | ||
| 274 | ||
| 275 | restore_error_handler(); |
|
| 276 | ||
| 277 | if (null !== $errorMessage) { |
|
| 278 | if (false !== $pos = strpos($errorMessage, '): ')) { |
|
| 279 | // cut "file_put_contents(%path%):" to make message more readable |
|
| 280 | $errorMessage = substr($errorMessage, $pos + 3); |
|
| 281 | } |
|
| 282 | ||
| 283 | throw new IOException(sprintf( |
|
| 284 | 'Could not write %s: %s (%s)', |
|
| 285 | $path, |
|
| 286 | $errorMessage, |
|
| 287 | $errorCode |
|
| 288 | ), $errorCode); |
|
| 289 | } |
|
| 290 | } |
|
| 291 | ||
| 292 | /** |
|
| @@ 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); |
|