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