HEX
Server: LiteSpeed
System: Linux server315.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: globfdxw (6114)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //home/globfdxw/www/wp-content/plugins/give/src/FormMigration/Actions/MapSettingsToDesignHeader.php
<?php

namespace Give\FormMigration\Actions;

use Give\DonationForms\Models\DonationForm;
use Give\FormMigration\DataTransferObjects\DesignHeaderSettings;
use Give\FormMigration\DataTransferObjects\DonationSummarySettings;
use Give\Framework\Blocks\BlockCollection;

class MapSettingsToDesignHeader
{
    /**
     * @var DonationForm
     */
    protected $form;

    public function __construct(DonationForm $form)
    {
        $this->form = $form;
    }

    public static function make(DonationForm $form): self
    {
        return new self($form);
    }

    public function __invoke(DesignHeaderSettings $settings)
    {
        $this->form->settings->showHeader = $settings->isEnabled();

        $this->form->settings->showHeading = $settings->hasHeading();
        $this->form->settings->heading = $settings->getHeading();

        $this->form->settings->showDescription = $settings->hasDescription();
        $this->form->settings->description = $settings->getDescription();
    }
}