Development

Changeset 31539

You must first sign up to be able to contribute.

Changeset 31539

Show
Ignore:
Timestamp:
11/26/10 19:30:55 (2 years ago)
Author:
fabien
Message:

Merge branch 'master' of git://github.com/symfony/symfony

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php

    r31229 r31539  
    5454 
    5555        $routes = array(); 
    56         foreach ($router->getRouteCollection()->getRoutes() as $name => $route) { 
     56        foreach ($router->getRouteCollection()->all() as $name => $route) { 
    5757            $routes[$name] = $route->compile(); 
    5858        } 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/Controller/ExceptionController.php

    r31463 r31539  
    3737 
    3838        $currentContent = ''; 
    39         while (false !== $content = @ob_get_clean()) { 
    40             $currentContent .= $content
     39        while (ob_get_level()) { 
     40            $currentContent .= ob_get_clean()
    4141        } 
    4242 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/Controller/InternalController.php

    r31229 r31539  
    3535        $attributes = $request->attributes; 
    3636 
    37         $attributes->delete('path'); 
    38         $attributes->delete('controller'); 
     37        $attributes->remove('path'); 
     38        $attributes->remove('controller'); 
    3939        if ('none' !== $path) 
    4040        { 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

    r31486 r31539  
    123123            'Symfony\\Component\\HttpFoundation\\Response', 
    124124 
     125            'Symfony\\Component\\HttpKernel\\BaseHttpKernel', 
    125126            'Symfony\\Component\\HttpKernel\\HttpKernel', 
    126127            'Symfony\\Component\\HttpKernel\\ResponseListener', 
    127128            'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver', 
     129            'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface', 
    128130 
    129131            'Symfony\\Bundle\\FrameworkBundle\\RequestListener', 
     
    132134 
    133135            'Symfony\\Component\\EventDispatcher\\Event', 
    134  
    135             'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerInterface', 
    136             'Symfony\\Bundle\\FrameworkBundle\\Controller\\BaseController', 
     136            'Symfony\\Component\\EventDispatcher\\EventDispatcher', 
     137            'Symfony\\Bundle\\FrameworkBundle\\EventDispatcher', 
     138 
    137139            'Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller', 
    138140        )); 
     
    147149    protected function registerTemplatingConfiguration($config, ContainerBuilder $container) 
    148150    { 
    149         $config = $config['templating']
     151        $config = isset($config['templating']) ? $config['templating'] : array()
    150152 
    151153        if (!$container->hasDefinition('templating')) { 
     
    331333        } 
    332334        $container->setParameter('session.storage.'.strtolower($config['storage_id']).'.options', $options); 
     335 
     336        $this->addCompiledClasses($container, array( 
     337            'Symfony\\Component\\HttpFoundation\\Session', 
     338            'Symfony\\Component\\HttpFoundation\\SessionStorage\\SessionStorageInterface', 
     339        )); 
    333340    } 
    334341 
     
    349356            'Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface', 
    350357            'Symfony\\Component\\Routing\\Generator\\UrlGenerator', 
    351             'Symfony\\Component\\Routing\\Loader\\Loader', 
    352             'Symfony\\Component\\Routing\\Loader\\DelegatingLoader', 
    353             'Symfony\\Component\\Routing\\Loader\\LoaderResolver', 
    354             'Symfony\\Bundle\\FrameworkBundle\\Routing\\LoaderResolver', 
    355             'Symfony\\Bundle\\FrameworkBundle\\Routing\\DelegatingLoader', 
     358            'Symfony\\Component\\Routing\\Loader\\LoaderInterface', 
     359            'Symfony\\Bundle\\FrameworkBundle\\Routing\\LazyLoader', 
    356360        )); 
    357361    } 
     
    480484    protected function addCompiledClasses($container, array $classes) 
    481485    { 
    482         $container->setParameter('kernel.compiled_classes', array_merge($container->getParameter('kernel.compiled_classes'), $classes)); 
     486        $current = $container->hasParameter('kernel.compiled_classes') ? $container->getParameter('kernel.compiled_classes') : array(); 
     487        $container->setParameter('kernel.compiled_classes', array_merge($current, $classes)); 
    483488    } 
    484489 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

    r31403 r31539  
    44 
    55use Symfony\Component\HttpKernel\Bundle\Bundle; 
    6 use Symfony\Component\Form\Form
     6use Symfony\Component\Form\FormConfiguration
    77 
    88/* 
     
    3030            $this->container->get('error_handler'); 
    3131        } 
    32  
    3332        if ($this->container->hasParameter('csrf_secret')) { 
    34             Form::setDefaultCsrfSecret($this->container->getParameter('csrf_secret')); 
    35             Form::enableDefaultCsrfProtection(); 
     33            FormConfiguration::setDefaultCsrfSecret($this->container->getParameter('csrf_secret')); 
     34            FormConfiguration::enableDefaultCsrfProtection(); 
    3635        } 
    3736    } 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/RequestListener.php

    r31403 r31539  
    5050    public function handle(Event $event) 
    5151    { 
    52         $request = $event->getParameter('request'); 
    53         $master = HttpKernelInterface::MASTER_REQUEST === $event->getParameter('request_type'); 
     52        $request = $event->get('request'); 
     53        $master = HttpKernelInterface::MASTER_REQUEST === $event->get('request_type'); 
    5454 
    5555        $this->initializeSession($request, $master); 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml

    r31030 r31539  
    4040        </service> 
    4141 
    42         <service id="routing.loader" class="%routing.loader.class%"> 
     42        <service id="routing.loader.real" class="%routing.loader.class%"> 
    4343            <argument type="service" id="controller_name_converter" /> 
    4444            <argument type="service" id="logger" on-invalid="null" /> 
    4545            <argument type="service" id="routing.resolver" /> 
     46        </service> 
     47 
     48        <service id="routing.loader" class="Symfony\Bundle\FrameworkBundle\Routing\LazyLoader"> 
     49            <argument type="service" id="service_container" /> 
     50            <argument>routing.loader.real</argument> 
    4651        </service> 
    4752 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/errors.php

    r31463 r31539  
    44            <li><?php echo $view['translator']->trans( 
    55                $error->getMessageTemplate(), 
    6                 $error->getMessageParameters()->getRawValue()
     6                $error->getMessageParameters()
    77                'validators' 
    88            ) ?></li> 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/Routing/DelegatingLoader.php

    r31229 r31539  
    5656        $collection = parent::load($resource); 
    5757 
    58         foreach ($collection->getRoutes() as $name => $route) { 
     58        foreach ($collection->all() as $name => $route) { 
    5959            if ($controller = $route->getDefault('_controller')) { 
    6060                try { 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/SecurityHelper.php

    r31403 r31539  
    3636    public function vote($role, $object = null) 
    3737    { 
     38        if (null === $this->context) { 
     39            return false; 
     40        } 
     41 
    3842        return $this->context->vote($role, $object); 
    3943    } 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php

    r31147 r31539  
    118118            "<?php use Symfony\Component\Translation\MessageCatalogue; return new MessageCatalogue('%s', %s);", 
    119119            $locale, 
    120             var_export($this->catalogues[$locale]->getMessages(), true) 
     120            var_export($this->catalogues[$locale]->all(), true) 
    121121        )); 
    122122 
  • branches/2.0/src/Symfony/Bundle/TwigBundle/Extension/SecurityExtension.php

    r31229 r31539  
    2828    } 
    2929 
    30     public function getContext(
     30    public function vote($role, $object = null
    3131    { 
    32         return $this->context; 
     32        if (null === $this->context) { 
     33            return false; 
     34        } 
     35 
     36        return $this->context->vote($role, $object); 
    3337    } 
    3438 
  • branches/2.0/src/Symfony/Bundle/TwigBundle/Node/IfRoleNode.php

    r31229 r31539  
    3131        $compiler 
    3232            ->addDebugInfo($this) 
    33             ->write('if ($this->env->getExtension(\'security\')->getContext()->vote(') 
     33            ->write('if ($this->env->getExtension(\'security\')->vote(') 
    3434            ->subcompile($this->getNode('role')) 
    3535        ; 
  • branches/2.0/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.twig

    r31482 r31539  
    33{% block toolbar %} 
    44<img style="margin: 0 5px 0 10px; vertical-align: middle; height: 24px" width="24" height="24" alt="Request" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABJ5JREFUeNrEV1tIo0cUTuJqFH9iTBSjyUq8BVtLV2tLdV/6IiIFwe1LxQuu4mVBiwYfrCiI4KUv4oNdVKS64KX0qQUfKoKwT7WlTatS2sVdbXBXjVhtDPEetd9JZ2TWXExsiwOH/8y5zZmZM+ecX35xcSG7zSEXHZDL5dfJ9wMyGb4AMN9k0dfW9OOARDA1NWXjhI2NjZcJCQkGhr8CfpfzSkpKdPg4Ie8UjYDu1wGFDycltVr92GAwTMJAKinQ9/T0NIxwAsJFHsmSDnCJywRyvXd8Ld7W1vYRvuF9fX1flJaWLptMpkxJklTn5+f/CAEH7UvwFtLT003Nzc337Xb7UXd3twy0+vHxceeNYiAvL8+Un5//Y1xcnIpoR0dHLjKs0+kkbwZsNpuTHMVwb2Zra8sxOzv7Xnl5+TLNKyoqgouBsbExI2iLwFU3DDAHdO8BtdK8srIyuBiAghXH/MHh4eHJ2dmZzAssMPDgkQ7pArdy2nXDaxBWV1c7d3Z2yJhMgG8ASYAsBkmMdilDOqQr0oINQnrnMgTVGzExMRLfwfHx8YxSqXxwRZaO+AF434JXQATSge7ntbW1v9N8cHDQHFQQtrS0/EXfqKiocAJBLonfqZdhBPzBJ3t7e0cEhCcmJkY3NDT4jYHXTkCv16s5zne/u7u7o9ForH42YWUyWvY8wwlEGwHHgLfAOjk5UTY2Nup8BKSMeCTjix9UDLhcrqfMkbSQkBA94dHR0RKOsg28T7wZIB7JgM83sQ7d5/+qGPX29lLB+YXTV1dX/xwZGRkC+hg8d21obW2l3F9fU1PzKDk5OUawmcUKlYzJ3agYpZrNZotWq1WJTkxPT7/Y3t7+leaxsbFvFRYWpoqL4xk6+vv7s7u6ul5wWnt7e9AO6IxG41fI5/fDwsI8agUWced4OOeRmhELrsnJye+sVuvHnZ2d7pPq6OgI/BWw3K2Jj4/PUSgUd/i9igPPU2Lx4hnR0CkuLs7Z3NzUgG8LJAY8HMBT3ICHzxBMbwu5fVVoRK6OBcgk89qB7zOyQS+gp6dHbF4CS8VQslM+xw6WAA6W27MInE6ngz8vhrvpTN5BOhaL5UPYcJFMWlraGIHY4ATckqG+q1mWu/QeCeclEo6B4a+A3xVsZS4uLm7Pz8/30GR/f/832PiMcPQUn0ZGRr7J6PVY0xlwT9jU1HSJowv6PjQ09H2G/wA8R5RdWlrSI4AXsXslHHSmpKTQU5WtrKzY4KyE/HCMAL03Nze37q8jkl3NjkKQPcJczXD71UyXkZGxf3BwcKxSqbSAy2IGp9yOgOcgmWvLsZ/0TH3AUwYePcHAwMDXaFYVAu0JA/eceCQTVFteV1cXVEPEEbRmFrR17w4PD8uKiop+Ap7NeUNDQ/KAryCQpsLbwHHrsXgLx33ZufYEqqqqAl50dHRUKigosOB/wUTztbU1GytYOvYvsTwzM5MtvoL/9ARyc3Oj0AtouQ7+FXSiDeKRDP3A/C8OIOnsY3frVJJxmj+D9JCxnoD+TkREhFsmqCsoKysL9vp5V2XnQTkxMSGHHTXD7T6r4a3/Hd/G+FuAAQDV6k9Ni4q8owAAAABJRU5ErkJggg==" /> 
    5 {% if collector.route %}{{ collector.route }}{% else %}<span style="color: #a33">NONE</span>{% endif %}<span style="margin: 0; padding: 0; color: #aaa">|</span>{{ collector.format }}<span style="margin: 0; padding: 0; color: #aaa">|</span><span style="color: {{ 200 == datastatuscode ? '#3a3' : '#a33' }}">{{ collector.statuscode }}</span><span style="margin: 0; padding: 0; color: #aaa">|</span>{{ collector.contenttype }} 
     5{% if collector.route %}{{ collector.route }}{% else %}<span style="color: #a33">NONE</span>{% endif %}<span style="margin: 0; padding: 0; color: #aaa">|</span>{{ collector.format }}<span style="margin: 0; padding: 0; color: #aaa">|</span><span style="color: {{ 200 == collector.statuscode ? '#3a3' : '#a33' }}">{{ collector.statuscode }}</span><span style="margin: 0; padding: 0; color: #aaa">|</span>{{ collector.contenttype }} 
    66{% endblock %} 
    77 
  • branches/2.0/src/Symfony/Bundle/WebProfilerBundle/WebDebugToolbarListener.php

    r31371 r31539  
    4848    public function handle(Event $event, Response $response) 
    4949    { 
    50         if (HttpKernelInterface::MASTER_REQUEST !== $event->getParameter('request_type')) { 
     50        if (HttpKernelInterface::MASTER_REQUEST !== $event->get('request_type')) { 
    5151            return $response; 
    5252        } 
     
    5858            ); 
    5959            $response->setStatusCode(200); 
    60             $response->headers->delete('Location'); 
     60            $response->headers->remove('Location'); 
    6161        } 
    6262 
    63         $request = $event->getParameter('request'); 
     63        $request = $event->get('request'); 
    6464        if (!$response->headers->has('X-Debug-Token') 
    6565            || '3' === substr($response->getStatusCode(), 0, 1) 
  • branches/2.0/src/Symfony/Component/Console/Application.php

    r31229 r31539  
    3838 * 
    3939 *     $app = new Application('myapp', '1.0 (stable)'); 
    40  *     $app->addCommand(new SimpleCommand()); 
     40 *     $app->add(new SimpleCommand()); 
    4141 *     $app->run(); 
    4242 * 
     
    7575        )); 
    7676 
    77         $this->addCommand(new HelpCommand()); 
    78         $this->addCommand(new ListCommand()); 
     77        $this->add(new HelpCommand()); 
     78        $this->add(new ListCommand()); 
    7979 
    8080        $this->definition = new InputDefinition(array( 
     
    182182 
    183183        // the command name MUST be the first element of the input 
    184         $command = $this->findCommand($name); 
     184        $command = $this->find($name); 
    185185 
    186186        $this->runningCommand = $command; 
     
    330330    public function register($name) 
    331331    { 
    332         return $this->addCommand(new Command($name)); 
     332        return $this->add(new Command($name)); 
    333333    } 
    334334 
     
    341341    { 
    342342        foreach ($commands as $command) { 
    343             $this->addCommand($command); 
     343            $this->add($command); 
    344344        } 
    345345    } 
     
    354354     * @return Command The registered command 
    355355     */ 
    356     public function addCommand(Command $command) 
     356    public function add(Command $command) 
    357357    { 
    358358        $command->setApplication($this); 
     
    376376     * @throws \InvalidArgumentException When command name given does not exist 
    377377     */ 
    378     public function getCommand($name) 
     378    public function get($name) 
    379379    { 
    380380        if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) { 
     
    387387            $this->wantHelps = false; 
    388388 
    389             $helpCommand = $this->getCommand('help'); 
     389            $helpCommand = $this->get('help'); 
    390390            $helpCommand->setCommand($command); 
    391391 
     
    403403     * @return Boolean true if the command exists, false otherwise 
    404404     */ 
    405     public function hasCommand($name) 
     405    public function has($name) 
    406406    { 
    407407        return isset($this->commands[$name]) || isset($this->aliases[$name]); 
     
    452452     * Finds a command by name or alias. 
    453453     * 
    454      * Contrary to getCommand, this command tries to find the best 
     454     * Contrary to get, this command tries to find the best 
    455455     * match if you give it an abbreviation of a name or alias. 
    456456     * 
     
    461461     * @throws \InvalidArgumentException When command name is incorrect or ambiguous 
    462462     */ 
    463     public function findCommand($name) 
     463    public function find($name) 
    464464    { 
    465465        // namespace 
     
    482482        $abbrevs = static::getAbbreviations($commands); 
    483483        if (isset($abbrevs[$name]) && 1 == count($abbrevs[$name])) { 
    484             return $this->getCommand($namespace ? $namespace.':'.$abbrevs[$name][0] : $abbrevs[$name][0]); 
     484            return $this->get($namespace ? $namespace.':'.$abbrevs[$name][0] : $abbrevs[$name][0]); 
    485485        } 
    486486 
     
    501501        } 
    502502 
    503         return $this->getCommand($abbrevs[$fullName][0]); 
     503        return $this->get($abbrevs[$fullName][0]); 
    504504    } 
    505505 
     
    513513     * @return array An array of Command instances 
    514514     */ 
    515     public function getCommands($namespace = null) 
     515    public function all($namespace = null) 
    516516    { 
    517517        if (null === $namespace) { 
     
    567567    public function asText($namespace = null) 
    568568    { 
    569         $commands = $namespace ? $this->getCommands($this->findNamespace($namespace)) : $this->commands; 
     569        $commands = $namespace ? $this->all($this->findNamespace($namespace)) : $this->commands; 
    570570 
    571571        $messages = array($this->getHelp(), ''); 
     
    608608    public function asXml($namespace = null, $asDom = false) 
    609609    { 
    610         $commands = $namespace ? $this->getCommands($this->findNamespace($namespace)) : $this->commands; 
     610        $commands = $namespace ? $this->all($this->findNamespace($namespace)) : $this->commands; 
    611611 
    612612        $dom = new \DOMDocument('1.0', 'UTF-8'); 
  • branches/2.0/src/Symfony/Component/Console/Command/HelpCommand.php

    r31229 r31539  
    6666    { 
    6767        if (null === $this->command) { 
    68             $this->command = $this->application->getCommand($input->getArgument('command_name')); 
     68            $this->command = $this->application->get($input->getArgument('command_name')); 
    6969        } 
    7070 
  • branches/2.0/src/Symfony/Component/Console/Shell.php

    r31229 r31539  
    9898        // task name? 
    9999        if (false === strpos($text, ' ') || !$text) { 
    100             return array_keys($this->application->getCommands()); 
     100            return array_keys($this->application->all()); 
    101101        } 
    102102 
  • branches/2.0/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

    r31486 r31539  
    6363    protected function addServiceReturn($id, $definition) 
    6464    { 
    65         return <<<EOF 
    66  
    67         return \$instance; 
    68     } 
    69  
    70 EOF; 
     65        if (!$definition->getMethodCalls() && !$definition->getConfigurator()) { 
     66            return "    }\n"; 
     67        } 
     68 
     69        return "\n        return \$instance;\n    }\n"; 
    7170    } 
    7271 
     
    8483        } 
    8584 
     85        $simple = !$definition->getMethodCalls() && !$definition->getConfigurator(); 
     86 
     87        $instantiation = ''; 
    8688        if ($definition->isShared()) { 
    87             $instantiation = sprintf("        \$this->services['$id'] = \$instance"); 
     89            $instantiation = "\$this->services['$id'] = ".($simple ? '' : '$instance'); 
     90        } elseif (!$simple) { 
     91            $instantiation = '$instance'; 
     92        } 
     93 
     94        $return = ''; 
     95        if ($simple) { 
     96            $return = 'return '; 
    8897        } else { 
    89             $instantiation = sprintf("        \$instance")
     98            $instantiation .= ' = '
    9099        } 
    91100 
    92101        if (null !== $definition->getFactoryMethod()) { 
    93102            if (null !== $definition->getFactoryService()) { 
    94                 $code = sprintf("$instantiation = %s->%s(%s);\n", $this->getServiceCall($definition->getFactoryService()), $definition->getFactoryMethod(), implode(', ', $arguments)); 
     103                $code = sprintf("        $return{$instantiation}%s->%s(%s);\n", $this->getServiceCall($definition->getFactoryService()), $definition->getFactoryMethod(), implode(', ', $arguments)); 
    95104            } else { 
    96                 $code = sprintf("$instantiation = call_user_func(array(%s, '%s')%s);\n", $class, $definition->getFactoryMethod(), $arguments ? ', '.implode(', ', $arguments) : ''); 
     105                $code = sprintf("        $return{$instantiation}call_user_func(array(%s, '%s')%s);\n", $class, $definition->getFactoryMethod(), $arguments ? ', '.implode(', ', $arguments) : ''); 
    97106            } 
    98107        } elseif (false !== strpos($class, '$')) { 
    99             $code = sprintf("        \$class = %s;\n$instantiation = new \$class(%s);\n", $class, implode(', ', $arguments)); 
     108            $code = sprintf("        \$class = %s;\n        $return{$instantiation}new \$class(%s);\n", $class, implode(', ', $arguments)); 
    100109        } else { 
    101             $code = sprintf("$instantiation = new \\%s(%s);\n", substr(str_replace('\\\\', '\\', $class), 1, -1), implode(', ', $arguments)); 
     110            $code = sprintf("        $return{$instantiation}new \\%s(%s);\n", substr(str_replace('\\\\', '\\', $class), 1, -1), implode(', ', $arguments)); 
    102111        } 
    103112 
  • branches/2.0/src/Symfony/Component/DomCrawler/Form.php

    r31229 r31539  
    216216     * @return Boolean true if the field exists, false otherwise 
    217217     */ 
    218     public function hasField($name) 
     218    public function has($name) 
    219219    { 
    220220        return isset($this->fields[$name]); 
     
    230230     * @throws \InvalidArgumentException When field is not present in this form 
    231231     */ 
    232     public function getField($name) 
    233     { 
    234         if (!$this->hasField($name)) { 
     232    public function get($name) 
     233    { 
     234        if (!$this->has($name)) { 
    235235            throw new \InvalidArgumentException(sprintf('The form has no "%s" field', $name)); 
    236236        } 
     
    246246     * @return FormField The field instance 
    247247     */ 
    248     public function setField(Field\FormField $field) 
     248    public function set(Field\FormField $field) 
    249249    { 
    250250        $this->fields[$field->getName()] = $field; 
     
    256256     * @return array An array of fields 
    257257     */ 
    258     public function getFields() 
     258    public function all() 
    259259    { 
    260260        return $this->fields; 
     
    281281 
    282282            if ($node === $button) { 
    283                 $this->setField(new Field\InputFormField($node)); 
     283                $this->set(new Field\InputFormField($node)); 
    284284            } elseif ('select' == $nodeName || 'input' == $nodeName && 'checkbox' == $node->getAttribute('type')) { 
    285                 $this->setField(new Field\ChoiceFormField($node)); 
     285                $this->set(new Field\ChoiceFormField($node)); 
    286286            } elseif ('input' == $nodeName && 'radio' == $node->getAttribute('type')) { 
    287                 if ($this->hasField($node->getAttribute('name'))) { 
    288                     $this->getField($node->getAttribute('name'))->addChoice($node); 
     287                if ($this->has($node->getAttribute('name'))) { 
     288                    $this->get($node->getAttribute('name'))->addChoice($node); 
    289289                } else { 
    290                     $this->setField(new Field\ChoiceFormField($node)); 
     290                    $this->set(new Field\ChoiceFormField($node)); 
    291291                } 
    292292            } elseif ('input' == $nodeName && 'file' == $node->getAttribute('type')) { 
    293                 $this->setField(new Field\FileFormField($node)); 
     293                $this->set(new Field\FileFormField($node)); 
    294294            } elseif ('input' == $nodeName && !in_array($node->getAttribute('type'), array('submit', 'button', 'image'))) { 
    295                 $this->setField(new Field\InputFormField($node)); 
     295                $this->set(new Field\InputFormField($node)); 
    296296            } elseif ('textarea' == $nodeName) { 
    297                 $this->setField(new Field\TextareaFormField($node)); 
     297                $this->set(new Field\TextareaFormField($node)); 
    298298            } 
    299299        } 
     
    309309    public function offsetExists($name) 
    310310    { 
    311         return $this->hasField($name); 
     311        return $this->has($name); 
    312312    } 
    313313 
     
    323323    public function offsetGet($name) 
    324324    { 
    325         if (!$this->hasField($name)) { 
     325        if (!$this->has($name)) { 
    326326            throw new \InvalidArgumentException(sprintf('The form field "%s" does not exist', $name)); 
    327327        } 
     
    340340    public function offsetSet($name, $value) 
    341341    { 
    342         if (!$this->hasField($name)) { 
     342        if (!$this->has($name)) { 
    343343            throw new \InvalidArgumentException(sprintf('The form field "%s" does not exist', $name)); 
    344344        } 
  • branches/2.0/src/Symfony/Component/EventDispatcher/Event.php

    r31229 r31539  
    103103     * @return array The event parameters 
    104104     */ 
    105     public function getParameters() 
     105    public function all() 
    106106    { 
    107107        return $this->parameters; 
     
    115115     * @return Boolean true if the parameter exists, false otherwise 
    116116     */ 
    117     public function hasParameter($name) 
     117    public function has($name) 
    118118    { 
    119119        return array_key_exists($name, $this->parameters); 
     
    129129     * @throws \InvalidArgumentException When parameter doesn't exists for this event 
    130130     */ 
    131     public function getParameter($name) 
     131    public function get($name) 
    132132    { 
    133133        if (!array_key_exists($name, $this->parameters)) { 
     
    144144     * @param mixed   $value  The parameter value 
    145145     */ 
    146     public function setParameter($name, $value) 
     146    public function set($name, $value) 
    147147    { 
    148148        $this->parameters[$name] = $value; 
  • branches/2.0/src/Symfony/Component/Form/Form.php

    r31463 r31539  
    3030class Form extends FieldGroup 
    3131{ 
    32     protected static $defaultCsrfSecret = null; 
    33     protected static $defaultCsrfProtection = false; 
    34     protected static $defaultCsrfFieldName = '_token'; 
    35     protected static $defaultLocale = null; 
    36  
    3732    protected $validator = null; 
    3833    protected $validationGroups = null; 
     
    5550        $this->setData($data); 
    5651 
    57         if (self::$defaultCsrfProtection !== false) { 
     52        if (FormConfiguration::isDefaultCsrfProtectionEnabled()) { 
    5853            $this->enableCsrfProtection(); 
    5954        } 
    6055 
    61         if (self::$defaultLocale !== null) { 
    62             $this->setLocale(self::$defaultLocale); 
     56        if (FormConfiguration::getDefaultLocale() !== null) { 
     57            $this->setLocale(FormConfiguration::getDefaultLocale()); 
    6358        } 
    6459 
     
    8479    { 
    8580        return $this->validationGroups; 
    86     } 
    87  
    88     /** 
    89      * Sets the default locale for newly created forms. 
    90      * 
    91      * @param string $defaultLocale 
    92      */ 
    93     static public function setDefaultLocale($defaultLocale) 
    94     { 
    95         self::$defaultLocale = $defaultLocale; 
    96     } 
    97  
    98     /** 
    99      * Returns the default locale for newly created forms. 
    100      * 
    101      * @return string 
    102      */ 
    103     static public function getDefaultLocale() 
    104     { 
    105         return self::$defaultLocale; 
    10681    } 
    10782 
     
    199174        if (!$this->isCsrfProtected()) { 
    200175            if ($csrfFieldName === null) { 
    201                 $csrfFieldName = self::$defaultCsrfFieldName
     176                $csrfFieldName = FormConfiguration::getDefaultCsrfFieldName()
    202177            } 
    203178 
    204179            if ($csrfSecret === null) { 
    205                 if (self::$defaultCsrfSecret !== null) { 
    206                     $csrfSecret = self::$defaultCsrfSecret
     180                if (FormConfiguration::getDefaultCsrfSecret() !== null) { 
     181                    $csrfSecret = FormConfiguration::getDefaultCsrfSecret()
    207182                } else { 
    208183                    $csrfSecret = md5(__FILE__.php_uname()); 
     
    266241            return $this->get($this->getCsrfFieldName())->getDisplayedData() === $this->generateCsrfToken($this->getCsrfSecret()); 
    267242        } 
    268     } 
    269  
    270     /** 
    271      * Enables CSRF protection for all new forms 
    272      */ 
    273     static public function enableDefaultCsrfProtection() 
    274     { 
    275         self::$defaultCsrfProtection = true; 
    276     } 
    277  
    278     /** 
    279      * Disables Csrf protection for all forms. 
    280      */ 
    281     static public function disableDefaultCsrfProtection() 
    282     { 
    283         self::$defaultCsrfProtection = false; 
    284     } 
    285  
    286     /** 
    287      * Sets the CSRF field name used in all new CSRF protected forms 
    288      * 
    289      * @param string $name The CSRF field name 
    290      */ 
    291     static public function setDefaultCsrfFieldName($name) 
    292     { 
    293         self::$defaultCsrfFieldName = $name; 
    294     } 
    295  
    296     /** 
    297      * Returns the default CSRF field name 
    298      * 
    299      * @return string The CSRF field name 
    300      */ 
    301     static public function getDefaultCsrfFieldName() 
    302     { 
    303         return self::$defaultCsrfFieldName; 
    304     } 
    305  
    306     /** 
    307      * Sets the CSRF secret used in all new CSRF protected forms 
    308      * 
    309      * @param string $secret 
    310      */ 
    311     static public function setDefaultCsrfSecret($secret) 
    312     { 
    313         self::$defaultCsrfSecret = $secret; 
    314     } 
    315  
    316     /** 
    317      * Returns the default CSRF secret 
    318      * 
    319      * @return string 
    320      */ 
    321     static public function getDefaultCsrfSecret() 
    322     { 
    323         return self::$defaultCsrfSecret; 
    324243    } 
    325244 
  • branches/2.0/src/Symfony/Component/HttpFoundation/HeaderBag.php

    r31463 r31539  
    146146 
    147147    /** 
    148      * Deletes a header. 
     148     * Removes a header. 
    149149     * 
    150150     * @param string $key The HTTP header name 
    151151     */ 
    152     public function delete($key) 
     152    public function remove($key) 
    153153    { 
    154154        $key = strtr(strtolower($key), '_', '-'); 
  • branches/2.0/src/Symfony/Component/HttpFoundation/ParameterBag.php

    r31229 r31539  
    106106 
    107107    /** 
    108      * Deletes a parameter. 
     108     * Removes a parameter. 
    109109     * 
    110110     * @param string $key The key 
    111111     */ 
    112     public function delete($key) 
     112    public function remove($key) 
    113113    { 
    114114        unset($this->parameters[$key]); 
  • branches/2.0/src/Symfony/Component/HttpFoundation/Response.php

    r31463 r31539  
    370370     * Sets the Expires HTTP header with a \DateTime instance. 
    371371     * 
    372      * If passed a null value, it deletes the header. 
     372     * If passed a null value, it removes the header. 
    373373     * 
    374374     * @param \DateTime $date A \DateTime instance 
     
    377377    { 
    378378        if (null === $date) { 
    379             $this->headers->delete('Expires'); 
     379            $this->headers->remove('Expires'); 
    380380        } else { 
    381381            $date = clone $date; 
     
    491491     * Sets the Last-Modified HTTP header with a \DateTime instance. 
    492492     * 
    493      * If passed a null value, it deletes the header. 
     493     * If passed a null value, it removes the header. 
    494494     * 
    495495     * @param \DateTime $date A \DateTime instance 
     
    498498    { 
    499499        if (null === $date) { 
    500             $this->headers->delete('Last-Modified'); 
     500            $this->headers->remove('Last-Modified'); 
    501501        } else { 
    502502            $date = clone $date; 
     
    525525    { 
    526526        if (null === $etag) { 
    527             $this->headers->delete('Etag'); 
     527            $this->headers->remove('Etag'); 
    528528        } else { 
    529529            if (0 !== strpos($etag, '"')) { 
     
    596596        // remove headers that MUST NOT be included with 304 Not Modified responses 
    597597        foreach (array('Allow', 'Content-Encoding', 'Content-Language', 'Content-Length', 'Content-MD5', 'Content-Type', 'Last-Modified') as $header) { 
    598             $this->headers->delete($header); 
     598            $this->headers->remove($header); 
    599599        } 
    600600    } 
  • branches/2.0/src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php

    r31463 r31539  
    5050     * {@inheritdoc} 
    5151     */ 
    52     public function delete($key) 
     52    public function remove($key) 
    5353    { 
    54         parent::delete($key); 
     54        parent::remove($key); 
    5555 
    5656        if ('cache-control' === strtr(strtolower($key), '_', '-')) { 
  • branches/2.0/src/Symfony/Component/HttpFoundation/Session.php

    r31403 r31539  
    193193    } 
    194194 
    195     public function getFlashMessages() 
     195    public function getFlashes() 
    196196    { 
    197197        return $this->attributes['_flash']; 
    198198    } 
    199199 
    200     public function setFlashMessages($values) 
     200    public function setFlashes($values) 
    201201    { 
    202202        if (false === $this->started) { 
  • branches/2.0/src/Symfony/Component/HttpKernel/Cache/Cache.php

    r31463 r31539  
    302302 
    303303            $entry = clone $entry; 
    304             $entry->headers->delete('Date'); 
     304            $entry->headers->remove('Date'); 
    305305 
    306306            foreach (array('Date', 'Expires', 'Cache-Control', 'ETag', 'Last-Modified') as $name) { 
     
    339339 
    340340        // avoid that the backend sends no content 
    341         $subRequest->headers->delete('if_modified_since'); 
    342         $subRequest->headers->delete('if_none_match'); 
     341        $subRequest->headers->remove('if_modified_since'); 
     342        $subRequest->headers->remove('if_none_match'); 
    343343 
    344344        $response = $this->forward($subRequest); 
     
    517517 
    518518            $response->setContent(ob_get_clean()); 
    519             $response->headers->delete('X-Body-Eval'); 
     519            $response->headers->remove('X-Body-Eval'); 
    520520        } elseif ($response->headers->has('X-Body-File')) { 
    521521            $response->setContent(file_get_contents($response->headers->get('X-Body-File'))); 
     
    524524        } 
    525525 
    526         $response->headers->delete('X-Body-File'); 
     526        $response->headers->remove('X-Body-File'); 
    527527 
    528528        if (!$response->headers->has('Transfer-Encoding')) { 
  • branches/2.0/src/Symfony/Component/HttpKernel/Cache/Esi.php

    r31317 r31539  
    156156            $value = $response->headers->get('Surrogate-Control'); 
    157157            if ('content="ESI/1.0"' == $value) { 
    158                 $response->headers->delete('Surrogate-Control'); 
     158                $response->headers->remove('Surrogate-Control'); 
    159159            } elseif (preg_match('#,\s*content="ESI/1.0"#', $value)) { 
    160160                $response->headers->set('Surrogate-Control', preg_replace('#,\s*content="ESI/1.0"#', '', $value)); 
  • branches/2.0/src/Symfony/Component/HttpKernel/Cache/EsiListener.php

    r31229 r31539  
    5858    public function filter($event, Response $response) 
    5959    { 
    60         if (HttpKernelInterface::MASTER_REQUEST !== $event->getParameter('request_type')) { 
     60        if (HttpKernelInterface::MASTER_REQUEST !== $event->get('request_type')) { 
    6161            return $response; 
    6262        } 
  • branches/2.0/src/Symfony/Component/HttpKernel/Debug/ExceptionListener.php

    r31229 r31539  
    4949    public function handle(Event $event) 
    5050    { 
    51         if (HttpKernelInterface::MASTER_REQUEST !== $event->getParameter('request_type')) { 
     51        if (HttpKernelInterface::MASTER_REQUEST !== $event->get('request_type')) { 
    5252            return false; 
    5353        } 
    5454 
    55         $exception = $event->getParameter('exception'); 
    56         $request = $event->getParameter('request'); 
     55        $exception = $event->get('exception'); 
     56        $request = $event->get('request'); 
    5757 
    5858        if (null !== $this->logger) { 
  • branches/2.0/src/Symfony/Component/HttpKernel/Kernel.php

    r31486 r31539  
    319319                'kernel.bundles'          => $bundles, 
    320320                'kernel.charset'          => 'UTF-8', 
    321                 'kernel.compiled_classes' => array(), 
    322321            ), 
    323322            $this->getEnvParameters() 
  • branches/2.0/src/Symfony/Component/HttpKernel/Profiler/ProfilerListener.php

    r31229 r31539  
    6363    public function handleException(Event $event) 
    6464    { 
    65         if (HttpKernelInterface::MASTER_REQUEST !== $event->getParameter('request_type')) { 
     65        if (HttpKernelInterface::MASTER_REQUEST !== $event->get('request_type')) { 
    6666            return false; 
    6767        } 
    6868 
    69         $this->exception = $event->getParameter('exception'); 
     69        $this->exception = $event->get('exception'); 
    7070 
    7171        return false; 
     
    8181    public function handleResponse(Event $event, Response $response) 
    8282    { 
    83         if (HttpKernelInterface::MASTER_REQUEST !== $event->getParameter('request_type')) { 
     83        if (HttpKernelInterface::MASTER_REQUEST !== $event->get('request_type')) { 
    8484            return $response; 
    8585        } 
    8686 
    87         if (null !== $this->matcher && !$this->matcher->matches($event->getParameter('request'))) { 
     87        if (null !== $this->matcher && !$this->matcher->matches($event->get('request'))) { 
    8888            return $response; 
    8989        } 
     
    9393        } 
    9494 
    95         $this->profiler->collect($event->getParameter('request'), $response, $this->exception); 
     95        $this->profiler->collect($event->get('request'), $response, $this->exception); 
    9696        $this->exception = null; 
    9797 
  • branches/2.0/src/Symfony/Component/HttpKernel/Resources/bin/packager.php

    r30923 r31539  
    2828    'Symfony\\Component\\HttpKernel\\Debug\\ErrorHandler', 
    2929    'Symfony\\Component\\HttpKernel\\ClassCollectionLoader', 
     30 
     31    'Symfony\\Component\\DependencyInjection\\Container', 
     32    'Symfony\\Component\\DependencyInjection\\ContainerAwareInterface', 
     33    'Symfony\\Component\\DependencyInjection\\ContainerInterface', 
     34    'Symfony\\Component\\DependencyInjection\\ParameterBag\\FrozenParameterBag', 
     35    'Symfony\\Component\\DependencyInjection\\ParameterBag\\ParameterBagInterface', 
     36    'Symfony\\Component\\DependencyInjection\\TaggedContainerInterface', 
     37 
    3038), __DIR__.'/../..', 'bootstrap', false); 
  • branches/2.0/src/Symfony/Component/HttpKernel/ResponseListener.php

    r31229 r31539  
    4242    public function filter(Event $event, Response $response) 
    4343    { 
    44         if (HttpKernelInterface::MASTER_REQUEST !== $event->getParameter('request_type') || $response->headers->has('Content-Type')) { 
     44        if (HttpKernelInterface::MASTER_REQUEST !== $event->get('request_type') || $response->headers->has('Content-Type')) { 
    4545            return $response; 
    4646        } 
    4747 
    48         $request = $event->getParameter('request'); 
     48        $request = $event->get('request'); 
    4949        $format = $request->getRequestFormat(); 
    5050        if ((null !== $format) && $mimeType = $request->getMimeType($format)) { 
  • branches/2.0/src/Symfony/Component/HttpKernel/Security/Firewall.php

    r31266 r31539  
    6161    public function handle(Event $event) 
    6262    { 
    63         if (HttpKernelInterface::MASTER_REQUEST !== $event->getParameter('request_type')) { 
     63        if (HttpKernelInterface::MASTER_REQUEST !== $event->get('request_type')) { 
    6464            return; 
    6565        } 
    6666 
    67         $request = $event->getParameter('request'); 
     67        $request = $event->get('request'); 
    6868 
    6969        $this->dispatcher->disconnect('core.security'); 
  • branches/2.0/src/Symfony/Component/HttpKernel/Security/Firewall/AccessListener.php

    r31266 r31539  
    6666        } 
    6767 
    68         $request = $event->getParameter('request'); 
     68        $request = $event->get('request'); 
    6969 
    7070        list($attributes, $channel) = $this->map->getPatterns($request); 
  • branches/2.0/src/Symfony/Component/HttpKernel/Security/Firewall/AnonymousAuthenticationListener.php

    r31266 r31539  
    5656    public function handle(Event $event) 
    5757    { 
    58         $request = $event->getParameter('request'); 
     58        $request = $event->get('request'); 
    5959 
    6060        if (null !== $this->context->getToken()) { 
  • branches/2.0/src/Symfony/Component/HttpKernel/Security/Firewall/BasicAuthenticationListener.php

    r31266 r31539  
    6161    public function handle(Event $event) 
    6262    { 
    63         $request = $event->getParameter('request'); 
     63        $request = $event->get('request'); 
    6464 
    6565        if (false === $username = $request->server->get('PHP_AUTH_USER', false)) { 
  • branches/2.0/src/Symfony/Component/HttpKernel/Security/Firewall/ChannelListener.php

    r31266 r31539  
    5555    public function handle(Event $event) 
    5656    { 
    57         $request = $event->getParameter('request'); 
     57        $request = $event->get('request'); 
    5858 
    5959        list($attributes, $channel) = $this->map->getPatterns($request); 
  • branches/2.0/src/Symfony/Component/HttpKernel/Security/Firewall/ContextListener.php

    r31266 r31539  
    5656    public function read(Event $event) 
    5757    { 
    58         $request = $event->getParameter('request'); 
     58        $request = $event->get('request'); 
    5959 
    6060        $session = $request->hasSession() ? $request->getSession() : null; 
     
    8484    public function write(Event $event, Response $response) 
    8585    { 
    86         if (HttpKernelInterface::MASTER_REQUEST !== $event->getParameter('request_type')) { 
     86        if (HttpKernelInterface::MASTER_REQUEST !== $event->get('request_type')) { 
    8787            return $response; 
    8888        } 
     
    100100        } 
    101101 
    102         $event->getParameter('request')->getSession()->set('_security', serialize($token)); 
     102        $event->get('request')->getSession()->set('_security', serialize($token)); 
    103103 
    104104        return $response; 
  • branches/2.0/src/Symfony/Component/HttpKernel/Security/Firewall/DigestAuthenticationListener.php

    r31266 r31539  
    6464    public function handle(Event $event) 
    6565    { 
    66         $request = $event->getParameter('request'); 
     66        $request = $event->get('request'); 
    6767 
    6868        if (!$header = $request->server->get('PHP_AUTH_DIGEST')) { 
  • branches/2.0/src/Symfony/Component/HttpKernel/Security/Firewall/ExceptionListener.php

    r31266 r31539  
    6363    public function handleException(Event $event) 
    6464    { 
    65         $exception = $event->getParameter('exception'); 
    66         $request = $event->getParameter('request'); 
     65        $exception = $event->get('exception'); 
     66        $request = $event->get('request'); 
    6767 
    6868        if ($exception instanceof AuthenticationException) { 
     
    7474                $response = $this->startAuthentication($request, $exception); 
    7575            } catch (\Exception $e) { 
    76                 $event->setParameter('exception', $e); 
     76                $event->set('exception', $e); 
    7777 
    7878                return; 
     
    8888                    $response = $this->startAuthentication($request, new InsufficientAuthenticationException('Full authentication is required to access this resource.', $token, 0, $exception)); 
    8989                } catch (\Exception $e) { 
    90                     $event->setParameter('exception', $e); 
     90                    $event->set('exception', $e); 
    9191 
    9292                    return; 
     
    111111                    } 
    112112 
    113                     $event->setParameter('exception', new \RuntimeException('Exception thrown when handling an exception.', 0, $e)); 
     113                    $event->set('exception', new \RuntimeException('Exception thrown when handling an exception.', 0, $e)); 
    114114 
    115115                    return; 
  • branches/2.0/src/Symfony/Component/HttpKernel/Security/Firewall/FormAuthenticationListener.php

    r31266 r31539  
    7878    public function handle(Event $event) 
    7979    { 
    80         $request = $event->getParameter('request'); 
     80        $request = $event->get('request'); 
    8181 
    8282        if ($this->options['check_path'] !== $request->getPathInfo()) { 
  • branches/2.0/src/Symfony/Component/HttpKernel/Security/Firewall/LogoutListener.php

    r31266 r31539  
    5959    public function handle(Event $event) 
    6060    { 
    61         $request = $event->getParameter('request'); 
     61        $request = $event->get('request'); 
    6262 
    6363        if ($this->logoutPath !== $request->getPathInfo()) { 
  • branches/2.0/src/Symfony/Component/HttpKernel/Security/Firewall/PreAuthenticatedListener.php

    r31266 r31539  
    5959    public function handle(Event $event) 
    6060    { 
    61         $request = $event->getParameter('request'); 
     61        $request = $event->get('request'); 
    6262 
    6363        if (null !== $this->logger) { 
  • branches/2.0/src/Symfony/Component/HttpKernel/Security/Firewall/SwitchUserListener.php

    r31266 r31539  
    7575    public function handle(Event $event) 
    7676    { 
    77         $request = $event->getParameter('request'); 
     77        $request = $event->get('request'); 
    7878 
    7979        if (!$request->get($this->usernameParameter)) { 
  • branches/2.0/src/Symfony/Component/HttpKernel/bootstrap.php

    r31371 r31539  
    128128            return; } 
    129129        throw new \RuntimeException(sprintf('Failed to write cache file "%s".', $file)); } } 
     130namespace Symfony\Component\DependencyInjection; 
     131use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; 
     132use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; 
     133use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; 
     134class Container implements ContainerInterface { 
     135    protected $parameterBag; 
     136    protected $services; 
     137    public function __construct(ParameterBagInterface $parameterBag = null) { 
     138        $this->parameterBag = null === $parameterBag ? new ParameterBag() : $parameterBag; 
     139        $this->services = array(); 
     140        $this->set('service_container', $this); } 
     141    public function freeze() { 
     142        $this->parameterBag->resolve(); 
     143        $this->parameterBag = new FrozenParameterBag($this->parameterBag->all()); } 
     144    public function isFrozen() { 
     145        return $this->parameterBag instanceof FrozenParameterBag; } 
     146    public function getParameterBag() { 
     147        return $this->parameterBag; } 
     148    public function getParameter($name) { 
     149        return $this->parameterBag->get($name); } 
     150    public function hasParameter($name) { 
     151        return $this->parameterBag->has($name); } 
     152    public function setParameter($name, $value) { 
     153        $this->parameterBag->set($name, $value); } 
     154    public function set($id, $service) { 
     155        $this->services[$id] = $service; } 
     156    public function has($id) { 
     157        return isset($this->services[$id]) || method_exists($this, 'get'.strtr($id, array('_' => '', '.' => '_')).'Service'); } 
     158    public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) { 
     159        $id = (string) $id; 
     160        if (isset($this->services[$id])) { 
     161            return $this->services[$id]; } 
     162        if (method_exists($this, $method = 'get'.strtr($id, array('_' => '', '.' => '_')).'Service')) { 
     163            return $this->$method(); } 
     164        if (self::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) { 
     165            throw new \InvalidArgumentException(sprintf('The service "%s" does not exist.', $id)); } } 
     166    public function getServiceIds() { 
     167        $ids = array(); 
     168        $r = new \ReflectionClass($this); 
     169        foreach ($r->getMethods() as $method) { 
     170            if (preg_match('/^get(.+)Service$/', $name = $method->getName(), $match)) { 
     171                $ids[] = self::underscore($match[1]); } } 
     172        return array_merge($ids, array_keys($this->services)); } 
     173    static public function camelize($id) { 
     174        return preg_replace(array('/(?:^|_)+(.)/e', '/\.(.)/e'), array("strtoupper('\\1')", "'_'.strtoupper('\\1')"), $id); } 
     175    static public function underscore($id) { 
     176        return strtolower(preg_replace(array('/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'), array('\\1_\\2', '\\1_\\2'), strtr($id, '_', '.'))); } } 
     177namespace Symfony\Component\DependencyInjection; 
     178interface ContainerAwareInterface { 
     179    function setContainer(ContainerInterface $container = null); } 
     180namespace Symfony\Component\DependencyInjection; 
     181interface ContainerInterface { 
     182    const EXCEPTION_ON_INVALID_REFERENCE = 1; 
     183    const NULL_ON_INVALID_REFERENCE      = 2; 
     184    const IGNORE_ON_INVALID_REFERENCE    = 3; 
     185    function set($id, $service); 
     186    function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE); 
     187    function has($id); } 
     188namespace Symfony\Component\DependencyInjection\ParameterBag; 
     189class FrozenParameterBag extends ParameterBag { 
     190    public function __construct(array $parameters = array()) { 
     191        foreach ($parameters as $key => $value) { 
     192            $this->parameters[strtolower($key)] = $value; } } 
     193    public function clear() { 
     194        throw new \LogicException('Impossible to call clear() on a frozen ParameterBag.'); } 
     195    public function add(array $parameters) { 
     196        throw new \LogicException('Impossible to call add() on a frozen ParameterBag.'); } 
     197    public function set($name, $value) { 
     198        throw new \LogicException('Impossible to call set() on a frozen ParameterBag.'); } } 
     199namespace Symfony\Component\DependencyInjection\ParameterBag; 
     200interface ParameterBagInterface { 
     201    function clear(); 
     202    function add(array $parameters); 
     203    function all(); 
     204    function get($name); 
     205    function set($name, $value); 
     206    function has($name); } 
     207namespace Symfony\Component\DependencyInjection; 
     208interface TaggedContainerInterface extends ContainerInterface { 
     209    function findTaggedServiceIds($name); } 
  • branches/2.0/src/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php

    r31229 r31539  
    5252        $methods = array(); 
    5353 
    54         foreach ($this->routes->getRoutes() as $name => $route) { 
     54        foreach ($this->routes->all() as $name => $route) { 
    5555            $compiledRoute = $route->compile(); 
    5656 
  • branches/2.0/src/Symfony/Component/Routing/Generator/UrlGenerator.php

    r31229 r31539  
    5555    public function generate($name, array $parameters, $absolute = false) 
    5656    { 
    57         if (null === $route = $this->routes->getRoute($name)) { 
     57        if (null === $route = $this->routes->get($name)) { 
    5858            throw new \InvalidArgumentException(sprintf('Route "%s" does not exist.', $name)); 
    5959        } 
  • branches/2.0/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php

    r31229 r31539  
    122122 
    123123                $route = new Route($globals['pattern'].$annot->getPattern(), $defaults, $requirements, $options); 
    124                 $collection->addRoute($annot->getName(), $route); 
     124                $collection->add($annot->getName(), $route); 
    125125            } 
    126126        } 
  • branches/2.0/src/Symfony/Component/Routing/Loader/XmlFileLoader.php

    r31266 r31539  
    105105        $route = new Route((string) $definition->getAttribute('pattern'), $defaults, $requirements, $options); 
    106106 
    107         $collection->addRoute((string) $definition->getAttribute('id'), $route); 
     107        $collection->add((string) $definition->getAttribute('id'), $route); 
    108108    } 
    109109 
  • branches/2.0/src/Symfony/Component/Routing/Loader/YamlFileLoader.php

    r31229 r31539  
    8484        $route = new Route($config['pattern'], $defaults, $requirements, $options); 
    8585 
    86         $collection->addRoute($name, $route); 
     86        $collection->add($name, $route); 
    8787    } 
    8888 
  • branches/2.0/src/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php

    r31371 r31539  
    4242        $regexes = array(); 
    4343 
    44         foreach ($this->routes->getRoutes() as $name => $route) { 
     44        foreach ($this->routes->all() as $name => $route) { 
    4545            $compiledRoute = $route->compile(); 
    4646 
  • branches/2.0/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php

    r31229 r31539  
    5252        $code = array(); 
    5353 
    54         foreach ($this->routes->getRoutes() as $name => $route) { 
     54        foreach ($this->routes->all() as $name => $route) { 
    5555            $compiledRoute = $route->compile(); 
    5656 
  • branches/2.0/src/Symfony/Component/Routing/Matcher/UrlMatcher.php

    r31229 r31539  
    5353        $url = $this->normalizeUrl($url); 
    5454 
    55         foreach ($this->routes->getRoutes() as $name => $route) { 
     55        foreach ($this->routes->all() as $name => $route) { 
    5656            $compiledRoute = $route->compile(); 
    5757 
  • branches/2.0/src/Symfony/Component/Routing/RouteCollection.php

    r31229 r31539  
    4141     * @throws \InvalidArgumentException When route name contains non valid characters 
    4242     */ 
    43     public function addRoute($name, Route $route) 
     43    public function add($name, Route $route) 
    4444    { 
    4545        if (!preg_match('/^[a-z0-9A-Z_]+$/', $name)) { 
     
    5555     * @return array An array of routes 
    5656     */ 
    57     public function getRoutes() 
     57    public function all() 
    5858    { 
    5959        return $this->routes; 
     
    6767     * @return Route  $route A Route instance 
    6868     */ 
    69     public function getRoute($name) 
     69    public function get($name) 
    7070    { 
    7171        return isset($this->routes[$name]) ? $this->routes[$name] : null; 
     
    8686        } 
    8787 
    88         $this->routes = array_merge($this->routes, $collection->getRoutes()); 
     88        $this->routes = array_merge($this->routes, $collection->all()); 
    8989    } 
    9090 
     
    100100        } 
    101101 
    102         foreach ($this->getRoutes() as $route) { 
     102        foreach ($this->all() as $route) { 
    103103            $route->setPattern($prefix.$route->getPattern()); 
    104104        } 
  • branches/2.0/src/Symfony/Component/Security/Authentication/AuthenticationProviderManager.php

    r31317 r31539  
    9191     * @return AuthenticationProviderInterface[] An array of AuthenticationProviderInterface instances 
    9292     */ 
    93     public function getProviders() 
     93    public function all() 
    9494    { 
    9595        return $this->providers; 
     
    105105        $this->providers = array(); 
    106106        foreach ($providers as $provider) { 
    107             $this->addProvider($provider); 
     107            $this->add($provider); 
    108108        } 
    109109    } 
     
    114114     * @param AuthenticationProviderInterface $provider A AuthenticationProviderInterface instance 
    115115     */ 
    116     public function addProvider(AuthenticationProviderInterface $provider) 
     116    public function add(AuthenticationProviderInterface $provider) 
    117117    { 
    118118        $this->providers[] = $provider; 
  • branches/2.0/src/Symfony/Component/Translation/Loader/ArrayLoader.php

    r31403 r31539  
    2828        $this->flatten($resource); 
    2929        $catalogue = new MessageCatalogue($locale); 
    30         $catalogue->addMessages($resource, $domain); 
     30        $catalogue->add($resource, $domain); 
    3131 
    3232        return $catalogue; 
  • branches/2.0/src/Symfony/Component/Translation/Loader/XliffFileLoader.php

    r31403 r31539  
    3232        $catalogue = new MessageCatalogue($locale); 
    3333        foreach ($xml->xpath('//xliff:trans-unit') as $translation) { 
    34             $catalogue->setMessage((string) $translation->source, (string) $translation->target, $domain); 
     34            $catalogue->set((string) $translation->source, (string) $translation->target, $domain); 
    3535        } 
    3636        $catalogue->addResource(new FileResource($resource)); 
  • branches/2.0/src/Symfony/Component/Translation/MessageCatalogue.php

    r31317 r31539  
    5757     * {@inheritdoc} 
    5858     */ 
    59     public function getMessages($domain = null) 
     59    public function all($domain = null) 
    6060    { 
    6161        if (null === $domain) { 
     
    6969     * {@inheritdoc} 
    7070     */ 
    71     public function setMessage($id, $translation, $domain = 'messages') 
     71    public function set($id, $translation, $domain = 'messages') 
    7272    { 
    73         $this->addMessages(array($id => $translation), $domain); 
     73        $this->add(array($id => $translation), $domain); 
    7474    } 
    7575 
     
    7777     * {@inheritdoc} 
    7878     */ 
    79     public function hasMessage($id, $domain = 'messages') 
     79    public function has($id, $domain = 'messages') 
    8080    { 
    8181        return isset($this->messages[$domain][$id]); 
     
    8585     * {@inheritdoc} 
    8686     */ 
    87     public function getMessage($id, $domain = 'messages') 
     87    public function get($id, $domain = 'messages') 
    8888    { 
    8989        return isset($this->messages[$domain][$id]) ? $this->messages[$domain][$id] : $id; 
     
    9393     * {@inheritdoc} 
    9494     */ 
    95     public function setMessages($messages, $domain = 'messages') 
     95    public function replace($messages, $domain = 'messages') 
    9696    { 
    9797        $this->messages[$domain] = array(); 
    9898 
    99         $this->addMessages($messages, $domain); 
     99        $this->add($messages, $domain); 
    100100    } 
    101101 
     
    103103     * {@inheritdoc} 
    104104     */ 
    105     public function addMessages($messages, $domain = 'messages') 
     105    public function add($messages, $domain = 'messages') 
    106106    { 
    107107        if (!isset($this->messages[$domain])) { 
     
    121121        } 
    122122 
    123         foreach ($catalogue->getMessages() as $domain => $messages) { 
    124             $this->addMessages($messages, $domain); 
     123        foreach ($catalogue->all() as $domain => $messages) { 
     124            $this->add($messages, $domain); 
    125125        } 
    126126 
     
    136136    { 
    137137        foreach ($catalogue->getDomains() as $domain) { 
    138             foreach ($catalogue->getMessages($domain) as $id => $translation) { 
    139                 if (false === $this->hasMessage($id, $domain)) { 
    140                     $this->setMessage($id, $translation, $domain); 
     138            foreach ($catalogue->all($domain) as $id => $translation) { 
     139                if (false === $this->has($id, $domain)) { 
     140                    $this->set($id, $translation, $domain); 
    141141                } 
    142142            } 
  • branches/2.0/src/Symfony/Component/Translation/MessageCatalogueInterface.php

    r31317 r31539  
    4444     * @return array An array of messages 
    4545     */ 
    46     function getMessages($domain = null); 
     46    function all($domain = null); 
    4747 
    4848    /** 
     
    5353     * @param string $domain      The domain name 
    5454     */ 
    55     function setMessage($id, $translation, $domain = 'messages'); 
     55    function set($id, $translation, $domain = 'messages'); 
    5656 
    5757    /** 
     
    6363     * @return Boolean true if the message has a translation, false otherwise 
    6464     */ 
    65     function hasMessage($id, $domain = 'messages'); 
     65    function has($id, $domain = 'messages'); 
    6666 
    6767    /** 
     
    7373     * @return string The message translation 
    7474     */ 
    75     function getMessage($id, $domain = 'messages'); 
     75    function get($id, $domain = 'messages'); 
    7676 
    7777    /** 
     
    8181     * @param string $domain   The domain name 
    8282     */ 
    83     function setMessages($messages, $domain = 'messages'); 
     83    function replace($messages, $domain = 'messages'); 
    8484 
    8585    /** 
     
    8989     * @param string $domain   The domain name 
    9090     */ 
    91     function addMessages($messages, $domain = 'messages'); 
     91    function add($messages, $domain = 'messages'); 
    9292 
    9393    /** 
  • branches/2.0/src/Symfony/Component/Translation/Translator.php

    r31317 r31539  
    113113        } 
    114114 
    115         return strtr($this->catalogues[$locale]->getMessage($id, $domain), $parameters); 
     115        return strtr($this->catalogues[$locale]->get($id, $domain), $parameters); 
    116116    } 
    117117 
     
    129129        } 
    130130 
    131         return strtr($this->selector->choose($this->catalogues[$locale]->getMessage($id, $domain), (int) $number, $locale), $parameters); 
     131        return strtr($this->selector->choose($this->catalogues[$locale]->get($id, $domain), (int) $number, $locale), $parameters); 
    132132    } 
    133133 
  • branches/2.0/tests/Symfony/Tests/Component/Console/ApplicationTest.php

    r31463 r31539  
    3939        $this->assertEquals('foo', $application->getName(), '__construct() takes the application name as its first argument'); 
    4040        $this->assertEquals('bar', $application->getVersion(), '__construct() takes the application version as its first argument'); 
    41         $this->assertEquals(array('help', 'list'), array_keys($application->getCommands()), '__construct() registered the help and list commands by default'); 
     41        $this->assertEquals(array('help', 'list'), array_keys($application->all()), '__construct() registered the help and list commands by default'); 
    4242    } 
    4343 
     
    6868    } 
    6969 
    70     public function testGetCommands() 
    71     { 
    72         $application = new Application(); 
    73         $commands = $application->getCommands(); 
    74         $this->assertEquals('Symfony\\Component\\Console\\Command\\HelpCommand', get_class($commands['help']), '->getCommands() returns the registered commands'); 
    75  
    76         $application->addCommand(new \FooCommand()); 
    77         $commands = $application->getCommands('foo'); 
    78         $this->assertEquals(1, count($commands), '->getCommands() takes a namespace as its first argument'); 
     70    public function testAll() 
     71    { 
     72        $application = new Application(); 
     73        $commands = $application->all(); 
     74        $this->assertEquals('Symfony\\Component\\Console\\Command\\HelpCommand', get_class($commands['help']), '->all() returns the registered commands'); 
     75 
     76        $application->add(new \FooCommand()); 
     77        $commands = $application->all('foo'); 
     78        $this->assertEquals(1, count($commands), '->all() takes a namespace as its first argument'); 
    7979    } 
    8080 
     
    8686    } 
    8787 
    88     public function testAddCommand() 
    89     { 
    90         $application = new Application(); 
    91         $application->addCommand($foo = new \FooCommand()); 
    92         $commands = $application->getCommands(); 
    93         $this->assertEquals($foo, $commands['foo:bar'], '->addCommand() registers a command'); 
     88    public function testAdd() 
     89    { 
     90        $application = new Application(); 
     91        $application->add($foo = new \FooCommand()); 
     92        $commands = $application->all(); 
     93        $this->assertEquals($foo, $commands['foo:bar'], '->add() registers a command'); 
    9494 
    9595        $application = new Application(); 
    9696        $application->addCommands(array($foo = new \FooCommand(), $foo1 = new \Foo1Command())); 
    97         $commands = $application->getCommands(); 
     97        $commands = $application->all(); 
    9898        $this->assertEquals(array($foo, $foo1), array($commands['foo:bar'], $commands['foo:bar1']), '->addCommands() registers an array of commands'); 
    9999    } 
    100100 
    101     public function testHasGetCommand() 
    102     { 
    103         $application = new Application(); 
    104         $this->assertTrue($application->hasCommand('list'), '->hasCommand() returns true if a named command is registered'); 
    105         $this->assertFalse($application->hasCommand('afoobar'), '->hasCommand() returns false if a named command is not registered'); 
    106  
    107         $application->addCommand($foo = new \FooCommand()); 
    108         $this->assertTrue($application->hasCommand('afoobar'), '->hasCommand() returns true if an alias is registered'); 
    109         $this->assertEquals($foo, $application->getCommand('foo:bar'), '->getCommand() returns a command by name'); 
    110         $this->assertEquals($foo, $application->getCommand('afoobar'), '->getCommand() returns a command by alias'); 
    111  
    112         try { 
    113             $application->getCommand('foofoo'); 
    114             $this->fail('->getCommand() throws an \InvalidArgumentException if the command does not exist'); 
    115         } catch (\Exception $e) { 
    116             $this->assertInstanceOf('\InvalidArgumentException', $e, '->getCommand() throws an \InvalidArgumentException if the command does not exist'); 
    117             $this->assertEquals('The command "foofoo" does not exist.', $e->getMessage(), '->getCommand() throws an \InvalidArgumentException if the command does not exist'); 
     101    public function testHasGet() 
     102    { 
     103        $application = new Application(); 
     104        $this->assertTrue($application->has('list'), '->has() returns true if a named command is registered'); 
     105        $this->assertFalse($application->has('afoobar'), '->has() returns false if a named command is not registered'); 
     106 
     107        $application->add($foo = new \FooCommand()); 
     108        $this->assertTrue($application->has('afoobar'), '->has() returns true if an alias is registered'); 
     109        $this->assertEquals($foo, $application->get('foo:bar'), '->get() returns a command by name'); 
     110        $this->assertEquals($foo, $application->get('afoobar'), '->get() returns a command by alias'); 
     111 
     112        try { 
     113            $application->get('foofoo'); 
     114            $this->fail('->get() throws an \InvalidArgumentException if the command does not exist'); 
     115        } catch (\Exception $e) { 
     116            $this->assertInstanceOf('\InvalidArgumentException', $e, '->get() throws an \InvalidArgumentException if the command does not exist'); 
     117            $this->assertEquals('The command "foofoo" does not exist.', $e->getMessage(), '->get() throws an \InvalidArgumentException if the command does not exist'); 
    118118        } 
    119119 
    120120        $application = new TestApplication(); 
    121         $application->addCommand($foo = new \FooCommand()); 
     121        $application->add($foo = new \FooCommand()); 
    122122        $application->setWantHelps(); 
    123         $command = $application->getCommand('foo:bar'); 
    124         $this->assertEquals('Symfony\Component\Console\Command\HelpCommand', get_class($command), '->getCommand() returns the help command if --help is provided as the input'); 
     123        $command = $application->get('foo:bar'); 
     124        $this->assertEquals('Symfony\Component\Console\Command\HelpCommand', get_class($command), '->get() returns the help command if --help is provided as the input'); 
    125125    } 
    126126 
     
    128128    { 
    129129        $application = new TestApplication(); 
    130         $application->addCommand(new \FooCommand()); 
    131         $application->addCommand(new \Foo1Command()); 
     130        $application->add(new \FooCommand()); 
     131        $application->add(new \Foo1Command()); 
    132132        $this->assertEquals(array('foo'), $application->getNamespaces(), '->getNamespaces() returns an array of unique used namespaces'); 
    133133    } 
     
    136136    { 
    137137        $application = new TestApplication(); 
    138         $application->addCommand(new \FooCommand()); 
     138        $application->add(new \FooCommand()); 
    139139        $this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns the given namespace if it exists'); 
    140140        $this->assertEquals('foo', $application->findNamespace('f'), '->findNamespace() finds a namespace given an abbreviation'); 
    141         $application->addCommand(new \Foo2Command()); 
     141        $application->add(new \Foo2Command()); 
    142142        $this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns the given namespace if it exists'); 
    143143        try { 
     
    158158    } 
    159159 
    160     public function testFindCommand() 
     160    public function testFind() 
    161161    { 
    162162        $application = new TestApplication(); 
    163         $application->addCommand(new \FooCommand()); 
    164         $this->assertEquals('FooCommand', get_class($application->findCommand('foo:bar')), '->findCommand() returns a command if its name exists'); 
    165         $this->assertEquals('Symfony\Component\Console\Command\HelpCommand', get_class($application->findCommand('h')), '->findCommand() returns a command if its name exists'); 
    166         $this->assertEquals('FooCommand', get_class($application->findCommand('f:bar')), '->findCommand() returns a command if the abbreviation for the namespace exists'); 
    167         $this->assertEquals('FooCommand', get_class($application->findCommand('f:b')), '->findCommand() returns a command if the abbreviation for the namespace and the command name exist'); 
    168         $this->assertEquals('FooCommand', get_class($application->findCommand('a')), '->findCommand() returns a command if the abbreviation exists for an alias'); 
    169  
    170         $application->addCommand(new \Foo1Command()); 
    171         $application->addCommand(new \Foo2Command()); 
    172  
    173         try { 
    174             $application->findCommand('f'); 
    175             $this->fail('->findCommand() throws an \InvalidArgumentException if the abbreviation is ambiguous for a namespace'); 
    176         } catch (\Exception $e) { 
    177             $this->assertInstanceOf('\InvalidArgumentException', $e, '->findCommand() throws an \InvalidArgumentException if the abbreviation is ambiguous for a namespace'); 
    178             $this->assertEquals('Command "f" is not defined.', $e->getMessage(), '->findCommand() throws an \InvalidArgumentException if the abbreviation is ambiguous for a namespace'); 
    179         } 
    180  
    181         try { 
    182             $application->findCommand('a'); 
    183             $this->fail('->findCommand() throws an \InvalidArgumentException if the abbreviation is ambiguous for an alias'); 
    184         } catch (\Exception $e) { 
    185             $this->assertInstanceOf('\InvalidArgumentException', $e, '->findCommand() throws an \InvalidArgumentException if the abbreviation is ambiguous for an alias'); 
    186             $this->assertEquals('Command "a" is ambiguous (afoobar, afoobar1 and 1 more).', $e->getMessage(), '->findCommand() throws an \InvalidArgumentException if the abbreviation is ambiguous for an alias'); 
    187         } 
    188  
    189         try { 
    190             $application->findCommand('foo:b'); 
    191             $this->fail('->findCommand() throws an \InvalidArgumentException if the abbreviation is ambiguous for a command'); 
    192         } catch (\Exception $e) { 
    193             $this->assertInstanceOf('\InvalidArgumentException', $e, '->findCommand() throws an \InvalidArgumentException if the abbreviation is ambiguous for a command'); 
    194             $this->assertEquals('Command "foo:b" is ambiguous (foo:bar, foo:bar1).', $e->getMessage(), '->findCommand() throws an \InvalidArgumentException if the abbreviation is ambiguous for a command'); 
     163        $application->add(new \FooCommand()); 
     164        $this->assertEquals('FooCommand', get_class($application->find('foo:bar')), '->find() returns a command if its name exists'); 
     165        $this->assertEquals('Symfony\Component\Console\Command\HelpCommand', get_class($application->find('h')), '->find() returns a command if its name exists'); 
     166        $this->assertEquals('FooCommand', get_class($application->find('f:bar')), '->find() returns a command if the abbreviation for the namespace exists'); 
     167        $this->assertEquals('FooCommand', get_class($application->find('f:b')), '->find() returns a command if the abbreviation for the namespace and the command name exist'); 
     168        $this->assertEquals('FooCommand', get_class($application->find('a')), '->find() returns a command if the abbreviation exists for an alias'); 
     169 
     170        $application->add(new \Foo1Command()); 
     171        $application->add(new \Foo2Command()); 
     172 
     173        try { 
     174            $application->find('f'); 
     175            $this->fail('->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for a namespace'); 
     176        } catch (\Exception $e) { 
     177            $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for a namespace'); 
     178            $this->assertEquals('Command "f" is not defined.', $e->getMessage(), '->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for a namespace'); 
     179        } 
     180 
     181        try { 
     182            $application->find('a'); 
     183            $this->fail('->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for an alias'); 
     184        } catch (\Exception $e) { 
     185            $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for an alias'); 
     186            $this->assertEquals('Command "a" is ambiguous (afoobar, afoobar1 and 1 more).', $e->getMessage(), '->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for an alias'); 
     187        } 
     188 
     189        try { 
     190            $application->find('foo:b'); 
     191            $this->fail('->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for a command'); 
     192        } catch (\Exception $e) { 
     193            $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for a command'); 
     194            $this->assertEquals('Command "foo:b" is ambiguous (foo:bar, foo:bar1).', $e->getMessage(), '->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for a command'); 
    195195        } 
    196196    } 
     
    219219    { 
    220220        $application = new Application(); 
    221         $application->addCommand(new \FooCommand); 
     221        $application->add(new \FooCommand); 
    222222        $this->assertStringEqualsFile(self::$fixturesPath.'/application_astext1.txt', $application->asText(), '->asText() returns a text representation of the application'); 
    223223        $this->assertStringEqualsFile(self::$fixturesPath.'/application_astext2.txt', $application->asText('foo'), '->asText() returns a text representation of the application'); 
     
    227227    { 
    228228        $application = new Application(); 
    229         $application->addCommand(new \FooCommand); 
     229        $application->add(new \FooCommand); 
    230230        $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/application_asxml1.txt', $application->asXml(), '->asXml() returns an XML representation of the application'); 
    231231        $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/application_asxml2.txt', $application->asXml('foo'), '->asXml() returns an XML representation of the application'); 
     
    253253        $application->setAutoExit(false); 
    254254        $application->setCatchExceptions(false); 
    255         $application->addCommand($command = new \Foo1Command()); 
     255        $application->add($command = new \Foo1Command()); 
    256256        $_SERVER['argv'] = array('cli.php', 'foo:bar1'); 
    257257 
     
    329329        $application->setAutoExit(false); 
    330330        $application->setCatchExceptions(false); 
    331         $application->addCommand(new \FooCommand()); 
     331        $application->add(new \FooCommand()); 
    332332        $tester = new ApplicationTester($application); 
    333333        $tester->run(array('command' => 'foo:bar', '--no-interaction' => true)); 
  • branches/2.0/tests/Symfony/Tests/Component/Console/Command/HelpCommandTest.php

    r30721 r31539  
    3131 
    3232        $application = new Application(); 
    33         $commandTester = new CommandTester($application->getCommand('help')); 
     33        $commandTester = new CommandTester($application->get('help')); 
    3434        $commandTester->execute(array('command_name' => 'list')); 
    3535        $this->assertRegExp('/list \[--xml\] \[namespace\]/', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); 
  • branches/2.0/tests/Symfony/Tests/Component/Console/Command/ListCommandTest.php

    r30721 r31539  
    2020        $application = new Application(); 
    2121 
    22         $commandTester = new CommandTester($command = $application->getCommand('list')); 
     22        $commandTester = new CommandTester($command = $application->get('list')); 
    2323        $commandTester->execute(array('command' => $command->getFullName())); 
    2424        $this->assertRegExp('/help   Displays help for a command/', $commandTester->getDisplay(), '->execute() returns a list of available commands'); 
  • branches/2.0/tests/Symfony/Tests/Component/DependencyInjection/Fixtures/php/services9.php

    r31486 r31539  
    8282    { 
    8383        $class = $this->getParameter('foo_class'); 
    84         $this->services['foo_bar'] = $instance = new $class(); 
    85  
    86         return $instance; 
     84        return $this->services['foo_bar'] = new $class(); 
    8785    } 
    8886 
     
    122120    protected function getFactoryServiceService() 
    123121    { 
    124         $this->services['factory_service'] = $instance = $this->get('foo.baz')->getInstance(); 
    125  
    126         return $instance; 
     122        return $this->services['factory_service'] = $this->get('foo.baz')->getInstance(); 
    127123    } 
    128124 
  • branches/2.0/tests/Symfony/Tests/Component/DomCrawler/FormTest.php

    r30885 r31539  
    6161    { 
    6262        $form = $this->createForm('<form>'.$form.'</form>'); 
    63         $this->assertEquals($values, array_map(function ($field) { return array(get_class($field), $field->getValue()); }, $form->getFields()), '->getDefaultValues() '.$message); 
     63        $this->assertEquals($values, array_map(function ($field) { return array(get_class($field), $field->getValue()); }, $form->all()), '->getDefaultValues() '.$message); 
    6464    } 
    6565 
     
    337337    } 
    338338 
    339     public function testHasField() 
     339    public function testHas() 
    340340    { 
    341341        $form = $this->createForm('<form method="post"><input type="text" name="bar" value="bar" /><input type="submit" /></form>'); 
    342342 
    343         $this->assertFalse($form->hasField('foo'), '->hasField() returns false if a field is not in the form'); 
    344         $this->assertTrue($form->hasField('bar'), '->hasField() returns true if a field is in the form'); 
    345     } 
    346  
    347     public function testGetField() 
     343        $this->assertFalse($form->has('foo'), '->has() returns false if a field is not in the form'); 
     344        $this->assertTrue($form->has('bar'), '->has() returns true if a field is in the form'); 
     345    } 
     346 
     347    public function testGet() 
    348348    { 
    349349        $form = $this->createForm('<form method="post"><input type="text" name="bar" value="bar" /><input type="submit" /></form>'); 
    350350 
    351         $this->assertEquals('Symfony\\Component\\DomCrawler\\Field\\InputFormField', get_class($form->getField('bar')), '->getField() returns the field object associated with the given name'); 
    352  
    353         try { 
    354             $form->getField('foo'); 
    355             $this->fail('->getField() throws an \InvalidArgumentException if the field does not exist'); 
     351        $this->assertEquals('Symfony\\Component\\DomCrawler\\Field\\InputFormField', get_class($form->get('bar')), '->get() returns the field object associated with the given name'); 
     352 
     353        try { 
     354            $form->get('foo'); 
     355            $this->fail('->get() throws an \InvalidArgumentException if the field does not exist'); 
    356356        } catch (\InvalidArgumentException $e) { 
    357             $this->assertTrue(true, '->getField() throws an \InvalidArgumentException if the field does not exist'); 
    358         } 
    359     } 
    360  
    361     public function testGetFields() 
     357            $this->assertTrue(true, '->get() throws an \InvalidArgumentException if the field does not exist'); 
     358        } 
     359    } 
     360 
     361    public function testAll() 
    362362    { 
    363363        $form = $this->createForm('<form method="post"><input type="text" name="bar" value="bar" /><input type="submit" /></form>'); 
    364364 
    365         $fields = $form->getFields(); 
    366         $this->assertEquals(1, count($fields), '->getFields() return an array of form field objects'); 
    367         $this->assertEquals('Symfony\\Component\\DomCrawler\\Field\\InputFormField', get_class($fields['bar']), '->getFields() return an array of form field objects'); 
     365        $fields = $form->all(); 
     366        $this->assertEquals(1, count($fields), '->all() return an array of form field objects'); 
     367        $this->assertEquals('Symfony\\Component\\DomCrawler\\Field\\InputFormField', get_class($fields['bar']), '->all() return an array of form field objects'); 
    368368    } 
    369369 
  • branches/2.0/tests/Symfony/Tests/Component/EventDispatcher/EventTest.php

    r31147 r31539  
    3333        $event = $this->createEvent(); 
    3434 
    35         $this->assertEquals($this->parameters, $event->getParameters(), '->getParameters() returns the event parameters'); 
    36         $this->assertEquals('bar', $event->getParameter('foo'), '->getParameter() returns the value of a parameter'); 
    37         $event->setParameter('foo', 'foo'); 
    38         $this->assertEquals('foo', $event->getParameter('foo'), '->setParameter() changes the value of a parameter'); 
    39         $this->assertTrue($event->hasParameter('foo'), '->hasParameter() returns true if the parameter is defined'); 
    40         $this->assertFalse($event->hasParameter('oof'), '->hasParameter() returns false if the parameter is not defined'); 
     35        $this->assertEquals($this->parameters, $event->all(), '->all() returns the event parameters'); 
     36        $this->assertEquals('bar', $event->get('foo'), '->get() returns the value of a parameter'); 
     37        $event->set('foo', 'foo'); 
     38        $this->assertEquals('foo', $event->get('foo'), '->set() changes the value of a parameter'); 
     39        $this->assertTrue($event->has('foo'), '->has() returns true if the parameter is defined'); 
     40        $this->assertFalse($event->has('oof'), '->has() returns false if the parameter is not defined'); 
    4141 
    4242        try { 
    43             $event->getParameter('foobar'); 
    44             $this->fail('->getParameter() throws an \InvalidArgumentException exception when the parameter does not exist'); 
     43            $event->get('foobar'); 
     44            $this->fail('->get() throws an \InvalidArgumentException exception when the parameter does not exist'); 
    4545        } catch (\Exception $e) { 
    46             $this->assertInstanceOf('\InvalidArgumentException', $e, '->getParameter() throws an \InvalidArgumentException exception when the parameter does not exist'); 
    47             $this->assertEquals('The event "name" has no "foobar" parameter.', $e->getMessage(), '->getParameter() throws an \InvalidArgumentException exception when the parameter does not exist'); 
     46            $this->assertInstanceOf('\InvalidArgumentException', $e, '->get() throws an \InvalidArgumentException exception when the parameter does not exist'); 
     47            $this->assertEquals('The event "name" has no "foobar" parameter.', $e->getMessage(), '->get() throws an \InvalidArgumentException exception when the parameter does not exist'); 
    4848        } 
    4949        $event = new Event($this->subject, 'name', $this->parameters); 
  • branches/2.0/tests/Symfony/Tests/Component/Form/FormTest.php

    r31403 r31539  
    77 
    88use Symfony\Component\Form\Form; 
     9use Symfony\Component\Form\FormConfiguration; 
    910use Symfony\Component\Form\Field; 
    1011use Symfony\Component\Form\HiddenField; 
     
    5960    protected function setUp() 
    6061    { 
    61         Form::disableDefaultCsrfProtection(); 
    62         Form::setDefaultCsrfSecret(null); 
     62        FormConfiguration::disableDefaultCsrfProtection(); 
     63        FormConfiguration::setDefaultCsrfSecret(null); 
    6364        $this->validator = $this->createMockValidator(); 
    6465        $this->form = new Form('author', new Author(), $this->validator); 
     
    9798    public function testDefaultCsrfProtectionCanBeEnabled() 
    9899    { 
    99         Form::enableDefaultCsrfProtection(); 
     100        FormConfiguration::enableDefaultCsrfProtection(); 
    100101        $form = new Form('author', new Author(), $this->validator); 
    101102 
     
    113114    public function testDefaultCsrfSecretCanBeSet() 
    114115    { 
    115         Form::setDefaultCsrfSecret('foobar'); 
     116        FormConfiguration::setDefaultCsrfSecret('foobar'); 
    116117        $form = new Form('author', new Author(), $this->validator); 
    117118        $form->enableCsrfProtection(); 
     
    122123    public function testDefaultCsrfFieldNameCanBeSet() 
    123124    { 
    124         Form::setDefaultCsrfFieldName('foobar'); 
     125        FormConfiguration::setDefaultCsrfFieldName('foobar'); 
    125126        $form = new Form('author', new Author(), $this->validator); 
    126127        $form->enableCsrfProtection(); 
     
    173174    public function testDefaultLocaleCanBeSet() 
    174175    { 
    175         Form::setDefaultLocale('de-DE-1996'); 
     176        FormConfiguration::setDefaultLocale('de-DE-1996'); 
    176177        $form = new Form('author', new Author(), $this->validator); 
    177178 
  • branches/2.0/tests/Symfony/Tests/Component/HttpKernel/BaseHttpKernelTest.php

    r31371 r31539  
    4545        $dispatcher->connect('core.exception', function ($event) 
    4646        { 
    47             $event->setReturnValue(new Response($event->getParameter('exception')->getMessage())); 
     47            $event->setReturnValue(new Response($event->get('exception')->getMessage())); 
    4848 
    4949            return true; 
  • branches/2.0/tests/Symfony/Tests/Component/HttpKernel/Cache/CacheTest.php

    r31463 r31539  
    770770                $response->setStatusCode(303); 
    771771                $response->headers->set('Location', '/'); 
    772                 $response->headers->delete('Cache-Control'); 
     772                $response->headers->remove('Cache-Control'); 
    773773                $response->setContent(''); 
    774774            } 
  • branches/2.0/tests/Symfony/Tests/Component/Routing/Loader/ClosureLoaderTest.php

    r30721 r31539  
    4141            $routes = new RouteCollection(); 
    4242 
    43             $routes->addRoute('foo', $route); 
     43            $routes->add('foo', $route); 
    4444 
    4545            return $routes; 
    4646        }); 
    4747 
    48         $this->assertEquals($route, $routes->getRoute('foo'), '->load() loads a \Closure resource'); 
     48        $this->assertEquals($route, $routes->get('foo'), '->load() loads a \Closure resource'); 
    4949    } 
    5050} 
  • branches/2.0/tests/Symfony/Tests/Component/Routing/Loader/DelegatingLoaderTest.php

    r30721 r31539  
    7272            $routes = new RouteCollection(); 
    7373 
    74             $routes->addRoute('foo', $route); 
     74            $routes->add('foo', $route); 
    7575 
    7676            return $routes; 
    7777        }); 
    7878 
    79         $this->assertSame($route, $routes->getRoute('foo'), '->load() loads a resource using the loaders from the resolver'); 
     79        $this->assertSame($route, $routes->get('foo'), '->load() loads a resource using the loaders from the resolver'); 
    8080 
    8181        try { 
  • branches/2.0/tests/Symfony/Tests/Component/Routing/Matcher/UrlMatcherTest.php

    r30721 r31539  
    2121    { 
    2222        $collection = new RouteCollection(); 
    23         $collection->addRoute('foo', new Route('/:foo')); 
     23        $collection->add('foo', new Route('/:foo')); 
    2424 
    2525        $matcher = new UrlMatcherForTests($collection, array(), array()); 
  • branches/2.0/tests/Symfony/Tests/Component/Routing/RouteCollectionTest.php

    r31229 r31539  
    2222        $collection = new RouteCollection(); 
    2323        $route = new Route('/foo'); 
    24         $collection->addRoute('foo', $route); 
    25         $this->assertEquals(array('foo' => $route), $collection->getRoutes(), '->addRoute() adds a route'); 
    26         $this->assertEquals($route, $collection->getRoute('foo'), '->getRoute() returns a route by name'); 
    27         $this->assertNull($collection->getRoute('bar'), '->getRoute() returns null if a route does not exist'); 
     24        $collection->add('foo', $route); 
     25        $this->assertEquals(array('foo' => $route), $collection->all(), '->add() adds a route'); 
     26        $this->assertEquals($route, $collection->get('foo'), '->get() returns a route by name'); 
     27        $this->assertNull($collection->get('bar'), '->get() returns null if a route does not exist'); 
    2828    } 
    2929 
    3030    /** 
    31      * @covers Symfony\Component\Routing\RouteCollection::addRoute 
     31     * @covers Symfony\Component\Routing\RouteCollection::add 
    3232     * @expectedException InvalidArgumentException 
    3333     */ 
     
    3636        $collection = new RouteCollection(); 
    3737        $route = new Route('/foo'); 
    38         $collection->addRoute('f o o', $route); 
     38        $collection->add('f o o', $route); 
    3939    } 
    4040 
     
    4242    { 
    4343        $collection = new RouteCollection(); 
    44         $collection->addRoute('foo', $foo = new Route('/foo')); 
     44        $collection->add('foo', $foo = new Route('/foo')); 
    4545        $collection1 = new RouteCollection(); 
    46         $collection1->addRoute('foo', $foo1 = new Route('/foo1')); 
    47         $collection1->addRoute('bar', $bar1 = new Route('/bar1')); 
     46        $collection1->add('foo', $foo1 = new Route('/foo1')); 
     47        $collection1->add('bar', $bar1 = new Route('/bar1')); 
    4848        $collection->addCollection($collection1); 
    49         $this->assertEquals(array('foo' => $foo1, 'bar' => $bar1), $collection->getRoutes(), '->addCollection() adds routes from another collection'); 
     49        $this->assertEquals(array('foo' => $foo1, 'bar' => $bar1), $collection->all(), '->addCollection() adds routes from another collection'); 
    5050 
    5151        $collection = new RouteCollection(); 
    52         $collection->addRoute('foo', $foo = new Route('/foo')); 
     52        $collection->add('foo', $foo = new Route('/foo')); 
    5353        $collection1 = new RouteCollection(); 
    54         $collection1->addRoute('foo', $foo1 = new Route('/foo1')); 
     54        $collection1->add('foo', $foo1 = new Route('/foo1')); 
    5555        $collection->addCollection($collection1, '/foo'); 
    56         $this->assertEquals('/foo/foo1', $collection->getRoute('foo')->getPattern(), '->addCollection() can add a prefix to all merged routes'); 
     56        $this->assertEquals('/foo/foo1', $collection->get('foo')->getPattern(), '->addCollection() can add a prefix to all merged routes'); 
    5757 
    5858        $collection = new RouteCollection(); 
     
    6767    { 
    6868        $collection = new RouteCollection(); 
    69         $collection->addRoute('foo', $foo = new Route('/foo')); 
    70         $collection->addRoute('bar', $bar = new Route('/bar')); 
     69        $collection->add('foo', $foo = new Route('/foo')); 
     70        $collection->add('bar', $bar = new Route('/bar')); 
    7171        $collection->addPrefix('/admin'); 
    72         $this->assertEquals('/admin/foo', $collection->getRoute('foo')->getPattern(), '->addPrefix() adds a prefix to all routes'); 
    73         $this->assertEquals('/admin/bar', $collection->getRoute('bar')->getPattern(), '->addPrefix() adds a prefix to all routes'); 
     72        $this->assertEquals('/admin/foo', $collection->get('foo')->getPattern(), '->addPrefix() adds a prefix to all routes'); 
     73        $this->assertEquals('/admin/bar', $collection->get('bar')->getPattern(), '->addPrefix() adds a prefix to all routes'); 
    7474    } 
    7575 
  • branches/2.0/tests/Symfony/Tests/Component/Security/Authentication/AuthenticationProviderManagerTest.php

    r31317 r31539  
    2222    { 
    2323        $manager = new AuthenticationProviderManager(); 
    24         $manager->addProvider($provider = $this->getMock('Symfony\Component\Security\Authentication\Provider\AuthenticationProviderInterface')); 
    25         $this->assertSame(array($provider), $manager->getProviders()); 
     24        $manager->add($provider = $this->getMock('Symfony\Component\Security\Authentication\Provider\AuthenticationProviderInterface')); 
     25        $this->assertSame(array($provider), $manager->all()); 
    2626 
    2727        $manager->setProviders($providers = array($this->getMock('Symfony\Component\Security\Authentication\Provider\AuthenticationProviderInterface'))); 
    28         $this->assertSame($providers, $manager->getProviders()); 
     28        $this->assertSame($providers, $manager->all()); 
    2929    } 
    3030 
  • branches/2.0/tests/Symfony/Tests/Component/Translation/Loader/PhpFileLoaderTest.php

    r31317 r31539  
    2323        $catalogue = $loader->load($resource, 'en', 'domain1'); 
    2424 
    25         $this->assertEquals(array('foo' => 'bar'), $catalogue->getMessages('domain1')); 
     25        $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); 
    2626        $this->assertEquals('en', $catalogue->getLocale()); 
    2727        $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); 
  • branches/2.0/tests/Symfony/Tests/Component/Translation/Loader/XliffFileLoaderTest.php

    r31317 r31539  
    2323        $catalogue = $loader->load($resource, 'en', 'domain1'); 
    2424 
    25         $this->assertEquals(array('foo' => 'bar'), $catalogue->getMessages('domain1')); 
     25        $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); 
    2626        $this->assertEquals('en', $catalogue->getLocale()); 
    2727        $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); 
  • branches/2.0/tests/Symfony/Tests/Component/Translation/Loader/YamlFileLoaderTest.php

    r31403 r31539  
    2323        $catalogue = $loader->load($resource, 'en', 'domain1'); 
    2424 
    25         $this->assertEquals(array('foo' => 'bar'), $catalogue->getMessages('domain1')); 
     25        $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); 
    2626        $this->assertEquals('en', $catalogue->getLocale()); 
    2727        $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); 
  • branches/2.0/tests/Symfony/Tests/Component/Translation/MessageCatalogTest.php

    r31317 r31539  
    3030    } 
    3131 
    32     public function testGetMessages() 
     32    public function testAll() 
    3333    { 
    3434        $catalogue = new MessageCatalogue('en', $messages = array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); 
    3535 
    36         $this->assertEquals(array('foo' => 'foo'), $catalogue->getMessages('domain1')); 
    37         $this->assertEquals(array(), $catalogue->getMessages('domain88')); 
    38         $this->assertEquals($messages, $catalogue->getMessages()); 
     36        $this->assertEquals(array('foo' => 'foo'), $catalogue->all('domain1')); 
     37        $this->assertEquals(array(), $catalogue->all('domain88')); 
     38        $this->assertEquals($messages, $catalogue->all()); 
    3939    } 
    4040 
    41     public function testHasMessage() 
     41    public function testHas() 
    4242    { 
    4343        $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); 
    4444 
    45         $this->assertTrue($catalogue->hasMessage('foo', 'domain1')); 
    46         $this->assertFalse($catalogue->hasMessage('bar', 'domain1')); 
    47         $this->assertFalse($catalogue->hasMessage('foo', 'domain88')); 
     45        $this->assertTrue($catalogue->has('foo', 'domain1')); 
     46        $this->assertFalse($catalogue->has('bar', 'domain1')); 
     47        $this->assertFalse($catalogue->has('foo', 'domain88')); 
    4848    } 
    4949 
    50     public function testGetSetMessage() 
     50    public function testGetSet() 
    5151    { 
    5252        $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); 
    53         $catalogue->setMessage('foo1', 'foo1', 'domain1'); 
     53        $catalogue->set('foo1', 'foo1', 'domain1'); 
    5454 
    55         $this->assertEquals('foo', $catalogue->getMessage('foo', 'domain1')); 
    56         $this->assertEquals('foo1', $catalogue->getMessage('foo1', 'domain1')); 
     55        $this->assertEquals('foo', $catalogue->get('foo', 'domain1')); 
     56        $this->assertEquals('foo1', $catalogue->get('foo1', 'domain1')); 
    5757    } 
    5858 
    59     public function testAddMessages() 
     59    public function testAdd() 
    6060    { 
    6161        $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); 
    62         $catalogue->addMessages(array('foo1' => 'foo1'), 'domain1'); 
     62        $catalogue->add(array('foo1' => 'foo1'), 'domain1'); 
    6363 
    64         $this->assertEquals('foo', $catalogue->getMessage('foo', 'domain1')); 
    65         $this->assertEquals('foo1', $catalogue->getMessage('foo1', 'domain1')); 
     64        $this->assertEquals('foo', $catalogue->get('foo', 'domain1')); 
     65        $this->assertEquals('foo1', $catalogue->get('foo1', 'domain1')); 
    6666 
    67         $catalogue->addMessages(array('foo' => 'bar'), 'domain1'); 
    68         $this->assertEquals('bar', $catalogue->getMessage('foo', 'domain1')); 
    69         $this->assertEquals('foo1', $catalogue->getMessage('foo1', 'domain1')); 
     67        $catalogue->add(array('foo' => 'bar'), 'domain1'); 
     68        $this->assertEquals('bar', $catalogue->get('foo', 'domain1')); 
     69        $this->assertEquals('foo1', $catalogue->get('foo1', 'domain1')); 
    7070 
    71         $catalogue->addMessages(array('foo' => 'bar'), 'domain88'); 
    72         $this->assertEquals('bar', $catalogue->getMessage('foo', 'domain88')); 
     71        $catalogue->add(array('foo' => 'bar'), 'domain88'); 
     72        $this->assertEquals('bar', $catalogue->get('foo', 'domain88')); 
    7373    } 
    7474 
    75     public function testSetMessages() 
     75    public function testReplace() 
    7676    { 
    7777        $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); 
    78         $catalogue->setMessages($messages = array('foo1' => 'foo1'), 'domain1'); 
     78        $catalogue->replace($messages = array('foo1' => 'foo1'), 'domain1'); 
    7979 
    80         $this->assertEquals($messages, $catalogue->getMessages('domain1')); 
     80        $this->assertEquals($messages, $catalogue->all('domain1')); 
    8181    } 
    8282 
     
    9797        $catalogue->addCatalogue($catalogue1); 
    9898 
    99         $this->assertEquals('foo', $catalogue->getMessage('foo', 'domain1')); 
    100         $this->assertEquals('foo1', $catalogue->getMessage('foo1', 'domain1')); 
     99        $this->assertEquals('foo', $catalogue->get('foo', 'domain1')); 
     100        $this->assertEquals('foo1', $catalogue->get('foo1', 'domain1')); 
    101101 
    102102        $this->assertEquals(array($r, $r1), $catalogue->getResources()); 
     
    119119        $catalogue->addFallbackCatalogue($catalogue1); 
    120120 
    121         $this->assertEquals('foo', $catalogue->getMessage('foo', 'domain1')); 
    122         $this->assertEquals('foo1', $catalogue->getMessage('foo1', 'domain1')); 
     121        $this->assertEquals('foo', $catalogue->get('foo', 'domain1')); 
     122        $this->assertEquals('foo1', $catalogue->get('foo1', 'domain1')); 
    123123 
    124124        $this->assertEquals(array($r, $r1), $catalogue->getResources());