all() public méthode

Gets the service container parameters.
public all ( ) : array
Résultat array An array of parameters
Exemple #1
0
 public function testRemove()
 {
     $bag = new ParameterBag(array('foo' => 'foo', 'bar' => 'bar'));
     $bag->remove('foo');
     $this->assertEquals(array('bar' => 'bar'), $bag->all(), '->remove() removes a parameter');
     $bag->remove('BAR');
     $this->assertEquals(array(), $bag->all(), '->remove() converts key to lowercase before removing');
 }
Exemple #2
0
 /**
  * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::clear
  */
 public function testClear()
 {
     $bag = new ParameterBag($parameters = array(
         'foo' => 'foo',
         'bar' => 'bar',
     ));
     $bag->clear();
     $this->assertEquals(array(), $bag->all(), '->clear() removes all parameters');
 }
Exemple #3
0
 /**
  * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::remove
  */
 public function testRemove()
 {
     $bag = new ParameterBag(array('foo' => 'foo', 'bar' => 'bar'));
     $bag->remove('foo');
     $this->assertEquals(array('bar' => 'bar'), $bag->all(), '->remove() removes a parameter');
 }
Exemple #4
0
 /**
  * Return all parameters.
  *
  * @return array
  */
 public function getParameters()
 {
     return $this->parameters->all();
 }