private function copySource(TranslationValueInterface $source, WritableTranslationValueInterface $target): void
    {
        if (self::DO_NOT_COPY === $this->copySource) {
            return;
        }

        if (($oldValue = $target->getSource()) === ($newValue = $source->getSource())) {
            $this->logger->log(
                $this->logLevel,
                '{key}: Source is same, no need to update.',
                ['key' => $target->getKey(), 'old' => $oldValue, 'new' => $newValue]
            );
            return;
        }

        if ((self::COPY_IF_EMPTY === $this->copySource) && !$target->isSourceEmpty()) {
            $this->logger->log(
                $this->logLevel,
                '{key}: Source is not empty, no need to update.',
                ['key' => $target->getKey(), 'old' => $oldValue, 'new' => $newValue]
            );

            return;
        }

        $this->logger->log(
            LogLevel::NOTICE,
            '{key}: Updating source value.',
            ['key' => $target->getKey(), 'old' => $oldValue, 'new' => $newValue]
        );

        if ($this->dryRun) {
            return;
        }

        $target->setSource($newValue);
    }
private function copySource(TranslationValueInterface $source, WritableTranslationValueInterface $target): void
    {
        if (self::DO_NOT_COPY === $this->copySource) {
            return;
        }

        if (($oldValue = $target->getSource()) === ($newValue = $source->getSource())) {
            $this->logger->log(
                $this->logLevel,
                '{key}: Source is same, no need to update.',
                ['key' => $target->getKey(), 'old' => $oldValue, 'new' => $newValue]
            );
            return;
        }

        if ((self::COPY_IF_EMPTY === $this->copySource) && !$target->isSourceEmpty()) {
            $this->logger->log(
                $this->logLevel,
                '{key}: Source is not empty, no need to update.',
                ['key' => $target->getKey(), 'old' => $oldValue, 'new' => $newValue]
            );

            return;
        }

        $this->logger->log(
            LogLevel::NOTICE,
            '{key}: Updating source value.',
            ['key' => $target->getKey(), 'old' => $oldValue, 'new' => $newValue]
        );

        if ($this->dryRun) {
            return;
        }

        $target->setSource($newValue);
    }
private function copySource ( TranslationValueInterface $ source , WritableTranslationValueInterface $ target ) : void { if ( self :: DO_NOT_COPY === $ this -> copySource ) { return ; } if ( ( $ oldValue = $ target -> getSource ( ) ) === ( $ newValue = $ source -> getSource ( ) ) ) { $ this -> logger -> log ( $ this -> logLevel , '{key}: Source is same, no need to update.' , [ 'key' => $ target -> getKey ( ) , 'old' => $ oldValue , 'new' => $ newValue ] ) ; return ; } if ( ( self :: COPY_IF_EMPTY === $ this -> copySource ) && ! $ target -> isSourceEmpty ( ) ) { $ this -> logger -> log ( $ this -> logLevel , '{key}: Source is not empty, no need to update.' , [ 'key' => $ target -> getKey ( ) , 'old' => $ oldValue , 'new' => $ newValue ] ) ; return ; } $ this -> logger -> log ( LogLevel :: NOTICE , '{key}: Updating source value.' , [ 'key' => $ target -> getKey ( ) , 'old' => $ oldValue , 'new' => $ newValue ] ) ; if ( $ this -> dryRun ) { return ; } $ target -> setSource ( $ newValue ) ; }
Copy the source value.

@param TranslationValueInterface         $source The source value.
@param WritableTranslationValueInterface $target The target value.

@return void
Copy the source value .