<?php

declare(strict_types=1);

/*
 * This file is part of the Ferienpass package.
 *
 * (c) Richard Henkenjohann <richard@ferienpass.online>
 *
 * For more information visit the project website <https://ferienpass.online>
 * or the documentation under <https://docs.ferienpass.online>.
 */

/*
 * Fixture objects for the notification-sandbox tests. They live in this
 * multi-namespace file (require'd, not PSR-4 autoloaded) so a "proxy" class can
 * carry the same `Proxies\__CG__\…` name that Doctrine generates for a
 * lazy-loaded to-one association — a name that must sit OUTSIDE the allowed
 * `Ferienpass\` namespace for the regression test to be meaningful.
 */

namespace Ferienpass\CoreBundle\Tests\Twig\Fixtures {
    /**
     * Stands in for a Ferienpass domain entity: its FQCN starts with
     * `Ferienpass\`, so the sandbox policy allows getter reads on it.
     */
    class SampleEntity
    {
        public function __construct(private readonly string $name = 'Schwimmkurs')
        {
        }

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

namespace Proxies\__CG__\Ferienpass\CoreBundle\Tests\Twig\Fixtures {
    /**
     * Mimics the Doctrine lazy-loading proxy for {@see \Ferienpass\CoreBundle\Tests\Twig\Fixtures\SampleEntity}:
     * the proxy's own class name is `Proxies\__CG__\Ferienpass\…` (outside the
     * allowed namespaces) while it extends the real entity class.
     */
    class SampleEntity extends \Ferienpass\CoreBundle\Tests\Twig\Fixtures\SampleEntity
    {
    }
}

namespace Acme {
    /**
     * A foreign object the sandbox must keep rejecting — it neither lives under
     * nor extends anything in an allowed namespace.
     */
    class ForeignObject
    {
        public function getName(): string
        {
            return 'secret';
        }
    }
}
