merged 2.0
This commit is contained in:
commit
142cef21bb
@ -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
|
||||
@ -270,6 +286,7 @@ class EntityChoiceList extends ArrayChoiceList
|
||||
* @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,10 +318,10 @@ 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
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @return array The identifier values
|
||||
*
|
||||
* @throws FormException If the entity does not exist in Doctrine's identity map
|
||||
*/
|
||||
public function getIdentifierValues($entity)
|
||||
{
|
||||
|
@ -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
|
||||
*
|
||||
* @return Collection|object A collection of entities, a single entity or NULL
|
||||
*/
|
||||
public function reverseTransform($keys)
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -76,7 +76,6 @@ class EntityUserProvider implements UserProviderInterface
|
||||
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.
|
||||
// That's the case when the user has been changed by a form with
|
||||
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -40,6 +40,7 @@ class UniqueEntityValidator extends ConstraintValidator
|
||||
/**
|
||||
* @param object $entity
|
||||
* @param Constraint $constraint
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isValid($entity, Constraint $constraint)
|
||||
|
@ -12,8 +12,6 @@
|
||||
namespace Symfony\Bridge\Twig\Node;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class FormThemeNode extends \Twig_Node
|
||||
|
@ -12,8 +12,6 @@
|
||||
namespace Symfony\Bridge\Twig\Node;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class TransNode extends \Twig_Node
|
||||
|
@ -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>
|
||||
*/
|
||||
|
@ -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>
|
||||
*/
|
||||
|
@ -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>
|
||||
*/
|
||||
|
@ -288,7 +288,8 @@ 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 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)
|
||||
|
@ -12,8 +12,6 @@
|
||||
namespace Symfony\Bundle\DoctrineBundle\Mapping;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class ClassMetadataCollection
|
||||
|
@ -12,8 +12,6 @@
|
||||
namespace Symfony\Bundle\DoctrineBundle\Mapping;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class DisconnectedMetadataFactory extends MetadataFactory
|
||||
|
@ -28,7 +28,6 @@ class XMLSchemaTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* @dataProvider dataValidateSchemaFiles
|
||||
* @param string $file
|
||||
*/
|
||||
public function testValidateSchema($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)
|
||||
|
@ -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
|
||||
*
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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>
|
||||
*/
|
||||
|
@ -19,6 +19,7 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Manages HTTP cache objects in a Container.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
|
@ -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>
|
||||
@ -69,7 +69,7 @@ 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 string|array $themes A theme or an array of theme
|
||||
*/
|
||||
public function setTheme(FormView $view, $themes)
|
||||
{
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
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'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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();
|
||||
|
@ -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>
|
||||
*/
|
||||
|
@ -217,6 +217,7 @@ class ProfilerController extends ContainerAware
|
||||
* Search results.
|
||||
*
|
||||
* @param string $token The token
|
||||
*
|
||||
* @return Response A Response instance
|
||||
*/
|
||||
public function searchResultsAction($token)
|
||||
|
@ -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.
|
||||
|
@ -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 %}
|
||||
|
@ -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 %}
|
||||
|
||||
|
@ -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>
|
||||
<p><em>Request content not available (it was retrieved as a resource).</em></p>
|
||||
{% elseif collector.content %}
|
||||
<pre>{{ collector.content }}</pre>
|
||||
{% else %}
|
||||
<em>No content</em>
|
||||
<p><em>No content</em></p>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<h2>Request Server Parameters</h2>
|
||||
|
||||
@ -99,10 +97,13 @@
|
||||
|
||||
{% if collector.sessionattributes|length %}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Key</th>
|
||||
<th>Value</th>
|
||||
<th scope="col">Key</th>
|
||||
<th scope="col">Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% set attributes = collector.sessionattributes %}
|
||||
{% for key in attributes|keys|sort %}
|
||||
<tr>
|
||||
@ -110,6 +111,7 @@
|
||||
<td>{{ attributes[key]|yaml_dump }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -5,13 +5,15 @@
|
||||
|
||||
{% if tokens %}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Token</th>
|
||||
<th>IP</th>
|
||||
<th>Method</th>
|
||||
<th>URL</th>
|
||||
<th>Time</th>
|
||||
<th scope="col">Token</th>
|
||||
<th scope="col">IP</th>
|
||||
<th scope="col">URL</th>
|
||||
<th scope="col">Time</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for elements in tokens %}
|
||||
<tr>
|
||||
<td><a href="{{ path('_profiler', { 'token': elements.token }) }}">{{ elements.token }}</a></td>
|
||||
@ -21,6 +23,7 @@
|
||||
<td>{{ elements.time|date('r') }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p>
|
||||
|
@ -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 = '')
|
||||
@ -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)
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -38,6 +38,7 @@ class MergeBuilder
|
||||
* Sets whether the node can be unset.
|
||||
*
|
||||
* @param Boolean $allow
|
||||
*
|
||||
* @return MergeBuilder
|
||||
*/
|
||||
public function allowUnset($allow = true)
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -525,6 +525,7 @@ class Definition
|
||||
* Sets the visibility of this service.
|
||||
*
|
||||
* @param Boolean $boolean
|
||||
*
|
||||
* @return Definition The current instance
|
||||
*
|
||||
* @api
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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>
|
||||
*
|
||||
|
@ -16,6 +16,7 @@ use Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceEx
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
|
||||
/**
|
||||
* Holds parameters.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
|
@ -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)
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -27,8 +27,10 @@ namespace Symfony\Component\Finder\Comparator;
|
||||
*
|
||||
* @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
|
||||
|
@ -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
|
||||
*
|
||||
|
@ -18,6 +18,7 @@ use Symfony\Component\HttpFoundation\Session;
|
||||
* session ID
|
||||
*
|
||||
* @author Bernhard Schussek <bernhard.schussek@symfony.com>
|
||||
*
|
||||
* @see DefaultCsrfProvider
|
||||
*/
|
||||
class SessionCsrfProvider extends DefaultCsrfProvider
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
@ -177,12 +179,11 @@ 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
|
||||
*
|
||||
* @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)
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -122,6 +122,7 @@ class FileBag extends ParameterBag
|
||||
* just returns the original array unmodified.
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function fixPhpFilesArray($data)
|
||||
|
@ -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]) : '';
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
||||
*/
|
||||
|
@ -12,6 +12,7 @@
|
||||
namespace Symfony\Component\HttpKernel\CacheWarmer;
|
||||
|
||||
/**
|
||||
* Aggregates several cache warmers into a single one.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
|
@ -12,6 +12,7 @@
|
||||
namespace Symfony\Component\HttpKernel\CacheWarmer;
|
||||
|
||||
/**
|
||||
* Interface for classes able to warm up the cache.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
|
@ -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>
|
||||
*/
|
||||
|
@ -25,40 +25,56 @@ class NullLogger implements LoggerInterface
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function emerg($message, array $context = array()) {}
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function alert($message, array $context = array()) {}
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function crit($message, array $context = array()) {}
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function err($message, array $context = array()) {}
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function warn($message, array $context = array()) {}
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function notice($message, array $context = array()) {}
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function info($message, array $context = array()) {}
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function debug($message, array $context = array()) {}
|
||||
public function emerg($message, array $context = array())
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function alert($message, array $context = array())
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function crit($message, array $context = array())
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function err($message, array $context = array())
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function warn($message, array $context = array())
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function notice($message, array $context = array())
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function info($message, array $context = array())
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function debug($message, array $context = array())
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -23,6 +23,7 @@ abstract class HourTransformer extends Transformer
|
||||
*
|
||||
* @param int $hour The hour value
|
||||
* @param string $marker An optional AM/PM marker
|
||||
*
|
||||
* @return int The normalized hour value
|
||||
*/
|
||||
abstract public function normalizeHour($hour, $marker = null);
|
||||
|
@ -64,10 +64,13 @@ class TimeZoneTransformer extends Transformer
|
||||
* Only GMT, Etc/Universal, Etc/Zulu, Etc/Greenwich, Etc/GMT-0, Etc/GMT+0 and Etc/GMT0 are old names and
|
||||
* are linked to Etc/GMT or Etc/UTC.
|
||||
*
|
||||
* @param string $timezone A GMT timezone string (GMT-03:00, e.g.)
|
||||
* @param string $formattedTimeZone A GMT timezone string (GMT-03:00, e.g.)
|
||||
*
|
||||
* @return string A timezone identifier
|
||||
*
|
||||
* @see http://php.net/manual/en/timezones.others.php
|
||||
* @see http://www.twinsun.com/tz/tz-link.htm
|
||||
*
|
||||
* @throws NotImplementedException When the GMT time zone have minutes offset different than zero
|
||||
* @throws InvalidArgumentException When the value can not be matched with pattern
|
||||
*/
|
||||
|
@ -24,6 +24,7 @@ abstract class Transformer
|
||||
*
|
||||
* @param DateTime $dateTime A DateTime object to be used to generate the formatted value
|
||||
* @param int $length The formatted value string length
|
||||
*
|
||||
* @return string The formatted value
|
||||
*/
|
||||
abstract public function format(\DateTime $dateTime, $length);
|
||||
@ -32,6 +33,7 @@ abstract class Transformer
|
||||
* Returns a reverse matching regular expression of a string generated by format()
|
||||
*
|
||||
* @param int $length The length of the value to be reverse matched
|
||||
*
|
||||
* @return string The reverse matching regular expression
|
||||
*/
|
||||
abstract public function getReverseMatchingRegExp($length);
|
||||
@ -42,6 +44,7 @@ abstract class Transformer
|
||||
*
|
||||
* @param string $matched The matched value
|
||||
* @param int $length The length of the Transformer pattern string
|
||||
*
|
||||
* @return array An associative array
|
||||
*/
|
||||
abstract public function extractDateOptions($matched, $length);
|
||||
@ -51,6 +54,7 @@ abstract class Transformer
|
||||
*
|
||||
* @param string $value The string to be padded
|
||||
* @param int $length The length to pad
|
||||
*
|
||||
* @return string The padded string
|
||||
*/
|
||||
protected function padLeft($value, $length)
|
||||
|
@ -69,6 +69,7 @@ class StubCollator
|
||||
* Constructor
|
||||
*
|
||||
* @param string $locale The locale code
|
||||
*
|
||||
* @throws MethodArgumentValueNotImplementedException When $locale different than 'en' is passed
|
||||
*/
|
||||
public function __construct($locale)
|
||||
@ -82,6 +83,7 @@ class StubCollator
|
||||
* Static constructor
|
||||
*
|
||||
* @param string $locale The locale code
|
||||
*
|
||||
* @throws MethodArgumentValueNotImplementedException When $locale different than 'en' is passed
|
||||
*/
|
||||
static public function create($locale)
|
||||
@ -97,6 +99,7 @@ class StubCollator
|
||||
* StubCollator::SORT_REGULAR - compare items normally (don't change types)
|
||||
* StubCollator::SORT_NUMERIC - compare items numerically
|
||||
* StubCollator::SORT_STRING - compare items as strings
|
||||
*
|
||||
* @return Boolean True on success or false on failure
|
||||
*/
|
||||
public function asort(&$array, $sortFlag = self::SORT_REGULAR)
|
||||
@ -117,11 +120,14 @@ class StubCollator
|
||||
*
|
||||
* @param string $str1 The first string to compare
|
||||
* @param string $str2 The second string to compare
|
||||
*
|
||||
* @return Boolean|int Return the comparison result or false on failure:
|
||||
* 1 if $str1 is greater than $str2
|
||||
* 0 if $str1 is equal than $str2
|
||||
* -1 if $str1 is less than $str2
|
||||
*
|
||||
* @see http://www.php.net/manual/en/collator.compare.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
public function compare($str1, $str2)
|
||||
@ -133,8 +139,11 @@ class StubCollator
|
||||
* Get a value of an integer collator attribute
|
||||
*
|
||||
* @param int $attr An attribute specifier, one of the attribute constants
|
||||
*
|
||||
* @return Boolean|int The attribute value on success or false on error
|
||||
*
|
||||
* @see http://www.php.net/manual/en/collator.getattribute.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
public function getAttribute($attr)
|
||||
@ -166,6 +175,7 @@ class StubCollator
|
||||
* Returns the collator's locale
|
||||
*
|
||||
* @param int $type The locale name type to return between valid or actual (StubLocale::VALID_LOCALE or StubLocale::ACTUAL_LOCALE, respectively)
|
||||
*
|
||||
* @return string The locale name used to create the collator
|
||||
*/
|
||||
public function getLocale($type = StubLocale::ACTUAL_LOCALE)
|
||||
@ -177,8 +187,11 @@ class StubCollator
|
||||
* Get sorting key for a string
|
||||
*
|
||||
* @param string $string The string to produce the key from
|
||||
*
|
||||
* @return string The collation key for $string
|
||||
*
|
||||
* @see http://www.php.net/manual/en/collator.getsortkey.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
public function getSortKey($string)
|
||||
@ -190,7 +203,9 @@ class StubCollator
|
||||
* Get current collator's strength
|
||||
*
|
||||
* @return Boolean|int The current collator's strength or false on failure
|
||||
*
|
||||
* @see http://www.php.net/manual/en/collator.getstrength.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
public function getStrength()
|
||||
@ -203,8 +218,11 @@ class StubCollator
|
||||
*
|
||||
* @param int $attr An attribute specifier, one of the attribute constants
|
||||
* @param int $val The attribute value, one of the attribute value constants
|
||||
*
|
||||
* @return Boolean True on success or false on failure
|
||||
*
|
||||
* @see http://www.php.net/manual/en/collator.setattribute.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
public function setAttribute($attr, $val)
|
||||
@ -222,8 +240,11 @@ class StubCollator
|
||||
* StubCollator::QUATERNARY
|
||||
* StubCollator::IDENTICAL
|
||||
* StubCollator::DEFAULT
|
||||
*
|
||||
* @return Boolean True on success or false on failure
|
||||
*
|
||||
* @see http://www.php.net/manual/en/collator.setstrength.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
public function setStrength($strength)
|
||||
@ -235,8 +256,11 @@ class StubCollator
|
||||
* Sort array using specified collator and sort keys
|
||||
*
|
||||
* @param array &$arr Array of strings to sort
|
||||
*
|
||||
* @return Boolean True on success or false on failure
|
||||
*
|
||||
* @see http://www.php.net/manual/en/collator.sortwithsortkeys.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
public function sortWithSortKeys(&$arr)
|
||||
@ -252,8 +276,11 @@ class StubCollator
|
||||
* StubCollator::SORT_REGULAR
|
||||
* StubCollator::SORT_NUMERIC
|
||||
* StubCollator::SORT_STRING
|
||||
*
|
||||
* @return Boolean True on success or false on failure
|
||||
*
|
||||
* @see http://www.php.net/manual/en/collator.sort.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
public function sort(&$arr, $sortFlag = self::SORT_REGULAR)
|
||||
|
@ -20,24 +20,28 @@ abstract class StubIntl
|
||||
{
|
||||
/**
|
||||
* Indicates that no error occurred
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
const U_ZERO_ERROR = 0;
|
||||
|
||||
/**
|
||||
* Indicates that an invalid argument was passed
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
const U_ILLEGAL_ARGUMENT_ERROR = 1;
|
||||
|
||||
/**
|
||||
* Indicates that the parse() operation failed
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
const U_PARSE_ERROR = 9;
|
||||
|
||||
/**
|
||||
* All known error codes
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private static $errorCodes = array(
|
||||
@ -48,6 +52,7 @@ abstract class StubIntl
|
||||
|
||||
/**
|
||||
* The error messages of all known error codes
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private static $errorMessages = array(
|
||||
@ -58,6 +63,7 @@ abstract class StubIntl
|
||||
|
||||
/**
|
||||
* The error code of the last operation
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
private static $errorCode = self::U_ZERO_ERROR;
|
||||
@ -66,6 +72,7 @@ abstract class StubIntl
|
||||
* Returns whether the error code indicates a failure
|
||||
*
|
||||
* @param integer $errorCode The error code returned by StubIntl::getErrorCode()
|
||||
*
|
||||
* @return Boolean
|
||||
*/
|
||||
static public function isFailure($errorCode)
|
||||
@ -102,8 +109,8 @@ abstract class StubIntl
|
||||
* Sets the current error code
|
||||
*
|
||||
* @param integer $code One of the error constants in this class
|
||||
* @throws \InvalidArgumentException If the code is not one of the error
|
||||
* constants in this class
|
||||
*
|
||||
* @throws \InvalidArgumentException If the code is not one of the error constants in this class
|
||||
*/
|
||||
static public function setErrorCode($code)
|
||||
{
|
||||
|
@ -48,6 +48,7 @@ class StubIntlDateFormatter
|
||||
|
||||
/**
|
||||
* Patterns used to format the date when no pattern is provided
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $defaultDateFormats = array(
|
||||
@ -60,6 +61,7 @@ class StubIntlDateFormatter
|
||||
|
||||
/**
|
||||
* Patterns used to format the time when no pattern is provided
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $defaultTimeFormats = array(
|
||||
@ -108,9 +110,11 @@ class StubIntlDateFormatter
|
||||
* @param string $timezone Timezone identifier
|
||||
* @param int $calendar Calendar to use for formatting or parsing; default is Gregorian.
|
||||
* One of the calendar constants.
|
||||
* @param string $pattern Optional pattern to use when formatting.
|
||||
* @param string $pattern Optional pattern to use when formatting
|
||||
*
|
||||
* @see http://www.php.net/manual/en/intldateformatter.create.php
|
||||
* @see http://userguide.icu-project.org/formatparse/datetime
|
||||
*
|
||||
* @throws MethodArgumentValueNotImplementedException When $locale different than 'en' is passed
|
||||
* @throws MethodArgumentValueNotImplementedException When $calendar different than GREGORIAN is passed
|
||||
*/
|
||||
@ -141,8 +145,10 @@ class StubIntlDateFormatter
|
||||
* @param int $calendar Calendar to use for formatting or parsing; default is Gregorian.
|
||||
* One of the calendar constants.
|
||||
* @param string $pattern Optional pattern to use when formatting
|
||||
*
|
||||
* @see http://www.php.net/manual/en/intldateformatter.create.php
|
||||
* @see http://userguide.icu-project.org/formatparse/datetime
|
||||
*
|
||||
* @throws MethodArgumentValueNotImplementedException When $locale different than 'en' is passed
|
||||
*/
|
||||
static public function create($locale, $datetype, $timetype, $timezone = null, $calendar = self::GREGORIAN, $pattern = null)
|
||||
@ -154,8 +160,11 @@ class StubIntlDateFormatter
|
||||
* Format the date/time value (timestamp) as a string
|
||||
*
|
||||
* @param mixed $timestamp Unix timestamp to format
|
||||
*
|
||||
* @return string The formatted value
|
||||
*
|
||||
* @see http://www.php.net/manual/en/intldateformatter.format.php
|
||||
*
|
||||
* @throws NotImplementedException If one of the formatting characters is not implemented
|
||||
*/
|
||||
public function format($timestamp)
|
||||
@ -182,6 +191,7 @@ class StubIntlDateFormatter
|
||||
* Returns the formatter's calendar
|
||||
*
|
||||
* @return int The calendar being used by the formatter
|
||||
*
|
||||
* @see http://www.php.net/manual/en/intldateformatter.getcalendar.php
|
||||
*/
|
||||
public function getCalendar()
|
||||
@ -193,6 +203,7 @@ class StubIntlDateFormatter
|
||||
* Returns the formatter's datetype
|
||||
*
|
||||
* @return int The current value of the formatter
|
||||
*
|
||||
* @see http://www.php.net/manual/en/intldateformatter.getdatetype.php
|
||||
*/
|
||||
public function getDateType()
|
||||
@ -204,6 +215,7 @@ class StubIntlDateFormatter
|
||||
* Returns formatter's last error code. Always returns the U_ZERO_ERROR class constant value
|
||||
*
|
||||
* @return int The error code from last formatter call
|
||||
*
|
||||
* @see http://www.php.net/manual/en/intldateformatter.geterrorcode.php
|
||||
*/
|
||||
public function getErrorCode()
|
||||
@ -215,6 +227,7 @@ class StubIntlDateFormatter
|
||||
* Returns formatter's last error message. Always returns the U_ZERO_ERROR_MESSAGE class constant value
|
||||
*
|
||||
* @return string The error message from last formatter call
|
||||
*
|
||||
* @see http://www.php.net/manual/en/intldateformatter.geterrormessage.php
|
||||
*/
|
||||
public function getErrorMessage()
|
||||
@ -226,7 +239,9 @@ class StubIntlDateFormatter
|
||||
* Returns the formatter's locale
|
||||
*
|
||||
* @param int $type The locale name type to return between valid or actual (StubLocale::VALID_LOCALE or StubLocale::ACTUAL_LOCALE, respectively)
|
||||
*
|
||||
* @return string The locale name used to create the formatter
|
||||
*
|
||||
* @see http://www.php.net/manual/en/intldateformatter.getlocale.php
|
||||
*/
|
||||
public function getLocale($type = StubLocale::ACTUAL_LOCALE)
|
||||
@ -238,6 +253,7 @@ class StubIntlDateFormatter
|
||||
* Returns the formatter's pattern
|
||||
*
|
||||
* @return string The pattern string used by the formatter
|
||||
*
|
||||
* @see http://www.php.net/manual/en/intldateformatter.getpattern.php
|
||||
*/
|
||||
public function getPattern()
|
||||
@ -249,6 +265,7 @@ class StubIntlDateFormatter
|
||||
* Returns the formatter's time type
|
||||
*
|
||||
* @return string The time type used by the formatter
|
||||
*
|
||||
* @see http://www.php.net/manual/en/intldateformatter.gettimetype.php
|
||||
*/
|
||||
public function getTimeType()
|
||||
@ -260,6 +277,7 @@ class StubIntlDateFormatter
|
||||
* Returns the formatter's timezone identifier
|
||||
*
|
||||
* @return string The timezone identifier used by the formatter
|
||||
*
|
||||
* @see http://www.php.net/manual/en/intldateformatter.gettimezoneid.php
|
||||
*/
|
||||
public function getTimeZoneId()
|
||||
@ -275,7 +293,9 @@ class StubIntlDateFormatter
|
||||
* Returns whether the formatter is lenient
|
||||
*
|
||||
* @return string The timezone identifier used by the formatter
|
||||
*
|
||||
* @see http://www.php.net/manual/en/intldateformatter.islenient.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
public function isLenient()
|
||||
@ -291,8 +311,11 @@ class StubIntlDateFormatter
|
||||
* If no error occurs before $value is consumed, $parse_pos will
|
||||
* contain -1 otherwise it will contain the position at which parsing
|
||||
* ended. If $parse_pos > strlen($value), the parse fails immediately.
|
||||
*
|
||||
* @return string Localtime compatible array of integers: contains 24 hour clock value in tm_hour field
|
||||
*
|
||||
* @see http://www.php.net/manual/en/intldateformatter.localtime.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
public function localtime($value, &$position = 0)
|
||||
@ -308,8 +331,11 @@ class StubIntlDateFormatter
|
||||
* If no error occurs before $value is consumed, $parse_pos will
|
||||
* contain -1 otherwise it will contain the position at which parsing
|
||||
* ended. If $parse_pos > strlen($value), the parse fails immediately.
|
||||
*
|
||||
* @return string Parsed value as a timestamp
|
||||
*
|
||||
* @see http://www.php.net/manual/en/intldateformatter.parse.php
|
||||
*
|
||||
* @throws MethodArgumentNotImplementedException When $position different than null, behavior not implemented
|
||||
*/
|
||||
public function parse($value, &$position = null)
|
||||
@ -331,8 +357,11 @@ class StubIntlDateFormatter
|
||||
* Set the formatter's calendar
|
||||
*
|
||||
* @param string $calendar The calendar to use. Default is IntlDateFormatter::GREGORIAN.
|
||||
*
|
||||
* @return Boolean true on success or false on failure
|
||||
*
|
||||
* @see http://www.php.net/manual/en/intldateformatter.setcalendar.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
public function setCalendar($calendar)
|
||||
@ -349,8 +378,11 @@ class StubIntlDateFormatter
|
||||
* invalid values ("February 30th") are not accepted.
|
||||
*
|
||||
* @param Boolean $lenient Sets whether the parser is lenient or not, default is false (strict)
|
||||
*
|
||||
* @return Boolean true on success or false on failure
|
||||
*
|
||||
* @see http://www.php.net/manual/en/intldateformatter.setlenient.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
public function setLenient($lenient)
|
||||
@ -362,7 +394,9 @@ class StubIntlDateFormatter
|
||||
* Set the formatter's pattern
|
||||
*
|
||||
* @param string $pattern A pattern string in conformance with the ICU IntlDateFormatter documentation
|
||||
*
|
||||
* @return Boolean true on success or false on failure
|
||||
*
|
||||
* @see http://www.php.net/manual/en/intldateformatter.setpattern.php
|
||||
* @see http://userguide.icu-project.org/formatparse/datetime
|
||||
*/
|
||||
@ -381,7 +415,9 @@ class StubIntlDateFormatter
|
||||
* @param string $timeZoneId The time zone ID string of the time zone to use.
|
||||
* If NULL or the empty string, the default time zone for the
|
||||
* runtime is used.
|
||||
*
|
||||
* @return Boolean true on success or false on failure
|
||||
*
|
||||
* @see http://www.php.net/manual/en/intldateformatter.settimezoneid.php
|
||||
*/
|
||||
public function setTimeZoneId($timeZoneId)
|
||||
@ -419,6 +455,7 @@ class StubIntlDateFormatter
|
||||
* current time zone
|
||||
*
|
||||
* @param int $timestamp
|
||||
*
|
||||
* @return DateTime
|
||||
*/
|
||||
protected function createDateTime($timestamp)
|
||||
@ -432,6 +469,7 @@ class StubIntlDateFormatter
|
||||
|
||||
/**
|
||||
* Returns a pattern string based in the datetype and timetype values
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getDefaultPattern()
|
||||
|
@ -38,30 +38,35 @@ class StubLocale
|
||||
|
||||
/**
|
||||
* Caches the countries
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static $countries = array();
|
||||
|
||||
/**
|
||||
* Caches the languages
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static $languages = array();
|
||||
|
||||
/**
|
||||
* Caches the locales
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static $locales = array();
|
||||
|
||||
/**
|
||||
* Caches the currencies
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static $currencies = array();
|
||||
|
||||
/**
|
||||
* Caches the currencies names
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static $currenciesNames = array();
|
||||
@ -70,7 +75,9 @@ class StubLocale
|
||||
* 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 InvalidArgumentException When the locale is different than 'en'
|
||||
*/
|
||||
static public function getDisplayCountries($locale)
|
||||
@ -92,7 +99,9 @@ class StubLocale
|
||||
* 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 InvalidArgumentException When the locale is different than 'en'
|
||||
*/
|
||||
static public function getDisplayLanguages($locale)
|
||||
@ -114,7 +123,9 @@ class StubLocale
|
||||
* Returns the locale names for a locale
|
||||
*
|
||||
* @param string $locale The locale to use for the locale names
|
||||
*
|
||||
* @return array The locale names with their codes as keys
|
||||
*
|
||||
* @throws InvalidArgumentException When the locale is different than 'en'
|
||||
*/
|
||||
static public function getDisplayLocales($locale)
|
||||
@ -148,7 +159,9 @@ class StubLocale
|
||||
* Returns the currencies names for a locale
|
||||
*
|
||||
* @param string $locale The locale to use for the currencies names
|
||||
*
|
||||
* @return array The currencies names with their codes as keys
|
||||
*
|
||||
* @throws InvalidArgumentException When the locale is different than 'en'
|
||||
*/
|
||||
static public function getDisplayCurrencies($locale)
|
||||
@ -180,8 +193,11 @@ class StubLocale
|
||||
* Returns the best available locale based on HTTP "Accept-Language" header according to RFC 2616
|
||||
*
|
||||
* @param string $header The string containing the "Accept-Language" header value
|
||||
*
|
||||
* @return string The corresponding locale code
|
||||
*
|
||||
* @see http://www.php.net/manual/en/locale.acceptfromhttp.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
static public function acceptFromHttp($header)
|
||||
@ -193,8 +209,11 @@ class StubLocale
|
||||
* Returns a correctly ordered and delimited locale code
|
||||
*
|
||||
* @param array $subtags A keyed array where the keys identify the particular locale code subtag
|
||||
*
|
||||
* @return string The corresponding locale code
|
||||
*
|
||||
* @see http://www.php.net/manual/en/locale.composelocale.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
static public function composeLocale(array $subtags)
|
||||
@ -208,8 +227,11 @@ class StubLocale
|
||||
* @param string $langtag The language tag to check
|
||||
* @param string $locale The language range to check against
|
||||
* @param Boolean $canonicalize
|
||||
*
|
||||
* @return string The corresponding locale code
|
||||
*
|
||||
* @see http://www.php.net/manual/en/locale.filtermatches.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
static public function filterMatches($langtag, $locale, $canonicalize = false)
|
||||
@ -221,8 +243,11 @@ class StubLocale
|
||||
* Returns the variants for the input locale
|
||||
*
|
||||
* @param string $locale The locale to extract the variants from
|
||||
*
|
||||
* @return array The locale variants
|
||||
*
|
||||
* @see http://www.php.net/manual/en/locale.getallvariants.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
static public function getAllVariants($locale)
|
||||
@ -234,7 +259,9 @@ class StubLocale
|
||||
* Returns the default locale
|
||||
*
|
||||
* @return string The default locale code. Always returns 'en'
|
||||
*
|
||||
* @see http://www.php.net/manual/en/locale.getdefault.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
static public function getDefault()
|
||||
@ -247,8 +274,11 @@ class StubLocale
|
||||
*
|
||||
* @param string $locale The locale code to return the display language from
|
||||
* @param string $inLocale Optional format locale code to use to display the language name
|
||||
*
|
||||
* @return string The localized language display name
|
||||
*
|
||||
* @see http://www.php.net/manual/en/locale.getdisplaylanguage.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
static public function getDisplayLanguage($locale, $inLocale = null)
|
||||
@ -261,8 +291,11 @@ class StubLocale
|
||||
*
|
||||
* @param string $locale The locale code to return the display locale name from
|
||||
* @param string $inLocale Optional format locale code to use to display the locale name
|
||||
*
|
||||
* @return string The localized locale display name
|
||||
*
|
||||
* @see http://www.php.net/manual/en/locale.getdisplayname.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
static public function getDisplayName($locale, $inLocale = null)
|
||||
@ -275,8 +308,11 @@ class StubLocale
|
||||
*
|
||||
* @param string $locale The locale code to return the display region from
|
||||
* @param string $inLocale Optional format locale code to use to display the region name
|
||||
*
|
||||
* @return string The localized region display name
|
||||
*
|
||||
* @see http://www.php.net/manual/en/locale.getdisplayregion.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
static public function getDisplayRegion($locale, $inLocale = null)
|
||||
@ -289,8 +325,11 @@ class StubLocale
|
||||
*
|
||||
* @param string $locale The locale code to return the display script from
|
||||
* @param string $inLocale Optional format locale code to use to display the script name
|
||||
*
|
||||
* @return string The localized script display name
|
||||
*
|
||||
* @see http://www.php.net/manual/en/locale.getdisplayscript.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
static public function getDisplayScript($locale, $inLocale = null)
|
||||
@ -303,8 +342,11 @@ class StubLocale
|
||||
*
|
||||
* @param string $locale The locale code to return the display variant from
|
||||
* @param string $inLocale Optional format locale code to use to display the variant name
|
||||
*
|
||||
* @return string The localized variant display name
|
||||
*
|
||||
* @see http://www.php.net/manual/en/locale.getdisplayvariant.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
static public function getDisplayVariant($locale, $inLocale = null)
|
||||
@ -316,8 +358,11 @@ class StubLocale
|
||||
* Returns the keywords for the locale
|
||||
*
|
||||
* @param string $locale The locale code to extract the keywords from
|
||||
*
|
||||
* @return array Associative array with the extracted variants
|
||||
*
|
||||
* @see http://www.php.net/manual/en/locale.getkeywords.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
static public function getKeywords($locale)
|
||||
@ -329,8 +374,11 @@ class StubLocale
|
||||
* Returns the primary language for the locale
|
||||
*
|
||||
* @param string $locale The locale code to extract the language code from
|
||||
*
|
||||
* @return string|null The extracted language code or null in case of error
|
||||
*
|
||||
* @see http://www.php.net/manual/en/locale.getprimarylanguage.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
static public function getPrimaryLanguage($locale)
|
||||
@ -342,8 +390,11 @@ class StubLocale
|
||||
* Returns the region for the locale
|
||||
*
|
||||
* @param string $locale The locale code to extract the region code from
|
||||
*
|
||||
* @return string|null The extracted region code or null if not present
|
||||
*
|
||||
* @see http://www.php.net/manual/en/locale.getregion.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
static public function getRegion($locale)
|
||||
@ -355,8 +406,11 @@ class StubLocale
|
||||
* Returns the script for the locale
|
||||
*
|
||||
* @param string $locale The locale code to extract the script code from
|
||||
*
|
||||
* @return string|null The extracted script code or null if not present
|
||||
*
|
||||
* @see http://www.php.net/manual/en/locale.getscript.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
static public function getScript($locale)
|
||||
@ -371,7 +425,9 @@ class StubLocale
|
||||
* @param string $locale The locale to use as the language range when matching
|
||||
* @param Boolean $canonicalize If true, the arguments will be converted to canonical form before matching
|
||||
* @param string $default The locale to use if no match is found
|
||||
*
|
||||
* @see http://www.php.net/manual/en/locale.lookup.php
|
||||
*
|
||||
* @throws RuntimeException When the intl extension is not loaded
|
||||
*/
|
||||
static public function lookup(array $langtag, $locale, $canonicalize = false, $default = null)
|
||||
@ -383,8 +439,11 @@ class StubLocale
|
||||
* Returns an associative array of locale identifier subtags
|
||||
*
|
||||
* @param string $locale The locale code to extract the subtag array from
|
||||
*
|
||||
* @return array Associative array with the extracted subtags
|
||||
*
|
||||
* @see http://www.php.net/manual/en/locale.parselocale.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
static public function parseLocale($locale)
|
||||
@ -396,8 +455,11 @@ class StubLocale
|
||||
* Sets the default runtime locale
|
||||
*
|
||||
* @param string $locale The locale code
|
||||
*
|
||||
* @return Boolean true on success or false on failure
|
||||
*
|
||||
* @see http://www.php.net/manual/en/locale.parselocale.php
|
||||
*
|
||||
* @throws MethodNotImplementedException
|
||||
*/
|
||||
static public function setDefault($locale)
|
||||
@ -411,7 +473,9 @@ class StubLocale
|
||||
* @param string $locale The locale code
|
||||
* @param string $cacheVariable The name of a static attribute to cache the data to
|
||||
* @param string $stubDataDir The stub data directory name
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws InvalidArgumentException When the locale is different than 'en'
|
||||
*/
|
||||
static private function getStubData($locale, $cacheVariable, $stubDataDir)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user