This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/DependencyInjection/ContainerInterface.php

56 lines
1.4 KiB
PHP
Raw Normal View History

2010-01-04 14:26:20 +00:00
<?php
namespace Symfony\Component\DependencyInjection;
2010-01-04 14:26:20 +00:00
/*
* This file is part of the Symfony framework.
2010-01-04 14:26:20 +00:00
*
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
/**
* ContainerInterface is the interface implemented by service container classes.
*
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
2010-01-04 14:26:20 +00:00
*/
interface ContainerInterface
{
2010-06-27 17:28:29 +01:00
const EXCEPTION_ON_INVALID_REFERENCE = 1;
const NULL_ON_INVALID_REFERENCE = 2;
const IGNORE_ON_INVALID_REFERENCE = 3;
/**
* Sets a service.
*
* @param string $id The service identifier
* @param object $service The service instance
*/
function set($id, $service);
2010-06-27 17:28:29 +01:00
/**
* Gets a service.
*
* @param string $id The service identifier
* @param int $invalidBehavior The behavior when the service does not exist
*
* @return object The associated service
*
* @throws \InvalidArgumentException if the service is not defined
*
* @see Reference
*/
function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE);
2010-06-27 17:28:29 +01:00
/**
* Returns true if the given service is defined.
*
* @param string $id The service identifier
*
* @return Boolean true if the service is defined, false otherwise
*/
function has($id);
2010-01-04 14:26:20 +00:00
}