diff --git a/assetic/asset_management.rst b/assetic/asset_management.rst index ffc189f62ca..88b11a4cfdd 100644 --- a/assetic/asset_management.rst +++ b/assetic/asset_management.rst @@ -328,7 +328,7 @@ configuration under the ``assetic`` section. Read more in the ), ), ), - ); + )); After you have defined the named assets, you can reference them in your templates with the ``@named_asset`` notation: diff --git a/assetic/jpeg_optimize.rst b/assetic/jpeg_optimize.rst index e11b365c62c..b16c7c9a976 100644 --- a/assetic/jpeg_optimize.rst +++ b/assetic/jpeg_optimize.rst @@ -232,7 +232,6 @@ following configuration: ), 'twig' => array( 'functions' => array('jpegoptim'), - ), ), )); @@ -294,7 +293,7 @@ file: 'twig' => array( 'functions' => array( 'jpegoptim' => array( - output => 'images/*.jpg' + 'output' => 'images/*.jpg' ), ), ), diff --git a/assetic/uglifyjs.rst b/assetic/uglifyjs.rst index 784550fa227..9d989fb807b 100644 --- a/assetic/uglifyjs.rst +++ b/assetic/uglifyjs.rst @@ -168,11 +168,11 @@ can configure its location using the ``node`` key: // app/config/config.php $container->loadFromExtension('assetic', array( - 'node' => '/usr/bin/nodejs', + 'node' => '/usr/bin/nodejs', 'uglifyjs2' => array( - // the path to the uglifyjs executable - 'bin' => '/usr/local/bin/uglifyjs', - ), + // the path to the uglifyjs executable + 'bin' => '/usr/local/bin/uglifyjs', + ), )); Minify your Assets diff --git a/components/routing.rst b/components/routing.rst index f6af13d1fac..686faf31ccb 100644 --- a/components/routing.rst +++ b/components/routing.rst @@ -206,6 +206,9 @@ to find a route that fits the given request you can also build a URL from a certain route:: use Symfony\Component\Routing\Generator\UrlGenerator; + use Symfony\Component\Routing\RequestContext; + use Symfony\Component\Routing\Route; + use Symfony\Component\Routing\RouteCollection; $routes = new RouteCollection(); $routes->add('show_post', new Route('/show/{slug}')); @@ -321,7 +324,7 @@ a path to the main route definition and some other settings:: $resource, array $options = array(), RequestContext $context = null, - array $defaults = array() + LoggerInterface $logger = null ); With the ``cache_dir`` option you can enable route caching (if you provide a diff --git a/components/security/authentication.rst b/components/security/authentication.rst index 753c7d00b7f..f8b9dc8aac4 100644 --- a/components/security/authentication.rst +++ b/components/security/authentication.rst @@ -76,6 +76,7 @@ The default authentication manager is an instance of :class:`Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationProviderManager`:: use Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager; + use Symfony\Component\Security\Core\Exception\AuthenticationException; // instances of Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface $providers = array(...); @@ -234,6 +235,7 @@ own, it just needs to follow these rules: } // ... + } } Using Password Encoders diff --git a/configuration.rst b/configuration.rst index 96e8ff206a7..eeafbcc1453 100644 --- a/configuration.rst +++ b/configuration.rst @@ -316,7 +316,7 @@ configure DoctrineBundle and other parts of Symfony: .. code-block:: php // app/config/config.php - $configuration->loadFromExtension('doctrine', array( + $container->loadFromExtension('doctrine', array( 'dbal' => array( 'driver' => 'pdo_mysql', // ... diff --git a/configuration/environments.rst b/configuration/environments.rst index e381040231c..f89ce2d6501 100644 --- a/configuration/environments.rst +++ b/configuration/environments.rst @@ -294,7 +294,7 @@ The best way to accomplish this is via a new environment called, for example, .. code-block:: php // app/config/config_benchmark.php - $loader->import('config_prod.php') + $loader->import('config_prod.php'); $container->loadFromExtension('framework', array( 'profiler' => array('only_exceptions' => false), diff --git a/controller/service.rst b/controller/service.rst index db5ebd4cc24..2c74798b8fa 100644 --- a/controller/service.rst +++ b/controller/service.rst @@ -335,7 +335,7 @@ controller: $templating = $this->templating; $callback = function () use ($templating, $view, $parameters) { $templating->stream($view, $parameters); - } + }; return new StreamedResponse($callback); diff --git a/doctrine.rst b/doctrine.rst index 5e44a7f0f54..faabea88c27 100644 --- a/doctrine.rst +++ b/doctrine.rst @@ -95,7 +95,7 @@ information. By convention, this information is usually configured in an .. code-block:: php // app/config/config.php - $configuration->loadFromExtension('doctrine', array( + $container->loadFromExtension('doctrine', array( 'dbal' => array( 'driver' => 'pdo_mysql', 'host' => '%database_host%', diff --git a/form/action_method.rst b/form/action_method.rst index 27fdddfb1ac..f92bcaf3a69 100644 --- a/form/action_method.rst +++ b/form/action_method.rst @@ -47,7 +47,7 @@ to the ``form()`` or the ``form_start()`` helper functions: .. code-block:: html+php - + start($form, array( 'action' => $view['router']->generate('target_route'), 'method' => 'GET', diff --git a/form/create_form_type_extension.rst b/form/create_form_type_extension.rst index e467c20508f..4368d920c4c 100644 --- a/form/create_form_type_extension.rst +++ b/form/create_form_type_extension.rst @@ -120,7 +120,7 @@ tag: $container ->register('app.image_type_extension', ImageTypeExtension::class) - ->addTag('form.type_extension', array('alias' => 'file')); + ->addTag('form.type_extension', array('alias' => 'file')) ; The ``alias`` key of the tag is the type of field that this extension should diff --git a/form/data_transformers.rst b/form/data_transformers.rst index b75ef91b733..c6a69fba3a9 100644 --- a/form/data_transformers.rst +++ b/form/data_transformers.rst @@ -35,7 +35,7 @@ Suppose you have a Task form with a tags ``text`` type:: { public function buildForm(FormBuilderInterface $builder, array $options) { - $builder->add('tags', 'text') + $builder->add('tags', 'text'); } public function configureOptions(OptionsResolver $resolver) diff --git a/form/without_class.rst b/form/without_class.rst index 411a07853e8..f98d357915c 100644 --- a/form/without_class.rst +++ b/form/without_class.rst @@ -104,4 +104,4 @@ but here's a short example: .. code-block:: php - new NotBlank(array('groups' => array('create', 'update'))) + new NotBlank(array('groups' => array('create', 'update'))); diff --git a/http_cache/cache_invalidation.rst b/http_cache/cache_invalidation.rst index 9c649d4df85..a67adb470c4 100644 --- a/http_cache/cache_invalidation.rst +++ b/http_cache/cache_invalidation.rst @@ -74,9 +74,9 @@ Here is how you can configure the Symfony reverse proxy to support the $response = new Response(); if ($this->getStore()->purge($request->getUri())) { - $response->setStatusCode(200, 'Purged'); + $response->setStatusCode(Response::HTTP_OK, 'Purged'); } else { - $response->setStatusCode(404, 'Not found'); + $response->setStatusCode(Response::HTTP_NOT_FOUND, 'Not found'); } return $response; diff --git a/http_cache/esi.rst b/http_cache/esi.rst index 5d881be67a2..494865d0aa0 100644 --- a/http_cache/esi.rst +++ b/http_cache/esi.rst @@ -137,9 +137,10 @@ matter), Symfony uses the standard ``render`` helper to configure ESI tags: .. code-block:: html+php - + render( new ControllerReference( 'AppBundle:News:latest', @@ -148,15 +149,17 @@ matter), Symfony uses the standard ``render`` helper to configure ESI tags: array('strategy' => 'esi') ) ?> + render( $view['router']->generate( 'latest_news', array('maxPerPage' => 5), UrlGeneratorInterface::ABSOLUTE_URL ), - array('strategy' => 'esi'), + array('strategy' => 'esi') ) ?> By using the ``esi`` renderer (via the ``render_esi()`` Twig function), you @@ -234,7 +237,7 @@ that must be enabled in your configuration: + xsi:schemaLocation="http://symfony.com/schema/routing + http://symfony.com/schema/routing/routing-1.0.xsd"> AcmeDemoBundle:Main:mobileHomepage @@ -251,7 +252,8 @@ You can also set the host option on imported routes: + xsi:schemaLocation="http://symfony.com/schema/routing + http://symfony.com/schema/routing/routing-1.0.xsd"> diff --git a/routing/requirements.rst b/routing/requirements.rst index 1cf881203e8..d51ed7163ba 100644 --- a/routing/requirements.rst +++ b/routing/requirements.rst @@ -184,7 +184,7 @@ accomplished with the following route configuration: .. code-block:: php-annotations - // src/AppBundle/Controller/MainController.php + // src/AppBundle/Controller/BlogApiController.php namespace AppBundle\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; diff --git a/security.rst b/security.rst index 00ed80fc157..d76139854e8 100644 --- a/security.rst +++ b/security.rst @@ -86,11 +86,11 @@ configuration looks like this: ), 'firewalls' => array( 'dev' => array( - 'pattern' => '^/(_(profiler|wdt)|css|images|js)/', - 'security' => false, + 'pattern' => '^/(_(profiler|wdt)|css|images|js)/', + 'security' => false, ), 'default' => array( - 'anonymous' => null, + 'anonymous' => null, ), ), )); @@ -257,7 +257,7 @@ user to be logged in to access this URL: ), 'access_control' => array( // require ROLE_ADMIN for /admin* - array('path' => '^/admin', 'role' => 'ROLE_ADMIN'), + array('path' => '^/admin', 'roles' => 'ROLE_ADMIN'), ), )); diff --git a/security/acl.rst b/security/acl.rst index a4d8b6c27ea..e8b9254eea3 100644 --- a/security/acl.rst +++ b/security/acl.rst @@ -77,10 +77,12 @@ First, you need to configure the connection the ACL system is supposed to use: .. code-block:: php // app/config/security.php - $container->loadFromExtension('security', 'acl', array( + $container->loadFromExtension('security', array( // ... - - 'connection' => 'default', + + 'acl' => array( + 'connection' => 'default', + ), )); .. note:: diff --git a/security/impersonating_user.rst b/security/impersonating_user.rst index a8a4d162a46..9b7224bb5ea 100644 --- a/security/impersonating_user.rst +++ b/security/impersonating_user.rst @@ -97,7 +97,7 @@ to show a link to exit impersonation: " > Exit impersonation diff --git a/security/pre_authenticated.rst b/security/pre_authenticated.rst index 80f6acb25a7..bd3cd326cd5 100644 --- a/security/pre_authenticated.rst +++ b/security/pre_authenticated.rst @@ -142,7 +142,7 @@ corresponding firewall in your security configuration: $container->loadFromExtension('security', array( 'firewalls' => array( 'secured_area' => array( - 'pattern' => '^/' + 'pattern' => '^/', 'remote_user' => array( 'provider' => 'your_user_provider', ), diff --git a/security/voters.rst b/security/voters.rst index b74c6fe615f..1b247441fc0 100644 --- a/security/voters.rst +++ b/security/voters.rst @@ -279,7 +279,7 @@ security configuration: > - + diff --git a/service_container.rst b/service_container.rst index a78cc69f011..a21448dedb4 100644 --- a/service_container.rst +++ b/service_container.rst @@ -444,7 +444,7 @@ Injecting the dependency by the setter method just needs a change of syntax: $container->setDefinition('app.mailer', ...); - $definition = new Definition(NewsletterManager::class) + $definition = new Definition(NewsletterManager::class); $definition->addMethodCall('setMailer', array( new Reference('app.mailer'), )); diff --git a/session/php_bridge.rst b/session/php_bridge.rst index 50ee2a15ddf..c122337c0c8 100644 --- a/session/php_bridge.rst +++ b/session/php_bridge.rst @@ -42,6 +42,7 @@ for the ``handler_id``: 'session' => array( 'storage_id' => 'session.storage.php_bridge', 'handler_id' => null, + ), )); Otherwise, if the problem is simply that you cannot avoid the application @@ -77,6 +78,7 @@ the example below: 'session' => array( 'storage_id' => 'session.storage.php_bridge', 'handler_id' => 'session.storage.native_file', + ), )); .. note:: diff --git a/templating/namespaced_paths.rst b/templating/namespaced_paths.rst index 7b4d1ce7e6f..dbca09b30cd 100644 --- a/templating/namespaced_paths.rst +++ b/templating/namespaced_paths.rst @@ -68,7 +68,7 @@ directory: $container->loadFromExtension('twig', array( 'paths' => array( '%kernel.root_dir%/../vendor/acme/foo-bar/templates' => 'foo_bar', - ); + ) )); .. caution:: diff --git a/testing/database.rst b/testing/database.rst index 6ea86ec45c6..82abbc12125 100644 --- a/testing/database.rst +++ b/testing/database.rst @@ -145,7 +145,7 @@ configuration: .. code-block:: php // app/config/config_test.php - $configuration->loadFromExtension('doctrine', array( + $container->loadFromExtension('doctrine', array( 'dbal' => array( 'host' => 'localhost', 'dbname' => 'testdb', diff --git a/validation.rst b/validation.rst index f65c62e0fd8..9322197b5f4 100644 --- a/validation.rst +++ b/validation.rst @@ -155,7 +155,7 @@ message: .. code-block:: text - AppBundle\Author.name: + AppBundle\Entity\Author.name: This value should not be blank If you insert a value into the ``name`` property, the happy success message diff --git a/validation/sequence_provider.rst b/validation/sequence_provider.rst index ae1dd0e144e..bcf2f388e86 100644 --- a/validation/sequence_provider.rst +++ b/validation/sequence_provider.rst @@ -234,10 +234,10 @@ entity and a new constraint group called ``Premium``: public static function loadValidatorMetadata(ClassMetadata $metadata) { $metadata->addPropertyConstraint('name', new Assert\NotBlank()); - $metadata->addPropertyConstraint('creditCard', new Assert\CardScheme( + $metadata->addPropertyConstraint('creditCard', new Assert\CardScheme(array( 'schemes' => array('VISA'), 'groups' => array('Premium'), - )); + ))); } }