From 80e398a6a637f6d410fab995e982a439e70da46d Mon Sep 17 00:00:00 2001 From: Nikita Konstantinov Date: Mon, 31 Dec 2012 22:32:06 +0400 Subject: [PATCH] fix typos in 2.0 --- book/http_fundamentals.rst | 2 +- book/propel.rst | 2 +- book/validation.rst | 2 +- components/console/single_command_tool.rst | 2 +- components/dependency_injection/compilation.rst | 2 +- components/event_dispatcher/introduction.rst | 2 +- components/routing/introduction.rst | 6 +++--- components/security/authentication.rst | 12 +++++++----- cookbook/form/create_form_type_extension.rst | 1 + cookbook/security/custom_provider.rst | 2 +- reference/constraints/Callback.rst | 1 + reference/dic_tags.rst | 2 +- 12 files changed, 20 insertions(+), 16 deletions(-) diff --git a/book/http_fundamentals.rst b/book/http_fundamentals.rst index 0cc1bc77356..c39d0889856 100644 --- a/book/http_fundamentals.rst +++ b/book/http_fundamentals.rst @@ -366,7 +366,7 @@ on that value. This can get ugly quickly:: $request = Request::createFromGlobals(); $path = $request->getPathInfo(); // the URI path being requested - if (in_array($path, array('', '/')) { + if (in_array($path, array('', '/'))) { $response = new Response('Welcome to the homepage.'); } elseif ($path == '/contact') { $response = new Response('Contact us'); diff --git a/book/propel.rst b/book/propel.rst index eee45951cf2..590b510511d 100644 --- a/book/propel.rst +++ b/book/propel.rst @@ -263,7 +263,7 @@ If you want to reuse some queries, you can add your own methods to the public function filterByExpensivePrice() { return $this - ->filterByPrice(array('min' => 1000)) + ->filterByPrice(array('min' => 1000)); } } diff --git a/book/validation.rst b/book/validation.rst index fd013cd5f2c..8d441201442 100644 --- a/book/validation.rst +++ b/book/validation.rst @@ -815,7 +815,7 @@ it looks like this:: // this IS a valid email address, do something } else { // this is *not* a valid email address - $errorMessage = $errorList[0]->getMessage() + $errorMessage = $errorList[0]->getMessage(); // ... do something with the error } diff --git a/components/console/single_command_tool.rst b/components/console/single_command_tool.rst index b3ff5172305..ba3cceffbf9 100644 --- a/components/console/single_command_tool.rst +++ b/components/console/single_command_tool.rst @@ -37,7 +37,7 @@ it is possible to remove this need by extending the application:: { // Keep the core default commands to have the HelpCommand // which is used when using the --help option - $defaultCommands = parent::getDefaultCommands() + $defaultCommands = parent::getDefaultCommands(); $defaultCommands[] = new MyCommand(); diff --git a/components/dependency_injection/compilation.rst b/components/dependency_injection/compilation.rst index b7c54d19484..c136a4149ba 100644 --- a/components/dependency_injection/compilation.rst +++ b/components/dependency_injection/compilation.rst @@ -213,7 +213,7 @@ benefit of merging multiple files and validation of the configuration:: $processor = new Processor(); $config = $processor->processConfiguration($configuration, $configs); - $container->setParameter('acme_demo.FOO', $config['foo']) + $container->setParameter('acme_demo.FOO', $config['foo']); // ... } diff --git a/components/event_dispatcher/introduction.rst b/components/event_dispatcher/introduction.rst index 2ac615548bb..d3fcb90ec4a 100644 --- a/components/event_dispatcher/introduction.rst +++ b/components/event_dispatcher/introduction.rst @@ -200,7 +200,7 @@ instance of ``Symfony\Component\HttpKernel\Event\FilterResponseEvent``: .. code-block:: php - use Symfony\Component\HttpKernel\Event\FilterResponseEvent + use Symfony\Component\HttpKernel\Event\FilterResponseEvent; public function onKernelResponse(FilterResponseEvent $event) { diff --git a/components/routing/introduction.rst b/components/routing/introduction.rst index e57f97e8df5..2dc15adb15f 100644 --- a/components/routing/introduction.rst +++ b/components/routing/introduction.rst @@ -33,7 +33,7 @@ your autoloader to load the Routing component:: use Symfony\Component\Routing\RouteCollection; use Symfony\Component\Routing\Route; - $route = new Route('/foo', array('controller' => 'MyController')) + $route = new Route('/foo', array('controller' => 'MyController')); $routes = new RouteCollection(); $routes->add('route_name', $route); @@ -322,9 +322,9 @@ automatically in the background if you want to use it. A basic example of the $router = new Router( new YamlFileLoader($locator), - "routes.yml", + 'routes.yml', array('cache_dir' => __DIR__.'/cache'), - $requestContext, + $requestContext ); $router->match('/foo/bar'); diff --git a/components/security/authentication.rst b/components/security/authentication.rst index ad9efbf8b78..969b6dded6b 100644 --- a/components/security/authentication.rst +++ b/components/security/authentication.rst @@ -130,11 +130,13 @@ password was valid:: use Symfony\Component\Security\Core\Encoder\EncoderFactory; $userProvider = new InMemoryUserProvider( - array('admin' => array( - // password is "foo" - 'password' => '5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg==', - 'roles' => array('ROLE_ADMIN'), - ), + array( + 'admin' => array( + // password is "foo" + 'password' => '5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg==', + 'roles' => array('ROLE_ADMIN'), + ), + ) ); // for some extra checks: is account enabled, locked, expired, etc.? diff --git a/cookbook/form/create_form_type_extension.rst b/cookbook/form/create_form_type_extension.rst index 377b808e563..4444b5053f7 100644 --- a/cookbook/form/create_form_type_extension.rst +++ b/cookbook/form/create_form_type_extension.rst @@ -170,6 +170,7 @@ database):: return $webPath; } + } Your form type extension class will need to do two things in order to extend the ``file`` form type: diff --git a/cookbook/security/custom_provider.rst b/cookbook/security/custom_provider.rst index 7367bb14556..fd1c7015105 100644 --- a/cookbook/security/custom_provider.rst +++ b/cookbook/security/custom_provider.rst @@ -134,7 +134,7 @@ Here's an example of how this might look:: // ... - return new WebserviceUser($username, $password, $salt, $roles) + return new WebserviceUser($username, $password, $salt, $roles); } throw new UsernameNotFoundException(sprintf('Username "%s" does not exist.', $username)); diff --git a/reference/constraints/Callback.rst b/reference/constraints/Callback.rst index 027e534b922..2515fb170aa 100644 --- a/reference/constraints/Callback.rst +++ b/reference/constraints/Callback.rst @@ -90,6 +90,7 @@ those errors should be attributed:: $context->addViolation('This name sounds totally fake!', array(), null); } } + } Options ------- diff --git a/reference/dic_tags.rst b/reference/dic_tags.rst index 952056e76ff..c44ff3d88a4 100644 --- a/reference/dic_tags.rst +++ b/reference/dic_tags.rst @@ -558,7 +558,7 @@ other source, first create a class that implements the // src/Acme/MainBundle/Translation/MyCustomLoader.php namespace Acme\MainBundle\Translation; - use Symfony\Component\Translation\Loader\LoaderInterface + use Symfony\Component\Translation\Loader\LoaderInterface; use Symfony\Component\Translation\MessageCatalogue; class MyCustomLoader implements LoaderInterface