Skip to content

Commit

Permalink
remove not needed IndexStreamException
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-gribanov committed Jun 14, 2019
1 parent 6128dd9 commit 656a7a8
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 53 deletions.
2 changes: 1 addition & 1 deletion src/Stream/Exception/FileAccessException.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final public static function notReadable($filename)
*
* @return self
*/
public static function failedOverwrite($tmp_filename, $target_filename)
final public static function failedOverwrite($tmp_filename, $target_filename)
{
return new self(sprintf(
'Failed to overwrite file "%s" from temporary file "%s".',
Expand Down
24 changes: 0 additions & 24 deletions src/Stream/Exception/IndexStreamException.php

This file was deleted.

5 changes: 2 additions & 3 deletions src/Stream/RenderIndexFileStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

use GpsLab\Component\Sitemap\Render\SitemapIndexRender;
use GpsLab\Component\Sitemap\Stream\Exception\FileAccessException;
use GpsLab\Component\Sitemap\Stream\Exception\IndexStreamException;
use GpsLab\Component\Sitemap\Stream\Exception\OverflowException;
use GpsLab\Component\Sitemap\Stream\Exception\StreamStateException;
use GpsLab\Component\Sitemap\Stream\State\StreamState;
Expand Down Expand Up @@ -170,7 +169,7 @@ private function addSubStreamFileToIndex()
// rename sitemap file to sitemap part
$new_filename = sys_get_temp_dir().'/'.$indexed_filename;
if (!rename($filename, $new_filename)) {
throw IndexStreamException::failedRename($filename, $new_filename);
throw FileAccessException::failedOverwrite($filename, $new_filename);
}

fwrite($this->handle, $this->render->sitemap($indexed_filename, $last_mod));
Expand Down Expand Up @@ -212,7 +211,7 @@ private function moveParts()
$source = sys_get_temp_dir().'/'.$indexed_filename;
$target = dirname($this->filename).'/'.$indexed_filename;
if (!rename($source, $target)) {
throw IndexStreamException::failedRename($source, $target);
throw FileAccessException::failedOverwrite($source, $target);
}
}
}
Expand Down
25 changes: 0 additions & 25 deletions tests/Stream/Exception/IndexStreamExceptionTest.php

This file was deleted.

0 comments on commit 656a7a8

Please sign in to comment.