merged 2.0

This commit is contained in:
Fabien Potencier 2011-12-13 16:12:53 +01:00
commit 142cef21bb
147 changed files with 759 additions and 244 deletions

View File

@ -88,6 +88,15 @@ class EntityChoiceList extends ArrayChoiceList
*/
private $groupBy;
/**
* Constructor.
*
* @param EntityManager $em An EntityManager instance
* @param string $class The class name
* @param string $property The property name
* @param QueryBuilder|\Closure $queryBuilder An optional query builder
* @param array|\Closure $choices An array of choices or a function returning an array
*/
public function __construct(EntityManager $em, $class, $property = null, $queryBuilder = null, $choices = array(), $groupBy = null)
{
// If a query builder was passed, it must be a closure or QueryBuilder
@ -121,7 +130,7 @@ class EntityChoiceList extends ArrayChoiceList
}
/**
* Initializes the choices and returns them
* Initializes the choices and returns them.
*
* If the entities were passed in the "choices" option, this method
* does not have any significant overhead. Otherwise, if a query builder
@ -180,7 +189,7 @@ class EntityChoiceList extends ArrayChoiceList
}
/**
* Convert entities into choices with support for groups
* Converts entities into choices with support for groups.
*
* The choices are generated from the entities. If the entities have a
* composite identifier, the choices are indexed using ascending integers.
@ -190,6 +199,8 @@ class EntityChoiceList extends ArrayChoiceList
* is used as option values. Otherwise this method tries to convert
* objects to strings using __toString().
*
* @param array $entities An array of entities
* @param string $group A group name
*/
private function loadEntities($entities, $group = null)
{
@ -234,13 +245,18 @@ class EntityChoiceList extends ArrayChoiceList
}
}
/**
* Returns the fields of which the identifier of the underlying class consists.
*
* @return array
*/
public function getIdentifier()
{
return $this->identifier;
}
/**
* Returns the according entities for the choices
* Returns the according entities for the choices.
*
* If the choices were not initialized, they are initialized now. This
* is an expensive operation, except if the entities were passed in the
@ -258,7 +274,7 @@ class EntityChoiceList extends ArrayChoiceList
}
/**
* Returns the entity for the given key
* Returns the entity for the given key.
*
* If the underlying entities have composite identifiers, the choices
* are initialized. The key is expected to be the index in the choices
@ -267,10 +283,11 @@ class EntityChoiceList extends ArrayChoiceList
* If they have single identifiers, they are either fetched from the
* internal entity cache (if filled) or loaded from the database.
*
* @param string $key The choice key (for entities with composite
* identifiers) or entity ID (for entities with single
* identifiers)
* @return object The matching entity
* @param string $key The choice key (for entities with composite
* identifiers) or entity ID (for entities with single
* identifiers)
*
* @return object The matching entity
*/
public function getEntity($key)
{
@ -301,11 +318,11 @@ class EntityChoiceList extends ArrayChoiceList
}
/**
* Returns the \ReflectionProperty instance for a property of the
* underlying class
* Returns the \ReflectionProperty instance for a property of the underlying class.
*
* @param string $property The name of the property
* @return \ReflectionProperty The reflection instance
* @param string $property The name of the property
*
* @return \ReflectionProperty The reflection instance
*/
private function getReflProperty($property)
{
@ -318,15 +335,17 @@ class EntityChoiceList extends ArrayChoiceList
}
/**
* Returns the values of the identifier fields of an entity
* Returns the values of the identifier fields of an entity.
*
* Doctrine must know about this entity, that is, the entity must already
* be persisted or added to the identity map before. Otherwise an
* exception is thrown.
*
* @param object $entity The entity for which to get the identifier
* @throws FormException If the entity does not exist in Doctrine's
* identity map
* @param object $entity The entity for which to get the identifier
*
* @return array The identifier values
*
* @throws FormException If the entity does not exist in Doctrine's identity map
*/
public function getIdentifierValues($entity)
{

View File

@ -28,10 +28,10 @@ class EntitiesToArrayTransformer implements DataTransformerInterface
}
/**
* Transforms entities into choice keys
* Transforms entities into choice keys.
*
* @param Collection|object $collection A collection of entities, a single entity or NULL
*
* @param Collection|object $collection A collection of entities, a single entity or
* NULL
* @return mixed An array of choice keys, a single key or NULL
*/
public function transform($collection)
@ -66,11 +66,11 @@ class EntitiesToArrayTransformer implements DataTransformerInterface
}
/**
* Transforms choice keys into entities
* Transforms choice keys into entities.
*
* @param mixed $keys An array of keys, a single key or NULL
* @return Collection|object A collection of entities, a single entity
* or NULL
* @param mixed $keys An array of keys, a single key or NULL
*
* @return Collection|object A collection of entities, a single entity or NULL
*/
public function reverseTransform($keys)
{

View File

@ -27,10 +27,10 @@ class EntityToIdTransformer implements DataTransformerInterface
}
/**
* Transforms entities into choice keys
* Transforms entities into choice keys.
*
* @param Collection|object $entity A collection of entities, a single entity or NULL
*
* @param Collection|object $entity A collection of entities, a single entity or
* NULL
* @return mixed An array of choice keys, a single key or NULL
*/
public function transform($entity)
@ -58,11 +58,11 @@ class EntityToIdTransformer implements DataTransformerInterface
}
/**
* Transforms choice keys into entities
* Transforms choice keys into entities.
*
* @param mixed $key An array of keys, a single key or NULL
* @return Collection|object A collection of entities, a single entity
* or NULL
*
* @return Collection|object A collection of entities, a single entity or NULL
*/
public function reverseTransform($key)
{

View File

@ -20,8 +20,9 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
*
* This works with ORM, MongoDB and CouchDB instances of the collection interface.
*
* @see Doctrine\Common\Collections\Collection
* @author Bernhard Schussek <bernhard.schussek@symfony-project.com>
*
* @see Doctrine\Common\Collections\Collection
*/
class MergeCollectionListener implements EventSubscriberInterface
{

View File

@ -75,7 +75,6 @@ class EntityUserProvider implements UserProviderInterface
if (!$user instanceof $this->class) {
throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', get_class($user)));
}
// The user must be reloaded via the primary key as all other data
// might have changed without proper persistence in the database.
@ -89,7 +88,11 @@ class EntityUserProvider implements UserProviderInterface
);
}
return $this->repository->find($id);
if (null === $refreshedUser = $this->repository->find($id)) {
throw new UsernameNotFoundException(sprintf('User with id %s not found', json_encode($id)));
}
return $refreshedUser;
}
/**

View File

@ -40,6 +40,7 @@ class UniqueEntityValidator extends ConstraintValidator
/**
* @param object $entity
* @param Constraint $constraint
*
* @return bool
*/
public function isValid($entity, Constraint $constraint)

View File

@ -44,7 +44,7 @@ class FirePHPHandler extends BaseFirePHPHandler
if (!preg_match('{\bFirePHP/\d+\.\d+\b}', $event->getRequest()->headers->get('User-Agent'))
&& !$event->getRequest()->headers->has('X-FirePHP-Version')) {
$this->sendHeaders = false;
$this->headers = array();

View File

@ -12,8 +12,6 @@
namespace Symfony\Bridge\Twig\Node;
/**
*
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class FormThemeNode extends \Twig_Node

View File

@ -12,8 +12,6 @@
namespace Symfony\Bridge\Twig\Node;
/**
*
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class TransNode extends \Twig_Node

View File

@ -14,7 +14,7 @@ namespace Symfony\Bridge\Twig\TokenParser;
use Symfony\Bridge\Twig\Node\FormThemeNode;
/**
*
* Token Parser for the 'form_theme' tag.
*
* @author Fabien Potencier <fabien@symfony.com>
*/

View File

@ -14,7 +14,7 @@ namespace Symfony\Bridge\Twig\TokenParser;
use Symfony\Bridge\Twig\Node\TransNode;
/**
*
* Token Parser for the 'transchoice' tag.
*
* @author Fabien Potencier <fabien@symfony.com>
*/

View File

@ -14,7 +14,7 @@ namespace Symfony\Bridge\Twig\TokenParser;
use Symfony\Bridge\Twig\Node\TransNode;
/**
*
* Token Parser for the 'trans' tag.
*
* @author Fabien Potencier <fabien@symfony.com>
*/

View File

@ -288,8 +288,9 @@ class DoctrineExtension extends AbstractDoctrineExtension
* In the case of bundles everything is really optional (which leads to autodetection for this bundle) but
* in the mappings key everything except alias is a required argument.
*
* @param array $entityManager A configured ORM entity manager.
* @param ContainerBuilder $container A ContainerBuilder instance
* @param array $entityManager A configured ORM entity manager
* @param Definition $ormConfigDef A Definition instance
* @param ContainerBuilder $container A ContainerBuilder instance
*/
protected function loadOrmEntityManagerMappingInformation(array $entityManager, Definition $ormConfigDef, ContainerBuilder $container)
{

View File

@ -12,8 +12,6 @@
namespace Symfony\Bundle\DoctrineBundle\Mapping;
/**
*
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class ClassMetadataCollection

View File

@ -12,8 +12,6 @@
namespace Symfony\Bundle\DoctrineBundle\Mapping;
/**
*
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class DisconnectedMetadataFactory extends MetadataFactory

View File

@ -28,7 +28,6 @@ class XMLSchemaTest extends \PHPUnit_Framework_TestCase
/**
* @dataProvider dataValidateSchemaFiles
* @param string $file
*/
public function testValidateSchema($file)
{

View File

@ -105,7 +105,7 @@ EOF
$content = preg_replace($regex, '', $content);
// fix absolute paths to the cache directory
$content = preg_replace('/'.preg_quote($warmupDir,'/').'/', preg_replace('/_new$/', '', $warmupDir), $content);
$content = preg_replace('/'.preg_quote($warmupDir, '/').'/', preg_replace('/_new$/', '', $warmupDir), $content);
file_put_contents(preg_replace($regex, '', $file), $content);
unlink($file);

View File

@ -206,6 +206,7 @@ EOF
* Definition and Alias objects that those ids represent.
*
* @param string $serviceId The service id to resolve
*
* @return \Symfony\Component\DependencyInjection\Definition|\Symfony\Component\DependencyInjection\Alias
*/
private function resolveServiceDefinition($serviceId)

View File

@ -33,7 +33,7 @@ class Controller extends ContainerAware
/**
* Generates a URL from the given parameters.
*
* @param string $name The name of the route
* @param string $route The name of the route
* @param mixed $parameters An array of parameters
* @param Boolean $absolute Whether to generate an absolute URL
*

View File

@ -38,8 +38,6 @@ class ControllerNameParser
* Converts a short notation a:b:c to a class::method.
*
* @param string $controller A short notation controller (a:b:c)
*
* @param string A controller (class::method)
*/
public function parse($controller)
{

View File

@ -16,7 +16,7 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse;
/**
*
* Redirects a request to another URL.
*
* @author Fabien Potencier <fabien@symfony.com>
*/

View File

@ -19,6 +19,7 @@ use Symfony\Component\HttpFoundation\Response;
*/
/**
* Manages HTTP cache objects in a Container.
*
* @author Fabien Potencier <fabien@symfony.com>
*/

View File

@ -18,7 +18,7 @@ use Symfony\Component\Form\Exception\FormException;
use Symfony\Component\Form\Util\FormUtil;
/**
*
* FormHelper provides helpers to help display forms.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Bernhard Schussek <bernhard.schussek@symfony.com>
@ -68,8 +68,8 @@ class FormHelper extends Helper
*
* The theme format is "<Bundle>:<Controller>".
*
* @param FormView $view A FormView instance
* @param string|array $resources A theme or an array of theme
* @param FormView $view A FormView instance
* @param string|array $themes A theme or an array of theme
*/
public function setTheme(FormView $view, $themes)
{

View File

@ -78,7 +78,7 @@ class TemplateLocator implements FileLocatorInterface
try {
return $this->cache[$key] = $this->locator->locate($template->getPath(), $currentPath);
} catch (\InvalidArgumentException $e) {
throw new \InvalidArgumentException(sprintf('Unable to find template "%s" in "%s".', $template, $currentPath), 0, $e);
throw new \InvalidArgumentException(sprintf('Unable to find template "%s" : "%s".', $template, $e->getMessage()), 0, $e);
}
}
}

View File

@ -89,7 +89,7 @@ abstract class WebTestCase extends \PHPUnit_Framework_TestCase
{
$dir = null;
$reversedArgs = array_reverse($_SERVER['argv']);
foreach ($reversedArgs as $argIndex=>$testArg) {
foreach ($reversedArgs as $argIndex => $testArg) {
if ($testArg === '-c' || $testArg === '--configuration') {
$dir = realpath($reversedArgs[$argIndex - 1]);
break;

View File

@ -52,32 +52,32 @@ class FormHelperDivLayoutTest extends AbstractDivLayoutTest
protected function renderEnctype(FormView $view)
{
return (string)$this->helper->enctype($view);
return (string) $this->helper->enctype($view);
}
protected function renderLabel(FormView $view, $label = null, array $vars = array())
{
return (string)$this->helper->label($view, $label, $vars);
return (string) $this->helper->label($view, $label, $vars);
}
protected function renderErrors(FormView $view)
{
return (string)$this->helper->errors($view);
return (string) $this->helper->errors($view);
}
protected function renderWidget(FormView $view, array $vars = array())
{
return (string)$this->helper->widget($view, $vars);
return (string) $this->helper->widget($view, $vars);
}
protected function renderRow(FormView $view, array $vars = array())
{
return (string)$this->helper->row($view, $vars);
return (string) $this->helper->row($view, $vars);
}
protected function renderRest(FormView $view, array $vars = array())
{
return (string)$this->helper->rest($view, $vars);
return (string) $this->helper->rest($view, $vars);
}
protected function setTheme(FormView $view, array $themes)

View File

@ -55,32 +55,32 @@ class FormHelperTableLayoutTest extends AbstractTableLayoutTest
protected function renderEnctype(FormView $view)
{
return (string)$this->helper->enctype($view);
return (string) $this->helper->enctype($view);
}
protected function renderLabel(FormView $view, $label = null, array $vars = array())
{
return (string)$this->helper->label($view, $label, $vars);
return (string) $this->helper->label($view, $label, $vars);
}
protected function renderErrors(FormView $view)
{
return (string)$this->helper->errors($view);
return (string) $this->helper->errors($view);
}
protected function renderWidget(FormView $view, array $vars = array())
{
return (string)$this->helper->widget($view, $vars);
return (string) $this->helper->widget($view, $vars);
}
protected function renderRow(FormView $view, array $vars = array())
{
return (string)$this->helper->row($view, $vars);
return (string) $this->helper->row($view, $vars);
}
protected function renderRest(FormView $view, array $vars = array())
{
return (string)$this->helper->rest($view, $vars);
return (string) $this->helper->rest($view, $vars);
}
protected function setTheme(FormView $view, array $themes)

View File

@ -35,24 +35,32 @@ class TemplateLocatorTest extends TestCase
$this->assertEquals('/path/to/template', $locator->locate($template));
}
/**
* @expectedException \InvalidArgumentException
*/
public function testThrowsExceptionWhenTemplateNotFound()
{
$template = new TemplateReference('bundle', 'controller', 'name', 'format', 'engine');
$fileLocator = $this->getFileLocator();
$errorMessage = 'FileLocator exception message';
$fileLocator
->expects($this->once())
->method('locate')
->will($this->throwException(new \InvalidArgumentException()))
->will($this->throwException(new \InvalidArgumentException($errorMessage)))
;
$locator = new TemplateLocator($fileLocator);
$locator->locate($template);
try {
$locator->locate($template);
$this->fail('->locate() should throw an exception when the file is not found.');
} catch (\InvalidArgumentException $e) {
$this->assertContains(
$errorMessage,
$e->getMessage(),
'TemplateLocator exception should propagate the FileLocator exception message'
);
}
}
/**

View File

@ -31,7 +31,7 @@ class MonologExtension extends Extension
/**
* Loads the Monolog configuration.
*
* @param array $config An array of configuration settings
* @param array $configs An array of configuration settings
* @param ContainerBuilder $container A ContainerBuilder instance
*/
public function load(array $configs, ContainerBuilder $container)

View File

@ -483,6 +483,30 @@ class SecurityExtension extends Extension
return $name;
}
// Doctrine Entity DAO provider
if (isset($provider['entity'])) {
$container
->setDefinition($name, new DefinitionDecorator('security.user.provider.entity'))
->addArgument($provider['entity']['class'])
->addArgument($provider['entity']['property'])
;
return $name;
}
// In-memory DAO provider
$definition = $container->setDefinition($name, new DefinitionDecorator('security.user.provider.in_memory'));
foreach ($provider['users'] as $username => $user) {
$userId = $name.'_'.$username;
$container
->setDefinition($userId, new DefinitionDecorator('security.user.provider.in_memory.user'))
->setArguments(array($username, (string) $user['password'], $user['roles']))
;
$definition->addMethodCall('createUser', array(new Reference($userId)));
}
return $name;
}

View File

@ -14,6 +14,8 @@ namespace Symfony\Bundle\TwigBundle\Extension;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Twig extension for Symfony assets helper
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class AssetsExtension extends \Twig_Extension
@ -39,7 +41,7 @@ class AssetsExtension extends \Twig_Extension
}
/**
* Returns the public path of an asset
* Returns the public path of an asset.
*
* Absolute paths (i.e. http://...) are returned unmodified.
*
@ -54,9 +56,10 @@ class AssetsExtension extends \Twig_Extension
}
/**
* Returns the version of the assets in a package
* Returns the version of the assets in a package.
*
* @param string $packageName
*
* @return int
*/
public function getAssetsVersion($packageName = null)

View File

@ -14,6 +14,8 @@ namespace Symfony\Bundle\TwigBundle\Extension;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Twig extension for Symfony code helper
*
*
* @author Fabien Potencier <fabien@symfony.com>
*/
@ -24,7 +26,7 @@ class CodeExtension extends \Twig_Extension
/**
* Constructor of Twig Extension to provide functions for code formatting
*
* @param Symfony\Bundle\FrameworkBundle\Templating\Helper\CodeHelper $helper Helper to use
* @param ContainerInterface $container A ContainerInterface instance
*/
public function __construct(ContainerInterface $container)
{

View File

@ -33,6 +33,8 @@ class FilesystemLoader extends \Twig_Loader_Filesystem
*/
public function __construct(FileLocatorInterface $locator, TemplateNameParserInterface $parser)
{
parent::__construct(array());
$this->locator = $locator;
$this->parser = $parser;
$this->cache = array();

View File

@ -14,7 +14,7 @@ namespace Symfony\Bundle\TwigBundle\TokenParser;
use Symfony\Bundle\TwigBundle\Node\RenderNode;
/**
*
* Token Parser for the render tag.
*
* @author Fabien Potencier <fabien@symfony.com>
*/

View File

@ -217,6 +217,7 @@ class ProfilerController extends ContainerAware
* Search results.
*
* @param string $token The token
*
* @return Response A Response instance
*/
public function searchResultsAction($token)

View File

@ -15,7 +15,6 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Bundle\TwigBundle\TwigEngine;
use Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener;
/**
* WebDebugToolbarListener injects the Web Debug Toolbar.

View File

@ -20,8 +20,7 @@
{% endif %}
{% set icon %}
<img width="21" height="28" alt="Environment" style="border-width: 0; vertical-align: middle; margin-right: 5px;" src="data:image/png;base64,
iVBORw0KGgoAAAANSUhEUgAAABUAAAAcCAYAAACOGPReAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAZNJREFUeNpi/P//PwO1ARMDDcCooWDA4+npeRiEQWw0NTweHh4nQZhYORYoLf39+3cbGBuIbyJplPnx44cZjA3ENwjJwQzljoqKOghjo7lGBAcbBLiA+g7B2DBBRqCXj3/79s0CRSUX14lt27a5AplfgNgBCPaDxA8cOOAIokBe9fLy2o1LHxO6BAhAxWTwxIUMPn0seDTCvPotLi7uJIyNIxhQ9OEzVADoRZSgWbRo0UmoF1vx6GPBl06l8XhRmtzEL0KmHF5DWcmUo1E21dLSeo0uCBX7jUffb3z6GIGFdC2QYXPp0iVw4Ovp6T0FUkeA+BUw0c/AZiIwE2QAKTEc+laBktQqIL6al5e3FqqhDsQHYhU8Ln0CzVnY9D1hghYeD5E0PISKfcDjxQ949H2FJX5eJEkY+820adMm4/DiGzz6GFgIeBFX0DzBF/swQ/8oKCi8h7Gh9FeodzikpKSeQ8XuopW12PQxMEKraE0gDoSKrQfi60gaSZaDGQqqCiShks+h5Si8yiBVjnFkNyYAAgwAQGPBFLF65f4AAAAASUVORK5CYII="/>
<img width="21" height="28" alt="Environment" style="border-width: 0; vertical-align: middle; margin-right: 5px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAcCAYAAACOGPReAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAZNJREFUeNpi/P//PwO1ARMDDcCooWDA4+npeRiEQWw0NTweHh4nQZhYORYoLf39+3cbGBuIbyJplPnx44cZjA3ENwjJwQzljoqKOghjo7lGBAcbBLiA+g7B2DBBRqCXj3/79s0CRSUX14lt27a5AplfgNgBCPaDxA8cOOAIokBe9fLy2o1LHxO6BAhAxWTwxIUMPn0seDTCvPotLi7uJIyNIxhQ9OEzVADoRZSgWbRo0UmoF1vx6GPBl06l8XhRmtzEL0KmHF5DWcmUo1E21dLSeo0uCBX7jUffb3z6GIGFdC2QYXPp0iVw4Ovp6T0FUkeA+BUw0c/AZiIwE2QAKTEc+laBktQqIL6al5e3FqqhDsQHYhU8Ln0CzVnY9D1hghYeD5E0PISKfcDjxQ949H2FJX5eJEkY+820adMm4/DiGzz6GFgIeBFX0DzBF/swQ/8oKCi8h7Gh9FeodzikpKSeQ8XuopW12PQxMEKraE0gDoSKrQfi60gaSZaDGQqqCiShks+h5Si8yiBVjnFkNyYAAgwAQGPBFLF65f4AAAAASUVORK5CYII="/>
{% endset %}
{% set text %}
{% spaceless %}

View File

@ -1,7 +1,7 @@
{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %}
{% block head %}
<link href="{{ asset('bundles/framework/css/exception.css') }}" rel="stylesheet" type="text/css" media="screen" />
<link rel="stylesheet" href="{{ asset('bundles/framework/css/exception.css') }}" />
{{ parent() }}
{% endblock %}

View File

@ -77,15 +77,13 @@
<h2>Request Content</h2>
<p>
{% if collector.content == false %}
<em>Request content not available (it was retrieved as a resource).</em>
{% elseif collector.content %}
<pre>{{ collector.content }}</pre>
{% else %}
<em>No content</em>
{% endif %}
</p>
{% if collector.content == false %}
<p><em>Request content not available (it was retrieved as a resource).</em></p>
{% elseif collector.content %}
<pre>{{ collector.content }}</pre>
{% else %}
<p><em>No content</em></p>
{% endif %}
<h2>Request Server Parameters</h2>
@ -99,17 +97,21 @@
{% if collector.sessionattributes|length %}
<table>
<tr>
<th>Key</th>
<th>Value</th>
</tr>
{% set attributes = collector.sessionattributes %}
{% for key in attributes|keys|sort %}
<thead>
<tr>
<th>{{ key }}</th>
<td>{{ attributes[key]|yaml_dump }}</td>
<th scope="col">Key</th>
<th scope="col">Value</th>
</tr>
{% endfor %}
</thead>
<tbody>
{% set attributes = collector.sessionattributes %}
{% for key in attributes|keys|sort %}
<tr>
<th>{{ key }}</th>
<td>{{ attributes[key]|yaml_dump }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>

View File

@ -1,12 +1,16 @@
<table>
<thead>
<tr>
<th>Key</th>
<th>Value</th>
<th scope="col">Key</th>
<th scope="col">Value</th>
</tr>
</thead>
<tbody>
{% for key in bag.keys|sort %}
<tr>
<th>{{ key }}</th>
<td>{{ bag.get(key)|yaml_dump }}</td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@ -1,13 +1,13 @@
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="UTF-8" />
<meta name="robots" content="noindex,nofollow" />
<title>{% block title 'Profiler' %}</title>
<link rel="shortcut icon" type="image/x-icon" href="{{ asset('bundles/webprofiler/favicon.ico') }}" />
<link rel="icon" type="image/x-icon" sizes="16x16" href="{{ asset('bundles/webprofiler/favicon.ico') }}" />
{% block head %}
<link href="{{ asset('bundles/webprofiler/css/toolbar.css') }}" rel="stylesheet" type="text/css" media="screen" />
<link href="{{ asset('bundles/webprofiler/css/profiler.css') }}" rel="stylesheet" type="text/css" media="screen" />
<link rel="stylesheet" href="{{ asset('bundles/webprofiler/css/toolbar.css') }}" />
<link rel="stylesheet" href="{{ asset('bundles/webprofiler/css/profiler.css') }}" />
{% endblock %}
</head>
<body>

View File

@ -5,22 +5,25 @@
{% if tokens %}
<table>
<tr>
<th>Token</th>
<th>IP</th>
<th>Method</th>
<th>URL</th>
<th>Time</th>
</tr>
{% for elements in tokens %}
<thead>
<tr>
<td><a href="{{ path('_profiler', { 'token': elements.token }) }}">{{ elements.token }}</a></td>
<td>{{ elements.ip }}</td>
<td>{{ elements.method }}</td>
<td>{{ elements.url }}</td>
<td>{{ elements.time|date('r') }}</td>
<th scope="col">Token</th>
<th scope="col">IP</th>
<th scope="col">URL</th>
<th scope="col">Time</th>
</tr>
{% endfor %}
</thead>
<tbody>
{% for elements in tokens %}
<tr>
<td><a href="{{ path('_profiler', { 'token': elements.token }) }}">{{ elements.token }}</a></td>
<td>{{ elements.ip }}</td>
<td>{{ elements.method }}</td>
<td>{{ elements.url }}</td>
<td>{{ elements.time|date('r') }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>

View File

@ -73,7 +73,7 @@ class ExceptionControllerTest extends TestCase
$container->register('templating.helper.router', $this->getMockClass('Symfony\\Bundle\\FrameworkBundle\\Templating\\Helper\\RouterHelper'))
->addArgument(new Definition($this->getMockClass('Symfony\\Component\\Routing\\RouterInterface')));
$container->register('twig', 'Twig_Environment');
$container->register('templating.engine.twig',$this->getMockClass('Symfony\\Bundle\\TwigBundle\\TwigEngine'))
$container->register('templating.engine.twig', $this->getMockClass('Symfony\\Bundle\\TwigBundle\\TwigEngine'))
->addArgument($this->getMock('Twig_Environment'))
->addArgument($this->getMock('Symfony\\Component\\Templating\\TemplateNameParserInterface'))
->addArgument(new Definition($this->getMockClass('Symfony\Component\Config\FileLocatorInterface')))

View File

@ -124,6 +124,7 @@ abstract class Client
*
* @param string $key A key of the parameter to get
* @param string $default A default value when key is undefined
*
* @return string A value of the parameter
*/
public function getServerParameter($key, $default = '')
@ -347,9 +348,9 @@ abstract class Client
/**
* Creates a crawler.
*
* @param string $uri A uri
* @param string $uri A uri
* @param string $content Content for the crawler to use
* @param string $type Content type
* @param string $type Content type
*
* @return Crawler
*/
@ -432,6 +433,7 @@ abstract class Client
* Takes a URI and converts it to absolute if it is not already absolute.
*
* @param string $uri A uri
*
* @return string An absolute uri
*/
protected function getAbsoluteUri($uri)

View File

@ -82,8 +82,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
}
/**
* Sets whether false is allowed as value indicating that the array should
* be unset.
* Sets whether false is allowed as value indicating that the array should be unset.
*
* @param Boolean $allow
*/
@ -146,6 +145,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
* Retrieves the default value.
*
* @return array The default value
*
* @throws \RuntimeException if the node has no default value
*/
public function getDefaultValue()
@ -168,6 +168,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
* Adds a child node.
*
* @param NodeInterface $node The child node to add
*
* @throws \InvalidArgumentException when the child node has no name
* @throws \InvalidArgumentException when the child node's name is not unique
*/
@ -188,7 +189,9 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
* Finalizes the value of this node.
*
* @param mixed $value
*
* @return mixed The finalised value
*
* @throws UnsetKeyException
* @throws InvalidConfigurationException if the node doesn't have enough children
*/
@ -230,6 +233,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
* Validates the type of the value.
*
* @param mixed $value
*
* @throws InvalidTypeException
*/
protected function validateType($value)
@ -250,6 +254,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
* Normalizes the value.
*
* @param mixed $value The value to normalize
*
* @return mixed The normalized value
*/
protected function normalizeValue($value)
@ -281,9 +286,10 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
}
/**
* Remap multiple singular values to a single plural value
* Remaps multiple singular values to a single plural value.
*
* @param array $value The source values
*
* @return array The remapped values
*/
protected function remapXml($value)
@ -307,7 +313,9 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
*
* @param mixed $leftSide The left side to merge.
* @param mixed $rightSide The right side to merge.
*
* @return mixed The merged values
*
* @throws InvalidConfigurationException
* @throws \RuntimeException
*/

View File

@ -37,6 +37,7 @@ abstract class BaseNode implements NodeInterface
*
* @param string $name The name of the node
* @param NodeInterface $parent The parent of this node
*
* @throws \InvalidArgumentException if the name contains a period.
*/
public function __construct($name, NodeInterface $parent = null)
@ -186,7 +187,9 @@ abstract class BaseNode implements NodeInterface
*
* @param mixed $leftSide
* @param mixed $rightSide
*
* @return mixed The merged value
*
* @throws ForbiddenOverwriteException
*/
public final function merge($leftSide, $rightSide)
@ -238,6 +241,7 @@ abstract class BaseNode implements NodeInterface
* Finalizes a value, applying all finalization closures.
*
* @param mixed $value The value to finalize
*
* @return mixed The finalized value
*/
public final function finalize($value)
@ -269,6 +273,7 @@ abstract class BaseNode implements NodeInterface
* Validates the type of a Node.
*
* @param mixed $value The value to validate
*
* @throws InvalidTypeException when the value is invalid
*/
abstract protected function validateType($value);
@ -277,23 +282,26 @@ abstract class BaseNode implements NodeInterface
* Normalizes the value.
*
* @param mixed $value The value to normalize.
*
* @return mixed The normalized value
*/
abstract protected function normalizeValue($value);
/**
* Merges two values together
* Merges two values together.
*
* @param mixed $leftSide
* @param mixed $rightSide
*
* @return mixed The merged value
*/
abstract protected function mergeValues($leftSide, $rightSide);
/**
* Finalizes a value
* Finalizes a value.
*
* @param mixed $value The value to finalize
*
* @return mixed The finalized value
*/
abstract protected function finalizeValue($value);

View File

@ -56,6 +56,7 @@ class ExprBuilder
* The default one tests if the value is true.
*
* @param \Closure $closure
*
* @return ExprBuilder
*/
public function ifTrue(\Closure $closure = null)

View File

@ -38,6 +38,7 @@ class MergeBuilder
* Sets whether the node can be unset.
*
* @param Boolean $allow
*
* @return MergeBuilder
*/
public function allowUnset($allow = true)

View File

@ -61,6 +61,7 @@ interface NodeInterface
* Normalizes the supplied value.
*
* @param mixed $value The value to normalize
*
* @return mixed The normalized value
*/
function normalize($value);
@ -70,6 +71,7 @@ interface NodeInterface
*
* @param mixed $leftSide
* @param mixed $rightSide
*
* @return mixed The merged values
*/
function merge($leftSide, $rightSide);
@ -78,6 +80,7 @@ interface NodeInterface
* Finalizes a value.
*
* @param mixed $value The value to finalize
*
* @return mixed The finalized value
*/
function finalize($value);

View File

@ -92,6 +92,7 @@ class PrototypedArrayNode extends ArrayNode
* Sets the default value of this node.
*
* @param string $value
*
* @throws \InvalidArgumentException if the default value is not an array
*/
public function setDefaultValue($value)
@ -147,6 +148,7 @@ class PrototypedArrayNode extends ArrayNode
* Disable adding concrete children for prototyped nodes.
*
* @param NodeInterface $node The child node to add
*
* @throws \RuntimeException Prototyped array nodes can't have concrete children.
*/
public function addChild(NodeInterface $node)
@ -158,7 +160,9 @@ class PrototypedArrayNode extends ArrayNode
* Finalizes the value of this node.
*
* @param mixed $value
*
* @return mixed The finalised value
*
* @throws UnsetKeyException
* @throws InvalidConfigurationException if the node doesn't have enough children
*/
@ -193,6 +197,7 @@ class PrototypedArrayNode extends ArrayNode
* Normalizes the value.
*
* @param mixed $value The value to normalize
*
* @return mixed The normalized value
*/
protected function normalizeValue($value)
@ -251,7 +256,9 @@ class PrototypedArrayNode extends ArrayNode
*
* @param mixed $leftSide The left side to merge.
* @param mixed $rightSide The right side to merge.
*
* @return mixed The merged values
*
* @throws InvalidConfigurationException
* @throws \RuntimeException
*/

View File

@ -33,8 +33,8 @@ namespace Symfony\Component\Console\Input;
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @see http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
* @see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02
* @see http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
* @see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02
*
* @api
*/
@ -283,6 +283,7 @@ class ArgvInput extends Input
*
* @param string|array $values The value(s) to look for in the raw parameters (can be an array)
* @param mixed $default The default value to return if no result is found
*
* @return mixed The option value
*/
public function getParameterOption($values, $default = false)

View File

@ -77,6 +77,7 @@ interface InputInterface
* Get argument by name.
*
* @param string $name The name of the argument
*
* @return mixed
*/
function getArgument($name);
@ -90,6 +91,7 @@ interface InputInterface
* Get an option by name.
*
* @param string $name The name of the option
*
* @return mixed
*/
function getOption($name);

View File

@ -46,6 +46,7 @@ class StringInput extends ArgvInput
* Tokenizes a string.
*
* @param string $input The input to tokenize
*
* @throws \InvalidArgumentException When unable to parse input (should never happen)
*/
private function tokenize($input)

View File

@ -80,6 +80,7 @@ class FunctionNode implements NodeInterface
* @param mixed $expr
* @param Boolean $last
* @param Boolean $addNameTest
*
* @return XPathExpr
*/
protected function _xpath_nth_child($xpath, $expr, $last = false, $addNameTest = true)
@ -150,6 +151,7 @@ class FunctionNode implements NodeInterface
*
* @param XPathExpr $xpath
* @param XPathExpr $expr
*
* @return XPathExpr
*/
protected function _xpath_nth_last_child($xpath, $expr)
@ -162,6 +164,7 @@ class FunctionNode implements NodeInterface
*
* @param XPathExpr $xpath
* @param XPathExpr $expr
*
* @return XPathExpr
*/
protected function _xpath_nth_of_type($xpath, $expr)
@ -178,6 +181,7 @@ class FunctionNode implements NodeInterface
*
* @param XPathExpr $xpath
* @param XPathExpr $expr
*
* @return XPathExpr
*/
protected function _xpath_nth_last_of_type($xpath, $expr)
@ -190,6 +194,7 @@ class FunctionNode implements NodeInterface
*
* @param XPathExpr $xpath
* @param XPathExpr $expr
*
* @return XPathExpr
*/
protected function _xpath_contains($xpath, $expr)
@ -213,6 +218,7 @@ class FunctionNode implements NodeInterface
*
* @param XPathExpr $xpath
* @param XPathExpr $expr
*
* @return XPathExpr
*/
protected function _xpath_not($xpath, $expr)
@ -230,6 +236,7 @@ class FunctionNode implements NodeInterface
* Parses things like '1n+2', or 'an+b' generally, returning (a, b)
*
* @param mixed $s
*
* @return array
*/
protected function parseSeries($s)

View File

@ -39,6 +39,7 @@ class PseudoNode implements NodeInterface
* @param NodeInterface $element The NodeInterface element
* @param string $type Node type
* @param string $ident The ident
*
* @throws ParseException When incorrect PseudoNode type is given
*/
public function __construct($element, $type, $ident)
@ -81,8 +82,8 @@ class PseudoNode implements NodeInterface
}
/**
*
* @param XPathExpr $xpath The XPath expression
*
* @return XPathExpr The modified XPath expression
*/
protected function xpath_checked($xpath)
@ -95,7 +96,9 @@ class PseudoNode implements NodeInterface
/**
* @param XPathExpr $xpath The XPath expression
*
* @return XPathExpr The modified XPath expression
*
* @throws ParseException If this element is the root element
*/
protected function xpath_root($xpath)
@ -108,6 +111,7 @@ class PseudoNode implements NodeInterface
* Marks this XPath expression as the first child.
*
* @param XPathExpr $xpath The XPath expression
*
* @return XPathExpr The modified expression
*/
protected function xpath_first_child($xpath)
@ -123,6 +127,7 @@ class PseudoNode implements NodeInterface
* Sets the XPath to be the last child.
*
* @param XPathExpr $xpath The XPath expression
*
* @return XPathExpr The modified expression
*/
protected function xpath_last_child($xpath)
@ -138,6 +143,7 @@ class PseudoNode implements NodeInterface
* Sets the XPath expression to be the first of type.
*
* @param XPathExpr $xpath The XPath expression
*
* @return XPathExpr The modified expression
*/
protected function xpath_first_of_type($xpath)
@ -155,7 +161,9 @@ class PseudoNode implements NodeInterface
* Sets the XPath expression to be the last of type.
*
* @param XPathExpr $xpath The XPath expression
*
* @return XPathExpr The modified expression
*
* @throws ParseException Because *:last-of-type is not implemented
*/
protected function xpath_last_of_type($xpath)
@ -173,6 +181,7 @@ class PseudoNode implements NodeInterface
* Sets the XPath expression to be the only child.
*
* @param XPathExpr $xpath The XPath expression
*
* @return XPathExpr The modified expression
*/
protected function xpath_only_child($xpath)
@ -188,7 +197,9 @@ class PseudoNode implements NodeInterface
* Sets the XPath expression to be only of type.
*
* @param XPathExpr $xpath The XPath expression
*
* @return XPathExpr The modified expression
*
* @throws ParseException Because *:only-of-type is not implemented
*/
protected function xpath_only_of_type($xpath)
@ -205,6 +216,7 @@ class PseudoNode implements NodeInterface
* undocumented function
*
* @param XPathExpr $xpath The XPath expression
*
* @return XPathExpr The modified expression
*/
protected function xpath_empty($xpath)

View File

@ -46,7 +46,8 @@ class AnalyzeServiceReferencesPass implements RepeatablePassInterface
/**
* {@inheritDoc}
*/
public function setRepeatedPass(RepeatedPass $repeatedPass) {
public function setRepeatedPass(RepeatedPass $repeatedPass)
{
$this->repeatedPass = $repeatedPass;
}
@ -111,6 +112,7 @@ class AnalyzeServiceReferencesPass implements RepeatablePassInterface
* Returns a service definition given the full name or an alias.
*
* @param string $id A full id or alias for a service definition.
*
* @return Definition The definition related to the supplied id
*/
private function getDefinition($id)

View File

@ -50,6 +50,7 @@ class CheckCircularReferencesPass implements CompilerPassInterface
* Checks for circular references.
*
* @param array $edges An array of Nodes
*
* @throws ServiceCircularReferenceException When a circular reference is found.
*/
private function checkOutEdges(array $edges)

View File

@ -34,6 +34,7 @@ class CheckDefinitionValidityPass implements CompilerPassInterface
* Processes the ContainerBuilder to validate the Definition.
*
* @param ContainerBuilder $container
*
* @throws RuntimeException When the Definition is invalid
*/
public function process(ContainerBuilder $container)

View File

@ -86,6 +86,7 @@ class CheckReferenceValidityPass implements CompilerPassInterface
* Validates an array of References.
*
* @param array $arguments An array of Reference objects
*
* @throws RuntimeException when there is a reference to an abstract definition.
*/
private function validateReferences(array $arguments)
@ -115,6 +116,7 @@ class CheckReferenceValidityPass implements CompilerPassInterface
*
* @param Reference $reference
* @param Definition $definition
*
* @throws ScopeWideningInjectionException when the definition references a service of a narrower scope
* @throws ScopeCrossingInjectionException when the definition references a service of another scope hierarchy
*/
@ -151,6 +153,7 @@ class CheckReferenceValidityPass implements CompilerPassInterface
* Returns the Definition given an id.
*
* @param string $id Definition identifier
*
* @return Definition
*/
private function getDefinition($id)

View File

@ -106,6 +106,7 @@ class InlineServiceDefinitionsPass implements RepeatablePassInterface
* @param ContainerBuilder $container
* @param string $id
* @param Definition $definition
*
* @return Boolean If the definition is inlineable
*/
private function isInlinableDefinition(ContainerBuilder $container, $id, Definition $definition)

View File

@ -97,6 +97,7 @@ class PassConfig
*
* @param CompilerPassInterface $pass A Compiler pass
* @param string $type The pass type
*
* @throws InvalidArgumentException when a pass type doesn't exist
*
* @api

View File

@ -56,6 +56,7 @@ class ResolveDefinitionTemplatesPass implements CompilerPassInterface
*
* @param string $id The definition identifier
* @param DefinitionDecorator $definition
*
* @return Definition
*/
private function resolveDefinition($id, DefinitionDecorator $definition)

View File

@ -52,9 +52,10 @@ class ResolveReferencesToAliasesPass implements CompilerPassInterface
}
/**
* Processes the arguments to replace aliases
* Processes the arguments to replace aliases.
*
* @param array $arguments An array of References
*
* @return array An array of References
*/
private function processArguments(array $arguments)
@ -75,9 +76,10 @@ class ResolveReferencesToAliasesPass implements CompilerPassInterface
}
/**
* Resolve an alias into a definition id
* Resolves an alias into a definition id.
*
* @param string $id The definition or alias id to resolve
*
* @return string The definition id with aliases resolved
*/
private function getDefinitionId($id)

View File

@ -47,7 +47,9 @@ class ServiceReferenceGraph
* Gets a node by identifier.
*
* @param string $id The id to retrieve
*
* @return ServiceReferenceGraphNode The node matching the supplied identifier
*
* @throws InvalidArgumentException if no node matches the supplied identifier
*/
public function getNode($id)
@ -101,6 +103,7 @@ class ServiceReferenceGraph
*
* @param string $id
* @param string $value
*
* @return ServiceReferenceGraphNode
*/
private function createNode($id, $value)

View File

@ -332,6 +332,7 @@ class Container implements ContainerInterface
* scope.
*
* @param string $name The name of the scope to leave
*
* @throws InvalidArgumentException if the scope is not active
*
* @api
@ -402,6 +403,7 @@ class Container implements ContainerInterface
* Returns whether this container has a certain scope
*
* @param string $name The name of the scope
*
* @return Boolean
*
* @api
@ -417,6 +419,7 @@ class Container implements ContainerInterface
* This does not actually check if the passed scope actually exists.
*
* @param string $name
*
* @return Boolean
*
* @api
@ -430,6 +433,7 @@ class Container implements ContainerInterface
* Camelizes a string.
*
* @param string $id A string to camelize
*
* @return string The camelized string
*/
static public function camelize($id)
@ -441,6 +445,7 @@ class Container implements ContainerInterface
* A string to underscore.
*
* @param string $id The string to underscore
*
* @return string The underscored string
*/
static public function underscore($id)

View File

@ -93,6 +93,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
* Checks if we have an extension.
*
* @param string $name The name of the extension
*
* @return Boolean If the extension exists
*
* @api
@ -373,6 +374,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
*
* @param ContainerBuilder $container The ContainerBuilder instance to merge.
*
*
* @throws BadMethodCallException When this ContainerBuilder is frozen
*
* @api
@ -845,6 +847,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
* Returns the Service Conditionals.
*
* @param mixed $value An array of conditionals to return.
*
* @return array An array of Service conditionals
*/
static public function getServiceConditionals($value)

View File

@ -132,6 +132,7 @@ interface ContainerInterface
* Whether this container has the given scope
*
* @param string $name
*
* @return Boolean
*
* @api
@ -144,6 +145,7 @@ interface ContainerInterface
* It does however not check if the scope actually exists.
*
* @param string $name
*
* @return Boolean
*
* @api

View File

@ -525,6 +525,7 @@ class Definition
* Sets the visibility of this service.
*
* @param Boolean $boolean
*
* @return Definition The current instance
*
* @api

View File

@ -123,6 +123,7 @@ class GraphvizDumper extends Dumper
* @param array $arguments An array of arguments
* @param Boolean $required
* @param string $name
*
* @return array An array of edges
*/
private function findEdges($id, $arguments, $required, $name)
@ -209,6 +210,7 @@ class GraphvizDumper extends Dumper
* Adds attributes
*
* @param array $attributes An array of attributes
*
* @return string A comma separated list of attributes
*/
private function addAttributes($attributes)
@ -242,6 +244,7 @@ class GraphvizDumper extends Dumper
* Dotizes an identifier.
*
* @param string $id The identifier to dotize
*
* @return string A dotized string
*/
private function dotize($id)
@ -253,6 +256,7 @@ class GraphvizDumper extends Dumper
* Compiles an array of aliases for a specified service id.
*
* @param string $id A service id
*
* @return array An array of aliases
*/
private function getAliases($id)

View File

@ -105,6 +105,7 @@ class PhpDumper extends Dumper
*
* @param string $cId
* @param string $definition
*
* @return string
*/
private function addServiceLocalTempVariables($cId, $definition)
@ -153,6 +154,7 @@ class PhpDumper extends Dumper
*
* @param string $id The service id
* @param Definition $definition
*
* @return string
*/
private function addServiceInclude($id, $definition)
@ -182,6 +184,7 @@ class PhpDumper extends Dumper
*
* @param string $id
* @param Definition $definition
*
* @return string
*/
private function addServiceInlinedDefinitions($id, $definition)
@ -260,6 +263,7 @@ class PhpDumper extends Dumper
*
* @param string $id Service id
* @param Definition $definition
*
* @return string
*/
private function addServiceReturn($id, $definition)
@ -276,6 +280,7 @@ class PhpDumper extends Dumper
*
* @param string $id
* @param Definition $definition
*
* @return string
*
* @throws InvalidArgumentException
@ -338,6 +343,7 @@ class PhpDumper extends Dumper
*
* @param string $id
* @param Definition $definition
*
* @return Boolean
*/
private function isSimpleInstance($id, $definition)
@ -361,6 +367,7 @@ class PhpDumper extends Dumper
* @param string $id
* @param Definition $definition
* @param string $variableName
*
* @return string
*/
private function addServiceMethodCalls($id, $definition, $variableName = 'instance')
@ -432,6 +439,7 @@ class PhpDumper extends Dumper
* @param string $id
* @param Definition $definition
* @param string $variableName
*
* @return string
*/
private function addServiceConfigurator($id, $definition, $variableName = 'instance')
@ -456,6 +464,7 @@ class PhpDumper extends Dumper
*
* @param string $id
* @param Definition $definition
*
* @return string
*/
private function addService($id, $definition)
@ -546,6 +555,7 @@ EOF;
*
* @param string $alias
* @param string $id
*
* @return string
*/
private function addServiceAlias($alias, $id)
@ -605,6 +615,7 @@ EOF;
*
* @param string $class Class name
* @param string $baseClass The name of the base class
*
* @return string
*/
private function startClass($class, $baseClass)
@ -792,6 +803,7 @@ EOF;
* @param array $parameters
* @param string $path
* @param integer $indent
*
* @return string
*/
private function exportParameters($parameters, $path = '', $indent = 12)
@ -834,6 +846,7 @@ EOF;
*
* @param string $value
* @param string $code
*
* @return string
*/
private function wrapServiceConditionals($value, $code)
@ -857,8 +870,8 @@ EOF;
* Builds service calls from arguments
*
* @param array $arguments
* @param string $calls By reference
* @param string $behavior By reference
* @param string &$calls By reference
* @param string &$behavior By reference
*/
private function getServiceCallsFromArguments(array $arguments, array &$calls, array &$behavior)
{
@ -886,6 +899,7 @@ EOF;
* Returns the inline definition
*
* @param Definition $definition
*
* @return array
*/
private function getInlinedDefinitions(Definition $definition)
@ -909,6 +923,7 @@ EOF;
* Gets the definition from arguments
*
* @param array $arguments
*
* @return array
*/
private function getDefinitionsFromArguments(array $arguments)
@ -934,6 +949,7 @@ EOF;
*
* @param string $id
* @param array $arguments
*
* @return Boolean
*/
private function hasReference($id, array $arguments)
@ -958,6 +974,7 @@ EOF;
*
* @param array $value
* @param Boolean $interpolate
*
* @return string
*/
private function dumpValue($value, $interpolate = true)
@ -1041,6 +1058,7 @@ EOF;
* Dumps a parameter
*
* @param string $name
*
* @return string
*/
public function dumpParameter($name)
@ -1057,6 +1075,7 @@ EOF;
*
* @param string $id
* @param Reference $reference
*
* @return string
*/
private function getServiceCall($id, Reference $reference = null)

View File

@ -140,7 +140,8 @@ class XmlDumper extends Dumper
}
if ($definition->getFile()) {
$file = $this->document->createElement('file', $definition->getFile());
$file = $this->document->createElement('file');
$file->appendChild($this->document->createTextNode($definition->getFile()));
$service->appendChild($file);
}
@ -256,6 +257,7 @@ class XmlDumper extends Dumper
* Escapes arguments
*
* @param array $arguments
*
* @return array
*/
private function escape($arguments)
@ -278,7 +280,6 @@ class XmlDumper extends Dumper
* Converts php types to xml types.
*
* @param mixed $value Value to convert
* @throws RuntimeException When trying to dump object or resource
*/
static public function phpToXml($value)
{

View File

@ -45,6 +45,7 @@ class YamlDumper extends Dumper
*
* @param string $id
* @param Definition $definition
*
* @return string
*/
private function addService($id, $definition)
@ -118,6 +119,7 @@ class YamlDumper extends Dumper
*
* @param string $alias
* @param string $id
*
* @return string
*/
private function addServiceAlias($alias, $id)
@ -176,6 +178,7 @@ class YamlDumper extends Dumper
* Dumps the value to YAML format
*
* @param mixed $value
*
* @throws RuntimeException When trying to dump object or resource
*/
private function dumpValue($value)
@ -203,6 +206,7 @@ class YamlDumper extends Dumper
*
* @param string $id
* @param Reference $reference
*
* @return string
*/
private function getServiceCall($id, Reference $reference = null)
@ -218,6 +222,7 @@ class YamlDumper extends Dumper
* Gets parameter call.
*
* @param string $id
*
* @return string
*/
private function getParameterCall($id)
@ -229,6 +234,7 @@ class YamlDumper extends Dumper
* Prepares parameters
*
* @param array $parameters
*
* @return array
*/
private function prepareParameters($parameters)
@ -251,6 +257,7 @@ class YamlDumper extends Dumper
* Escapes arguments
*
* @param array $arguments
*
* @return array
*/
private function escape($arguments)

View File

@ -199,6 +199,7 @@ class XmlFileLoader extends FileLoader
* Parses a XML file.
*
* @param string $file Path to a file
*
* @throws InvalidArgumentException When loading of XML file returns error
*/
private function parseFile($file)
@ -221,6 +222,7 @@ class XmlFileLoader extends FileLoader
*
* @param SimpleXMLElement $xml
* @param string $file
*
* @return array An array of anonymous services
*/
private function processAnonymousServices(SimpleXMLElement $xml, $file)

View File

@ -221,6 +221,7 @@ class YamlFileLoader extends FileLoader
* Loads a YAML file.
*
* @param string $file
*
* @return array The file content
*/
private function loadFile($file)
@ -233,6 +234,7 @@ class YamlFileLoader extends FileLoader
*
* @param mixed $content
* @param string $file
*
* @return array
*
* @throws InvalidArgumentException When service file is not valid
@ -271,6 +273,7 @@ class YamlFileLoader extends FileLoader
* Resolves services.
*
* @param string $value
*
* @return Reference
*/
private function resolveServices($value)

View File

@ -14,6 +14,7 @@ namespace Symfony\Component\DependencyInjection\ParameterBag;
use Symfony\Component\DependencyInjection\Exception\LogicException;
/**
* Holds read-only parameters.
*
* @author Fabien Potencier <fabien@symfony.com>
*

View File

@ -16,6 +16,7 @@ use Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceEx
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
/**
* Holds parameters.
*
* @author Fabien Potencier <fabien@symfony.com>
*

View File

@ -22,6 +22,7 @@ class SimpleXMLElement extends \SimpleXMLElement
* Converts an attribute as a php type.
*
* @param string $name
*
* @return mixed
*/
public function getAttributeAsPhp($name)
@ -95,6 +96,7 @@ class SimpleXMLElement extends \SimpleXMLElement
* Converts an xml value to a php type.
*
* @param mixed $value
*
* @return mixed
*/
static public function phpize($value)

View File

@ -43,7 +43,7 @@ class ChoiceFormField extends FormField
/**
* Check if the current selected option is disabled
*
*
* @return bool
*/
public function isDisabled()
@ -56,7 +56,7 @@ class ChoiceFormField extends FormField
return false;
}
/**
* Sets the value of the field.
*
@ -249,7 +249,7 @@ class ChoiceFormField extends FormField
* Returns option value with associated disabled flag
*
* @param type $node
*
*
* @return array
*/
private function buildOptionValue($node)
@ -259,7 +259,7 @@ class ChoiceFormField extends FormField
$defaultValue = (isset($node->nodeValue) && !empty($node->nodeValue)) ? $node->nodeValue : '1';
$option['value'] = $node->hasAttribute('value') ? $node->getAttribute('value') : $defaultValue;
$option['disabled'] = ($node->hasAttribute('disabled') && $node->getAttribute('disabled') == 'disabled');
return $option;
}
@ -268,7 +268,7 @@ class ChoiceFormField extends FormField
*
* @param string $optionValue
* @param array $options
*
*
* @return bool
*/
public function containsOption($optionValue, $options)

View File

@ -20,9 +20,6 @@ namespace Symfony\Component\EventDispatcher;
* You can call the method stopPropagation() to abort the execution of
* further listeners in your event listener.
*
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>

View File

@ -17,8 +17,6 @@ namespace Symfony\Component\EventDispatcher;
* {@link getSubscribedEvents} and registers the subscriber as a listener for all
* returned events.
*
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>

View File

@ -25,11 +25,13 @@ namespace Symfony\Component\Finder\Comparator;
*
* Based on the Perl Number::Compare module.
*
* @author Fabien Potencier <fabien@symfony.com> PHP port
* @author Richard Clamp <richardc@unixbeard.net> Perl version
* @copyright 2004-2005 Fabien Potencier <fabien@symfony.com>
* @copyright 2002 Richard Clamp <richardc@unixbeard.net>
* @see http://physics.nist.gov/cuu/Units/binary.html
* @author Fabien Potencier <fabien@symfony.com> PHP port
* @author Richard Clamp <richardc@unixbeard.net> Perl version
*
* @copyright 2004-2005 Fabien Potencier <fabien@symfony.com>
* @copyright 2002 Richard Clamp <richardc@unixbeard.net>
*
* @see http://physics.nist.gov/cuu/Units/binary.html
*/
class NumberComparator extends Comparator
{

View File

@ -19,7 +19,8 @@ use Symfony\Component\Form\Exception\UnexpectedTypeException;
class PropertyPathMapper implements DataMapperInterface
{
/**
* Stores the class that the data of this form must be instances of
* Stores the class that the data of this form must be instances of.
*
* @var string
*/
private $dataClass;
@ -30,7 +31,6 @@ class PropertyPathMapper implements DataMapperInterface
}
/**
*
* @param dataClass $data
* @param array $forms
*

View File

@ -18,7 +18,8 @@ use Symfony\Component\HttpFoundation\Session;
* session ID
*
* @author Bernhard Schussek <bernhard.schussek@symfony.com>
* @see DefaultCsrfProvider
*
* @see DefaultCsrfProvider
*/
class SessionCsrfProvider extends DefaultCsrfProvider
{

View File

@ -79,6 +79,7 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
* Guesses a field class name for a given constraint
*
* @param Constraint $constraint The constraint to guess for
*
* @return TypeGuess The guessed field class and options
*/
public function guessTypeForConstraint(Constraint $constraint)
@ -239,6 +240,7 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
* Guesses whether a field is required based on the given constraint
*
* @param Constraint $constraint The constraint to guess for
*
* @return Guess The guess whether the field is required
*/
public function guessRequiredForConstraint(Constraint $constraint)
@ -266,6 +268,7 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
* Guesses a field's maximum length based on the given constraint
*
* @param Constraint $constraint The constraint to guess for
*
* @return Guess The guess for the maximum length
*/
public function guessMaxLengthForConstraint(Constraint $constraint)
@ -298,6 +301,7 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
* Guesses a field's minimum length based on the given constraint
*
* @param Constraint $constraint The constraint to guess for
*
* @return Guess The guess for the minimum length
*/
public function guessMinLengthForConstraint(Constraint $constraint)

View File

@ -225,8 +225,10 @@ class FormFactory implements FormFactoryInterface
}
$this->addType($type);
} else {
} elseif (is_string($type)) {
$type = $this->getType($type);
} else {
throw new UnexpectedTypeException($type, 'string or Symfony\Component\Form\FormTypeInterface');
}
$defaultOptions = $type->getDefaultOptions($options);

View File

@ -48,6 +48,7 @@ interface FormTypeGuesserInterface
*
* @param string $class The fully qualified class name
* @param string $property The name of the property to guess for
*
* @return Guess A guess for the field's minimum length
*/
function guessMinLength($class, $property);

View File

@ -48,6 +48,7 @@ class FormView implements \ArrayAccess, \IteratorAggregate, \Countable
/**
* @param $name
*
* @return Boolean
*/
public function has($name)
@ -202,7 +203,7 @@ class FormView implements \ArrayAccess, \IteratorAggregate, \Countable
/**
* Returns a given child.
*
* @param string name The name of the child
* @param string $name The name of the child
*
* @return FormView The child view
*/

View File

@ -66,6 +66,7 @@ abstract class Guess
* returned guess is any of them.
*
* @param array $guesses A list of guesses
*
* @return Guess The guess with the highest confidence
*/
static public function getBestGuess(array $guesses)

View File

@ -138,6 +138,7 @@ class PropertyPath implements \IteratorAggregate
* Returns whether the element at the given index is a property
*
* @param integer $index The index in the property path
*
* @return Boolean Whether the element at this index is a property
*/
public function isProperty($index)
@ -149,6 +150,7 @@ class PropertyPath implements \IteratorAggregate
* Returns whether the element at the given index is an array index
*
* @param integer $index The index in the property path
*
* @return Boolean Whether the element at this index is an array index
*/
public function isIndex($index)
@ -176,13 +178,12 @@ class PropertyPath implements \IteratorAggregate
*
* If neither is found, an exception is thrown.
*
* @param object|array $objectOrArray The object or array to traverse
* @return mixed The value at the end of the
* property path
* @throws InvalidPropertyException If the property/getter does not
* exist
* @throws PropertyAccessDeniedException If the property/getter exists but
* is not public
* @param object|array $objectOrArray The object or array to traverse
*
* @return mixed The value at the end of the property path
*
* @throws InvalidPropertyException If the property/getter does not exist
* @throws PropertyAccessDeniedException If the property/getter exists but is not public
*/
public function getValue($objectOrArray)
{
@ -228,12 +229,10 @@ class PropertyPath implements \IteratorAggregate
* If neither is found, an exception is thrown.
*
* @param object|array $objectOrArray The object or array to traverse
* @param mixed $value The value at the end of the
* property path
* @throws InvalidPropertyException If the property/setter does not
* exist
* @throws PropertyAccessDeniedException If the property/setter exists but
* is not public
* @param mixed $value The value at the end of the property path
*
* @throws InvalidPropertyException If the property/setter does not exist
* @throws PropertyAccessDeniedException If the property/setter exists but is not public
*/
public function setValue(&$objectOrArray, $value)
{
@ -268,6 +267,7 @@ class PropertyPath implements \IteratorAggregate
*
* @param object $object The object to read from
* @param integer $currentIndex The index of the read property in the path
*
* @return mixed The value of the property
*/
protected function readProperty($object, $currentIndex)
@ -322,8 +322,7 @@ class PropertyPath implements \IteratorAggregate
* Sets the value of the property at the given index in the path
*
* @param object $objectOrArray The object or array to traverse
* @param integer $currentIndex The index of the modified property in the
* path
* @param integer $currentIndex The index of the modified property in the path
* @param mixed $value The value to set
*/
protected function writeProperty(&$objectOrArray, $currentIndex, $value)

View File

@ -93,7 +93,9 @@ class MimeTypeGuesser implements MimeTypeGuesserInterface
* value.
*
* @param string $path The path to the file
*
* @return string The mime type or NULL, if none could be guessed
*
* @throws FileException If the file does not exist
*/
public function guess($path)
@ -107,7 +109,7 @@ class MimeTypeGuesser implements MimeTypeGuesserInterface
}
if (!$this->guessers) {
throw new \LogicException('Unable to guess the mime type as no guessers are available.');
throw new \LogicException('Unable to guess the mime type as no guessers are available (Did you enable the php_fileinfo extension?)');
}
foreach ($this->guessers as $guesser) {

View File

@ -19,10 +19,12 @@ namespace Symfony\Component\HttpFoundation\File\MimeType;
interface MimeTypeGuesserInterface
{
/**
* Guesses the mime type of the file with the given path
* Guesses the mime type of the file with the given path.
*
* @param string $path The path to the file
*
* @return string The mime type or NULL, if none could be guessed
*
* @throws FileNotFoundException If the file does not exist
* @throws AccessDeniedException If the file could not be read
*/

View File

@ -122,6 +122,7 @@ class FileBag extends ParameterBag
* just returns the original array unmodified.
*
* @param array $data
*
* @return array
*/
protected function fixPhpFilesArray($data)

View File

@ -524,6 +524,7 @@ class Request
return $this->server->get('HTTP_CLIENT_IP');
} elseif (self::$trustProxy && $this->server->has('HTTP_X_FORWARDED_FOR')) {
$clientIp = explode(',', $this->server->get('HTTP_X_FORWARDED_FOR'), 2);
return isset($clientIp[0]) ? trim($clientIp[0]) : '';
}
}

View File

@ -12,6 +12,7 @@
namespace Symfony\Component\HttpKernel\CacheWarmer;
/**
* Abstract cache warmer that knows how to write a file to the cache.
*
* @author Fabien Potencier <fabien@symfony.com>
*/

View File

@ -12,6 +12,7 @@
namespace Symfony\Component\HttpKernel\CacheWarmer;
/**
* Aggregates several cache warmers into a single one.
*
* @author Fabien Potencier <fabien@symfony.com>
*/

View File

@ -12,6 +12,7 @@
namespace Symfony\Component\HttpKernel\CacheWarmer;
/**
* Interface for classes able to warm up the cache.
*
* @author Fabien Potencier <fabien@symfony.com>
*/

View File

@ -18,7 +18,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
*
* Interface implemented by HTTP cache stores.
*
* @author Fabien Potencier <fabien@symfony.com>
*/

View File

@ -25,40 +25,56 @@ class NullLogger implements LoggerInterface
/**
* @api
*/
public function emerg($message, array $context = array()) {}
public function emerg($message, array $context = array())
{
}
/**
* @api
*/
public function alert($message, array $context = array()) {}
public function alert($message, array $context = array())
{
}
/**
* @api
*/
public function crit($message, array $context = array()) {}
public function crit($message, array $context = array())
{
}
/**
* @api
*/
public function err($message, array $context = array()) {}
public function err($message, array $context = array())
{
}
/**
* @api
*/
public function warn($message, array $context = array()) {}
public function warn($message, array $context = array())
{
}
/**
* @api
*/
public function notice($message, array $context = array()) {}
public function notice($message, array $context = array())
{
}
/**
* @api
*/
public function info($message, array $context = array()) {}
public function info($message, array $context = array())
{
}
/**
* @api
*/
public function debug($message, array $context = array()) {}
public function debug($message, array $context = array())
{
}
}

View File

@ -35,7 +35,9 @@ class Locale extends \Locale
* Returns the country names for a locale
*
* @param string $locale The locale to use for the country names
*
* @return array The country names with their codes as keys
*
* @throws RuntimeException When the resource bundles cannot be loaded
*/
static public function getDisplayCountries($locale)
@ -82,7 +84,9 @@ class Locale extends \Locale
* Returns the language names for a locale
*
* @param string $locale The locale to use for the language names
*
* @return array The language names with their codes as keys
*
* @throws RuntimeException When the resource bundles cannot be loaded
*/
static public function getDisplayLanguages($locale)

View File

@ -80,6 +80,7 @@ class FullTransformer
* Format a DateTime using ICU dateformat pattern
*
* @param DateTime $dateTime A DateTime object to be used to generate the formatted value
*
* @return string The formatted value
*/
public function format(\DateTime $dateTime)
@ -98,7 +99,9 @@ class FullTransformer
*
* @param string $dateChars The date characters to be replaced with a formatted ICU value
* @param DateTime $dateTime A DateTime object to be used to generate the formatted value
*
* @return string The formatted value
*
* @throws NotImplementedException When it encounters a not implemented date character
*/
public function formatReplace($dateChars, $dateTime)
@ -126,7 +129,9 @@ class FullTransformer
*
* @param DateTime $dateTime A configured DateTime object to use to perform the date calculation
* @param string $value String to convert to a time value
*
* @return int The corresponding Unix timestamp
*
* @throws InvalidArgumentException When the value can not be matched with pattern
*/
public function parse(\DateTime $dateTime, $value)
@ -156,6 +161,7 @@ class FullTransformer
* Retrieve a regular expression to match with a formatted value.
*
* @param string $pattern The pattern to create the reverse matching regular expression
*
* @return string The reverse matching regular expression with named captures being formed by the
* transformer index in the $transformer array
*/
@ -191,6 +197,7 @@ class FullTransformer
* Check if the first char of a string is a single quote
*
* @param string $quoteMatch The string to check
*
* @return Boolean true if matches, false otherwise
*/
public function isQuoteMatch($quoteMatch)
@ -202,6 +209,7 @@ class FullTransformer
* Replaces single quotes at the start or end of a string with two single quotes
*
* @param string $quoteMatch The string to replace the quotes
*
* @return string A string with the single quotes replaced
*/
public function replaceQuoteMatch($quoteMatch)
@ -217,6 +225,7 @@ class FullTransformer
* Builds a chars match regular expression
*
* @param string $specialChars A string of chars to build the regular expression
*
* @return string The chars match regular expression
*/
protected function buildCharsMatch($specialChars)
@ -235,6 +244,7 @@ class FullTransformer
* with the value and pattern values for the matched Transformer
*
* @param array $data
*
* @return array
*/
protected function normalizeArray(array $data)
@ -261,6 +271,7 @@ class FullTransformer
*
* @param DateTime $dateTime The DateTime object to be used to calculate the timestamp
* @param array $options An array with the matched values to be used to calculate the timestamp
*
* @return Boolean|int The calculated timestamp or false if matched date is invalid
*/
protected function calculateUnixTimestamp(\DateTime $dateTime, array $options)
@ -312,6 +323,7 @@ class FullTransformer
* are base in the beginning of the Unix era
*
* @param array $options
*
* @return array
*/
private function getDefaultValueForOptions(array $options)

Some files were not shown because too many files have changed in this diff Show More