PHP 8.3.31
Preview: ProcessUtils.php Size: 1.71 KB
/home/getspomw/royalsquad.us/vendor/symfony/process/ProcessUtils.php

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Process;

use Symfony\Component\Process\Exception\InvalidArgumentException;

/**
 * ProcessUtils is a bunch of utility methods.
 *
 * This class contains static methods only and is not meant to be instantiated.
 *
 * @author Martin Hasoň <martin.hason@gmail.com>
 */
class ProcessUtils
{
    /**
     * This class should not be instantiated.
     */
    private function __construct()
    {
    }

    /**
     * Validates and normalizes a Process input.
     *
     * @param string $caller The name of method call that validates the input
     * @param mixed  $input  The input to validate
     *
     * @throws InvalidArgumentException In case the input is not valid
     */
    public static function validateInput(string $caller, mixed $input): mixed
    {
        if (null !== $input) {
            if (\is_resource($input)) {
                return $input;
            }
            if (\is_scalar($input)) {
                return (string) $input;
            }
            if ($input instanceof Process) {
                return $input->getIterator($input::ITER_SKIP_ERR);
            }
            if ($input instanceof \Iterator) {
                return $input;
            }
            if ($input instanceof \Traversable) {
                return new \IteratorIterator($input);
            }

            throw new InvalidArgumentException(\sprintf('"%s" only accepts strings, Traversable objects or stream resources.', $caller));
        }

        return $input;
    }
}

Directory Contents

Dirs: 3 × Files: 12

Name Size Perms Modified Actions
Exception DIR
- drwxrwxrwx 2026-04-19 14:56:11
Edit Download
Messenger DIR
- drwxrwxrwx 2025-09-17 06:53:17
Edit Download
Pipes DIR
- drwxrwxrwx 2026-04-21 14:11:00
Edit Download
4.22 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
671 B lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
3.54 KB lrw-r--r-- 2026-04-26 09:59:02
Edit Download
3.48 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
2.33 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
1.04 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
2.37 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
2.36 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
5.92 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
54.23 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
1.71 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
472 B lrw-rw-rw- 2025-09-17 06:53:17
Edit Download

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