HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpmuhibbah_err/wp-content/plugins/give/src/Donors/Factories/DonorFactory.php
<?php

namespace Give\Donors\Factories;

use Give\Donors\ValueObjects\DonorAddress;
use Give\Framework\Models\Factories\ModelFactory;
use Give\Framework\Support\ValueObjects\Money;

class DonorFactory extends ModelFactory
{
    /**
     * @since 4.4.0 Add "company", "avatarId", "additionalEmails", and "addresses" properties
     * @since 3.7.0 Add "phone" property
     * @since 2.19.6
     */
    public function definition(): array
    {
        $firstName = $this->faker->firstName;
        $lastName = $this->faker->lastName;

        // Generate 0-3 additional emails
        $additionalEmails = [];
        $additionalEmailCount = $this->faker->numberBetween(0, 3);
        for ($i = 0; $i < $additionalEmailCount; $i++) {
            $additionalEmails[] = $this->faker->unique()->email;
        }

        // Generate 0-3 addresses
        $addresses = [];
        $addressCount = $this->faker->numberBetween(0, 3);
        for ($i = 0; $i < $addressCount; $i++) {
            $addresses[] = DonorAddress::fromArray([
                'address1' => $this->faker->streetAddress,
                'address2' => $this->faker->optional(0.3)->secondaryAddress,
                'city' => $this->faker->city,
                'state' => $this->faker->stateAbbr,
                'country' => $this->faker->countryCode,
                'zip' => $this->faker->postcode,
            ]);
        }

        $data = [
            'firstName' => $firstName,
            'lastName' => $lastName,
            'prefix' => $this->faker->randomElement(give_get_option('title_prefixes', array_values(give_get_default_title_prefixes()))),
            'name' => trim("$firstName $lastName"),
            'email' => $this->faker->email,
            'phone' => $this->faker->phoneNumber,
            'company' => $this->faker->company,
            'avatarId' => $this->faker->optional(0.2)->numberBetween(1, 9999),
            'additionalEmails' => $additionalEmails,
            'addresses' => $addresses,
            'totalAmountDonated' => new Money(0, 'USD'),
            'totalNumberOfDonations' => 0
        ];

        return $data;
    }
}