PHP 8.2.31
Preview: ArrayDefinition.php Size: 1.31 KB
//opt/cpanel/ea-wappspector/vendor/php-di/php-di/src/Definition/ArrayDefinition.php

<?php

declare(strict_types=1);

namespace DI\Definition;

/**
 * Definition of an array containing values or references.
 *
 * @since 5.0
 * @author Matthieu Napoli <matthieu@mnapoli.fr>
 */
class ArrayDefinition implements Definition
{
    /** Entry name. */
    private string $name = '';

    public function __construct(
        private array $values,
    ) {
    }

    public function getName() : string
    {
        return $this->name;
    }

    public function setName(string $name) : void
    {
        $this->name = $name;
    }

    public function getValues() : array
    {
        return $this->values;
    }

    public function replaceNestedDefinitions(callable $replacer) : void
    {
        $this->values = array_map($replacer, $this->values);
    }

    public function __toString() : string
    {
        $str = '[' . \PHP_EOL;

        foreach ($this->values as $key => $value) {
            if (is_string($key)) {
                $key = "'" . $key . "'";
            }

            $str .= '    ' . $key . ' => ';

            if ($value instanceof Definition) {
                $str .= str_replace(\PHP_EOL, \PHP_EOL . '    ', (string) $value);
            } else {
                $str .= var_export($value, true);
            }

            $str .= ',' . \PHP_EOL;
        }

        return $str . ']';
    }
}

Directory Contents

Dirs: 6 × Files: 14

Name Size Perms Modified Actions
Dumper DIR
- drwxr-xr-x 2025-08-16 11:10:48
Edit Download
Exception DIR
- drwxr-xr-x 2025-08-16 11:10:48
Edit Download
Helper DIR
- drwxr-xr-x 2025-08-16 11:10:48
Edit Download
- drwxr-xr-x 2025-08-16 11:10:48
Edit Download
Resolver DIR
- drwxr-xr-x 2025-08-16 11:10:48
Edit Download
Source DIR
- drwxr-xr-x 2025-08-16 11:10:48
Edit Download
1.31 KB lrw-r--r-- 2025-08-16 11:10:48
Edit Download
1017 B lrw-r--r-- 2025-08-16 11:10:48
Edit Download
170 B lrw-r--r-- 2025-08-16 11:10:48
Edit Download
782 B lrw-r--r-- 2025-08-16 11:10:48
Edit Download
847 B lrw-r--r-- 2025-08-16 11:10:48
Edit Download
2.50 KB lrw-r--r-- 2025-08-16 11:10:48
Edit Download
323 B lrw-r--r-- 2025-08-16 11:10:48
Edit Download
1.72 KB lrw-r--r-- 2025-08-16 11:10:48
Edit Download
1.12 KB lrw-r--r-- 2025-08-16 11:10:48
Edit Download
6.30 KB lrw-r--r-- 2025-08-16 11:10:48
Edit Download
1.29 KB lrw-r--r-- 2025-08-16 11:10:48
Edit Download
528 B lrw-r--r-- 2025-08-16 11:10:48
Edit Download
2.21 KB lrw-r--r-- 2025-08-16 11:10:48
Edit Download
1.11 KB lrw-r--r-- 2025-08-16 11:10:48
Edit Download

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