PHP 8.3.31
Preview: ServicesResetter.php Size: 1.59 KB
/home/getspomw/royalsquad.us/vendor/symfony/http-kernel/DependencyInjection/ServicesResetter.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\HttpKernel\DependencyInjection;

use ProxyManager\Proxy\LazyLoadingInterface;
use Symfony\Component\VarExporter\LazyObjectInterface;
use Symfony\Contracts\Service\ResetInterface;

/**
 * Resets provided services.
 *
 * @author Alexander M. Turek <me@derrabus.de>
 * @author Nicolas Grekas <p@tchwork.com>
 *
 * @final since Symfony 7.2
 */
class ServicesResetter implements ResetInterface
{
    /**
     * @param \Traversable<string, object>   $resettableServices
     * @param array<string, string|string[]> $resetMethods
     */
    public function __construct(
        private \Traversable $resettableServices,
        private array $resetMethods,
    ) {
    }

    public function reset(): void
    {
        foreach ($this->resettableServices as $id => $service) {
            if ($service instanceof LazyObjectInterface && !$service->isLazyObjectInitialized(true)) {
                continue;
            }

            if ($service instanceof LazyLoadingInterface && !$service->isProxyInitialized()) {
                continue;
            }

            foreach ((array) $this->resetMethods[$id] as $resetMethod) {
                if ('?' === $resetMethod[0] && !method_exists($service, $resetMethod = substr($resetMethod, 1))) {
                    continue;
                }

                $service->$resetMethod();
            }
        }
    }
}

Directory Contents

Dirs: 0 × Files: 14

Name Size Perms Modified Actions
4.27 KB lrw-rw-rw- 2025-09-17 06:53:21
Edit Download
1.23 KB lrw-rw-rw- 2025-09-17 06:53:21
Edit Download
2.99 KB lrw-rw-rw- 2025-09-17 06:53:21
Edit Download
15.83 KB lrw-r--r-- 2026-04-27 10:18:53
Edit Download
1.63 KB lrw-rw-rw- 2025-09-17 06:53:21
Edit Download
2.04 KB lrw-rw-rw- 2025-09-17 06:53:21
Edit Download
1.38 KB lrw-rw-rw- 2025-09-17 06:53:21
Edit Download
1.46 KB lrw-rw-rw- 2025-09-17 06:53:21
Edit Download
1.10 KB lrw-rw-rw- 2025-09-17 06:53:21
Edit Download
11.73 KB lrw-rw-rw- 2025-09-17 06:53:21
Edit Download
1.36 KB lrw-rw-rw- 2025-09-17 06:53:21
Edit Download
2.71 KB lrw-rw-rw- 2025-09-17 06:53:21
Edit Download
2.09 KB lrw-rw-rw- 2025-09-17 06:53:21
Edit Download
1.59 KB lrw-rw-rw- 2025-09-17 06:53:21
Edit Download

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