Skip to content

Commit

Permalink
Fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioMendolia committed Sep 30, 2023
1 parent 6b55957 commit 9bf2763
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/Service/BookFileSystemManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function getCoverFile(Book $book): ?\SplFileInfo
*/
public function getFileChecksum(\SplFileInfo $file): string
{
$checkSum=sha1_file($file->getRealPath());
$checkSum = sha1_file($file->getRealPath());

if (false === $checkSum) {
throw new \RuntimeException('Could not calculate file Checksum');
Expand Down Expand Up @@ -438,16 +438,16 @@ private function extractFromRarArchive(\SplFileInfo $bookFile, Book $book): Book
$finder = new Finder();
$finder->in('/tmp/cover')->name('*')->files();

foreach ($finder->getIterator() as $item){
$file=$item;
$file = null;
foreach ($finder->getIterator() as $item) {
$filesystem->rename(
$item->getRealPath(),
'/tmp/cover/cover.'.$ext,
true);
$file = new \SplFileInfo('/tmp/cover/cover.'.$ext);
}

if($file===null){
if ($file === null) {
return $book;
}

Expand Down Expand Up @@ -500,11 +500,13 @@ private function extractFromGeneralArchive(\SplFileInfo $bookFile, Book $book):
$finder = new Finder();
$finder->in('/tmp/cover')->name('*')->files();

$item=null;
foreach ($finder->getIterator() as $item){
$file=$item;
$file = null;

foreach ($finder->getIterator() as $item) {
$file = $item;
}
if($item===null){

if ($file === null) {
return $book;
}

Expand Down

0 comments on commit 9bf2763

Please sign in to comment.