Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 62... Línea 62...
62
    public function addDefinition(Definition $definition) : void
62
    public function addDefinition(Definition $definition) : void
63
    {
63
    {
64
        throw new \LogicException('You cannot set a definition at runtime on a container that has caching enabled. Doing so would risk caching the definition for the next execution, where it might be different. You can either put your definitions in a file, remove the cache or ->set() a raw value directly (PHP object, string, int, ...) instead of a PHP-DI definition.');
64
        throw new \LogicException('You cannot set a definition at runtime on a container that has caching enabled. Doing so would risk caching the definition for the next execution, where it might be different. You can either put your definitions in a file, remove the cache or ->set() a raw value directly (PHP object, string, int, ...) instead of a PHP-DI definition.');
65
    }
65
    }
Línea 66... Línea 66...
66
 
66
 
67
    private function shouldBeCached(Definition $definition = null) : bool
67
    private function shouldBeCached(?Definition $definition = null) : bool
68
    {
68
    {
69
        return
69
        return
70
            // Cache missing definitions
70
            // Cache missing definitions
71
            ($definition === null)
71
            ($definition === null)