PHP 8.3.30
Preview: GlobalFunctionFile.php Size: 930 B
/proc/thread-self/root/home/getspomw/itechservicellc.com/vendor/hamcrest/hamcrest-php/generator/GlobalFunctionFile.php

<?php

/*
 Copyright (c) 2009 hamcrest.org
 */

class GlobalFunctionFile extends FactoryFile
{
    /**
     * @var string containing function definitions
     */
    private $functions;

    public function __construct($file)
    {
        parent::__construct($file, '    ');
        $this->functions = '';
    }

    public function addCall(FactoryCall $call)
    {
        $this->functions .= "\n" . $this->generateFactoryCall($call);
    }

    public function build()
    {
        $this->addFileHeader();
        $this->addPart('functions_imports');
        $this->addPart('functions_header');
        $this->addCode($this->functions);
        $this->addPart('functions_footer');
    }

    public function generateFactoryCall(FactoryCall $call)
    {
        $code = "if (!function_exists('{$call->getName()}')) {\n";
        $code.= parent::generateFactoryCall($call);
        $code.= "}\n";

        return $code;
    }
}

Directory Contents

Dirs: 1 × Files: 9

Name Size Perms Modified Actions
parts DIR
- drwxr-xr-x 2025-11-18 19:23:52
Edit Download
611 B lrw-r--r-- 2025-10-28 20:22:14
Edit Download
1.35 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
2.95 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
2.93 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
5.51 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
3.46 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
930 B lrw-r--r-- 2025-10-28 20:22:14
Edit Download
1.06 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
773 B lrw-r--r-- 2025-10-28 20:22:14
Edit Download

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