Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: web-vision/deepltranslate-core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: bce3b00fee90cc7d2770d895f15b71096857a6ca
Choose a base ref
..
head repository: web-vision/deepltranslate-core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8c6279031026b147a1ed88cbb0622632e71ff06f
Choose a head ref
Showing with 8 additions and 4 deletions.
  1. +4 −0 Classes/Domain/Repository/GlossaryEntryRepository.php
  2. +4 −4 Classes/Service/ImportGlossaryEntryService.php
4 changes: 4 additions & 0 deletions Classes/Domain/Repository/GlossaryEntryRepository.php
Original file line number Diff line number Diff line change
@@ -62,6 +62,10 @@ public function findEntryByUid(int $uid): array
return $result->fetchAssociative() ?: [];
}

/**
* @param array<mixed> $entry
* @return int
*/
public function add(array $entry): int
{
$this->connection->insert(self::TABLE_NAME, $entry);
8 changes: 4 additions & 4 deletions Classes/Service/ImportGlossaryEntryService.php
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
namespace WebVision\WvDeepltranslate\Service;

use TYPO3\CMS\Core\Resource\File;
use TYPO3\CMS\Core\Resource\FileReference;
use TYPO3\CMS\Core\Resource\ProcessedFile;
use TYPO3\CMS\Core\Resource\ResourceFactory;
use TYPO3\CMS\Core\Utility\CsvUtility;
use WebVision\WvDeepltranslate\Domain\Repository\GlossaryEntryRepository;
@@ -24,7 +24,7 @@ public function __construct(ResourceFactory $resourceFactory, GlossaryEntryRepos

/**
* @throws FileNotFoundException
* @return array<mixed, array>
* @return array<mixed>
*/
public function getGlossaryEntriesFromCsv(string $filePath, string $separator): array
{
@@ -38,7 +38,7 @@ public function getGlossaryEntriesFromCsv(string $filePath, string $separator):
}

/**
* @param array<mixed, array> $entries
* @param array<mixed> $entries
* @param int $pageId
* @param int $sysLanguageUid
* @return void
@@ -65,6 +65,6 @@ public function insertEntriesLocal(array $entries, int $pageId, int $sysLanguage
protected function getFile(string $csvFilePath): ?File
{
$file = $this->resourceFactory->getFileObjectFromCombinedIdentifier($csvFilePath);
return $file instanceof FileReference ? $file->getOriginalFile() : $file;
return $file instanceof ProcessedFile ? $file->getOriginalFile() : $file;
}
}