PHP 8.2.30
Preview: Blood.php Size: 818 B
/home/byroehnu/easetack.com/vendor/fakerphp/faker/src/Faker/Core/Blood.php

<?php

declare(strict_types=1);

namespace Faker\Core;

use Faker\Extension;

/**
 * @experimental This class is experimental and does not fall under our BC promise
 */
final class Blood implements Extension\BloodExtension
{
    /**
     * @var string[]
     */
    private array $bloodTypes = ['A', 'AB', 'B', 'O'];

    /**
     * @var string[]
     */
    private array $bloodRhFactors = ['+', '-'];

    public function bloodType(): string
    {
        return Extension\Helper::randomElement($this->bloodTypes);
    }

    public function bloodRh(): string
    {
        return Extension\Helper::randomElement($this->bloodRhFactors);
    }

    public function bloodGroup(): string
    {
        return sprintf(
            '%s%s',
            $this->bloodType(),
            $this->bloodRh(),
        );
    }
}

Directory Contents

Dirs: 0 × Files: 9

Name Size Perms Modified Actions
1.24 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
818 B lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
5.23 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
2.08 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
6.16 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
23.15 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
1.91 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
2.01 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
2.06 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).