From 9eeb2a9ee566c89b93a8a6bcd87a7be86eb26ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brikou=20Carr=C3=A9?= Date: Mon, 25 Jun 2012 16:01:44 +0200 Subject: [PATCH 1/6] fixed cs of php parts --- book/doctrine.rst | 10 +++++--- book/forms.rst | 4 +++ book/page_creation.rst | 5 ++-- book/security.rst | 1 + book/testing.rst | 5 +++- book/translation.rst | 1 + book/validation.rst | 1 + cookbook/bundles/extension.rst | 2 ++ cookbook/bundles/inheritance.rst | 6 +++-- cookbook/console/console_command.rst | 1 + .../doctrine/event_listeners_subscribers.rst | 7 +++--- cookbook/doctrine/file_uploads.rst | 1 + cookbook/doctrine/reverse_engineering.rst | 1 + cookbook/form/create_custom_field_type.rst | 4 ++- cookbook/form/data_transformers.rst | 4 +-- cookbook/form/dynamic_form_generation.rst | 13 +++++----- cookbook/form/form_collections.rst | 25 +++++++++++-------- cookbook/form/use_virtuals_forms.rst | 7 +++++- .../custom_authentication_provider.rst | 12 ++++++--- cookbook/security/custom_provider.rst | 6 +++-- cookbook/security/entity_provider.rst | 2 -- cookbook/security/target_path.rst | 1 + cookbook/service_container/event_listener.rst | 6 +++-- cookbook/templating/twig_extension.rst | 5 ++-- quick_tour/the_big_picture.rst | 1 + reference/constraints/File.rst | 1 + reference/constraints/Image.rst | 1 + reference/constraints/True.rst | 1 + reference/dic_tags.rst | 3 +++ 29 files changed, 92 insertions(+), 45 deletions(-) diff --git a/book/doctrine.rst b/book/doctrine.rst index dc5a90ada65..efeda031103 100644 --- a/book/doctrine.rst +++ b/book/doctrine.rst @@ -93,7 +93,8 @@ Without even thinking about Doctrine or databases, you already know that you need a ``Product`` object to represent those products. Create this class inside the ``Entity`` directory of your ``AcmeStoreBundle``:: - // src/Acme/StoreBundle/Entity/Product.php + // src/Acme/StoreBundle/Entity/Product.php + namespace Acme\StoreBundle\Entity; class Product @@ -369,7 +370,7 @@ of the bundle: use Acme\StoreBundle\Entity\Product; use Symfony\Component\HttpFoundation\Response; // ... - + public function createAction() { $product = new Product(); @@ -733,6 +734,7 @@ ordered alphabetically. .. code-block:: php // src/Acme/StoreBundle/Repository/ProductRepository.php + namespace Acme\StoreBundle\Repository; use Doctrine\ORM\EntityRepository; @@ -1058,7 +1060,7 @@ can avoid the second query by issuing a join in the original query. Add the following method to the ``ProductRepository`` class:: // src/Acme/StoreBundle/Repository/ProductRepository.php - + public function findOneByIdJoinedToCategory($id) { $query = $this->getManager() @@ -1067,7 +1069,7 @@ following method to the ``ProductRepository`` class:: JOIN p.category c WHERE p.id = :id' )->setParameter('id', $id); - + try { return $query->getSingleResult(); } catch (\Doctrine\ORM\NoResultException $e) { diff --git a/book/forms.rst b/book/forms.rst index b7c3750370e..ff0d30480e1 100644 --- a/book/forms.rst +++ b/book/forms.rst @@ -29,6 +29,7 @@ going to need to build a form. But before you begin, first focus on the generic .. code-block:: php // src/Acme/TaskBundle/Entity/Task.php + namespace Acme\TaskBundle\Entity; class Task @@ -85,6 +86,7 @@ object and then rendering it in a template. For now, this can all be done from inside a controller:: // src/Acme/TaskBundle/Controller/DefaultController.php + namespace Acme\TaskBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; @@ -939,6 +941,7 @@ Suppose that each ``Task`` belongs to a simple ``Category`` object. Start, of course, by creating the ``Category`` object:: // src/Acme/TaskBundle/Entity/Category.php + namespace Acme\TaskBundle\Entity; use Symfony\Component\Validator\Constraints as Assert; @@ -981,6 +984,7 @@ Now that your application has been updated to reflect the new requirements, create a form class so that a ``Category`` object can be modified by the user:: // src/Acme/TaskBundle/Form/Type/CategoryType.php + namespace Acme\TaskBundle\Form\Type; use Symfony\Component\Form\AbstractType; diff --git a/book/page_creation.rst b/book/page_creation.rst index c3dbf9e4368..1bdda0df66a 100644 --- a/book/page_creation.rst +++ b/book/page_creation.rst @@ -207,9 +207,8 @@ called ``Acme\HelloBundle\Controller\Hello``. Start by creating this file inside your ``AcmeHelloBundle``:: // src/Acme/HelloBundle/Controller/HelloController.php - namespace Acme\HelloBundle\Controller; - use Symfony\Component\HttpFoundation\Response; + namespace Acme\HelloBundle\Controller; class HelloController { @@ -282,6 +281,7 @@ of writing the HTML inside the controller, render a template instead: :linenos: // src/Acme/HelloBundle/Controller/HelloController.php + namespace Acme\HelloBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; @@ -625,6 +625,7 @@ Start by creating a ``src/Acme/TestBundle/`` directory and adding a new file called ``AcmeTestBundle.php``:: // src/Acme/TestBundle/AcmeTestBundle.php + namespace Acme\TestBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; diff --git a/book/security.rst b/book/security.rst index 8d48089aba5..f209b0054b0 100644 --- a/book/security.rst +++ b/book/security.rst @@ -997,6 +997,7 @@ be stored in the database. .. code-block:: php // src/Acme/UserBundle/Entity/User.php + namespace Acme\UserBundle\Entity; use Symfony\Component\Security\Core\User\UserInterface; diff --git a/book/testing.rst b/book/testing.rst index d87433cb329..8d03804833a 100644 --- a/book/testing.rst +++ b/book/testing.rst @@ -52,8 +52,9 @@ unit tests. Suppose, for example, that you have an *incredibly* simple class called ``Calculator`` in the ``Utility/`` directory of your bundle:: // src/Acme/DemoBundle/Utility/Calculator.php + namespace Acme\DemoBundle\Utility; - + class Calculator { public function add($a, $b) @@ -66,6 +67,7 @@ To test this, create a ``CalculatorTest`` file in the ``Tests/Utility`` director of your bundle:: // src/Acme/DemoBundle/Tests/Utility/CalculatorTest.php + namespace Acme\DemoBundle\Tests\Utility; use Acme\DemoBundle\Utility\Calculator; @@ -133,6 +135,7 @@ For example, the Symfony2 Standard Edition provides a simple functional test for its ``DemoController`` (`DemoControllerTest`_) that reads as follows:: // src/Acme/DemoBundle/Tests/Controller/DemoControllerTest.php + namespace Acme\DemoBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; diff --git a/book/translation.rst b/book/translation.rst index fc79f9cf576..9b9be2ab71f 100644 --- a/book/translation.rst +++ b/book/translation.rst @@ -875,6 +875,7 @@ your application: .. code-block:: php // src/Acme/BlogBundle/Entity/Author.php + namespace Acme\BlogBundle\Entity; class Author diff --git a/book/validation.rst b/book/validation.rst index 4ba9de12e78..6642b414d03 100644 --- a/book/validation.rst +++ b/book/validation.rst @@ -26,6 +26,7 @@ your application: .. code-block:: php // src/Acme/BlogBundle/Entity/Author.php + namespace Acme\BlogBundle\Entity; class Author diff --git a/cookbook/bundles/extension.rst b/cookbook/bundles/extension.rst index df2069d288f..8c4d9bfb79a 100644 --- a/cookbook/bundles/extension.rst +++ b/cookbook/bundles/extension.rst @@ -436,6 +436,7 @@ To take advantage of this system, you'll create a ``Configuration`` class and build a tree that defines your configuration in that class:: // src/Acme/HelloBundle/DependencyInjection/Configuration.php + namespace Acme\HelloBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; @@ -501,6 +502,7 @@ Comments and examples can be added to your configuration nodes using the ``->setInfo()`` and ``->setExample()`` methods:: // src/Acme/HelloBundle/DependencyExtension/Configuration.php + namespace Acme\HelloBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; diff --git a/cookbook/bundles/inheritance.rst b/cookbook/bundles/inheritance.rst index e30fd03dd08..3031d7aa2c5 100644 --- a/cookbook/bundles/inheritance.rst +++ b/cookbook/bundles/inheritance.rst @@ -17,6 +17,7 @@ where you want the overridden files to live. Start by registering the ``FOSUserB as the "parent" of your bundle:: // src/Acme/UserBundle/AcmeUserBundle.php + namespace Acme\UserBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; @@ -41,6 +42,7 @@ just create your own ``RegistrationController.php`` file, override the bundle's original method, and change its functionality:: // src/Acme/UserBundle/Controller/RegistrationController.php + namespace Acme\UserBundle\Controller; use FOS\UserBundle\Controller\RegistrationController as BaseController; @@ -50,9 +52,9 @@ original method, and change its functionality:: public function registerAction() { $response = parent::registerAction(); - + // do custom stuff - + return $response; } } diff --git a/cookbook/console/console_command.rst b/cookbook/console/console_command.rst index 784f00b9a0a..a3eea07cc44 100644 --- a/cookbook/console/console_command.rst +++ b/cookbook/console/console_command.rst @@ -19,6 +19,7 @@ Edition) to greet us from the command line, create ``GreetCommand.php`` and add the following to it:: // src/Acme/DemoBundle/Command/GreetCommand.php + namespace Acme\DemoBundle\Command; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; diff --git a/cookbook/doctrine/event_listeners_subscribers.rst b/cookbook/doctrine/event_listeners_subscribers.rst index f0a2eec1b80..bee1e9c386c 100644 --- a/cookbook/doctrine/event_listeners_subscribers.rst +++ b/cookbook/doctrine/event_listeners_subscribers.rst @@ -85,18 +85,19 @@ listener on the event ``postPersist``. That class behind that service must have a ``postPersist`` method, which will be called when the event is thrown:: // src/Acme/SearchBundle/Listener/SearchIndexer.php + namespace Acme\SearchBundle\Listener; - + use Doctrine\ORM\Event\LifecycleEventArgs; use Acme\StoreBundle\Entity\Product; - + class SearchIndexer { public function postPersist(LifecycleEventArgs $args) { $entity = $args->getEntity(); $entityManager = $args->getEntityManager(); - + // perhaps you only want to act on some "Product" entity if ($entity instanceof Product) { // do something with the Product diff --git a/cookbook/doctrine/file_uploads.rst b/cookbook/doctrine/file_uploads.rst index de1d7c017c6..39785789124 100644 --- a/cookbook/doctrine/file_uploads.rst +++ b/cookbook/doctrine/file_uploads.rst @@ -25,6 +25,7 @@ Basic Setup First, create a simple Doctrine Entity class to work with:: // src/Acme/DemoBundle/Entity/Document.php + namespace Acme\DemoBundle\Entity; use Doctrine\ORM\Mapping as ORM; diff --git a/cookbook/doctrine/reverse_engineering.rst b/cookbook/doctrine/reverse_engineering.rst index 045b7263712..26401e11aa0 100644 --- a/cookbook/doctrine/reverse_engineering.rst +++ b/cookbook/doctrine/reverse_engineering.rst @@ -109,6 +109,7 @@ The newly created ``BlogComment`` entity class looks as follow: factory = $factory; } - + public static function getSubscribedEvents() { // Tells the dispatcher that we want to listen on the form.pre_set_data @@ -116,11 +117,11 @@ might look like the following:: { $data = $event->getData(); $form = $event->getForm(); - - // During form creation setData() is called with null as an argument - // by the FormBuilder constructor. We're only concerned with when + + // During form creation setData() is called with null as an argument + // by the FormBuilder constructor. We're only concerned with when // setData is called with an actual Entity object in it (whether new, - // or fetched with Doctrine). This if statement let's us skip right + // or fetched with Doctrine). This if statement let's us skip right // over the null condition. if (null === $data) { return; diff --git a/cookbook/form/form_collections.rst b/cookbook/form/form_collections.rst index 9934ecdb231..02b6cfdc811 100755 --- a/cookbook/form/form_collections.rst +++ b/cookbook/form/form_collections.rst @@ -23,8 +23,9 @@ Let's start there: suppose that each ``Task`` belongs to multiple ``Tags`` objects. Start by creating a simple ``Task`` class:: // src/Acme/TaskBundle/Entity/Task.php + namespace Acme\TaskBundle\Entity; - + use Doctrine\Common\Collections\ArrayCollection; class Task @@ -37,7 +38,7 @@ objects. Start by creating a simple ``Task`` class:: { $this->tags = new ArrayCollection(); } - + public function getDescription() { return $this->description; @@ -69,6 +70,7 @@ Now, create a ``Tag`` class. As you saw above, a ``Task`` can have many ``Tag`` objects:: // src/Acme/TaskBundle/Entity/Tag.php + namespace Acme\TaskBundle\Entity; class Tag @@ -85,6 +87,7 @@ Now let's get to the forms. Create a form class so that a ``Tag`` object can be modified by the user:: // src/Acme/TaskBundle/Form/Type/TagType.php + namespace Acme\TaskBundle\Form\Type; use Symfony\Component\Form\AbstractType; @@ -119,6 +122,7 @@ Notice that we embed a collection of ``TagType`` forms using the :doc:`collection` field type:: // src/Acme/TaskBundle/Form/Type/TaskType.php + namespace Acme\TaskBundle\Form\Type; use Symfony\Component\Form\AbstractType; @@ -150,20 +154,21 @@ Notice that we embed a collection of ``TagType`` forms using the In your controller, you'll now initialize a new instance of ``TaskType``:: // src/Acme/TaskBundle/Controller/TaskController.php + namespace Acme\TaskBundle\Controller; - + use Acme\TaskBundle\Entity\Task; use Acme\TaskBundle\Entity\Tag; use Acme\TaskBundle\Form\Type\TaskType; use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\FrameworkBundle\Controller\Controller; - + class TaskController extends Controller { public function newAction(Request $request) { $task = new Task(); - + // dummy code - this is here just so that the Task has some tags // otherwise, this isn't an interesting example $tag1 = new Tag(); @@ -173,9 +178,9 @@ In your controller, you'll now initialize a new instance of ``TaskType``:: $tag2->name = 'tag2'; $task->getTags()->add($tag2); // end dummy code - + $form = $this->createForm(new TaskType(), $task); - + // process the form on POST if ('POST' === $request->getMethod()) { $form->bindRequest($request); @@ -183,7 +188,7 @@ In your controller, you'll now initialize a new instance of ``TaskType``:: // maybe do some form processing, like saving the Task and Tag objects } } - + return $this->render('AcmeTaskBundle:Task:new.html.twig', array( 'form' => $form->createView(), )); @@ -282,7 +287,7 @@ add the ``allow_add`` option to our collection field:: // src/Acme/TaskBundle/Form/Type/TaskType.php // ... - + use Symfony\Component\Form\FormBuilderInterface; public function buildForm(FormBuilderInterface $builder, array $options) @@ -499,7 +504,7 @@ Start by adding the ``allow_delete`` option in the form Type:: // src/Acme/TaskBundle/Form/Type/TaskType.php // ... use Symfony\Component\Form\FormBuilderInterface; - + public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('description'); diff --git a/cookbook/form/use_virtuals_forms.rst b/cookbook/form/use_virtuals_forms.rst index afc348ebb65..25e7d5afcf1 100644 --- a/cookbook/form/use_virtuals_forms.rst +++ b/cookbook/form/use_virtuals_forms.rst @@ -10,6 +10,7 @@ duplicated fields in different entities. For example, imagine you have two entities, a ``Company`` and a ``Customer``:: // src/Acme/HelloBundle/Entity/Company.php + namespace Acme\HelloBundle\Entity; class Company @@ -25,7 +26,8 @@ For example, imagine you have two entities, a ``Company`` and a ``Customer``:: .. code-block:: php - // src/Acme/HelloBundle/Entity/Company.php + // src/Acme/HelloBundle/Entity/Customer.php + namespace Acme\HelloBundle\Entity; class Customer @@ -48,6 +50,7 @@ a ``Customer``. Start by creating a very simple ``CompanyType`` and ``CustomerType``:: // src/Acme/HelloBundle/Form/Type/CompanyType.php + namespace Acme\HelloBundle\Form\Type; use Symfony\Component\Form\FormBuilderInterface; @@ -66,6 +69,7 @@ Start by creating a very simple ``CompanyType`` and ``CustomerType``:: .. code-block:: php // src/Acme/HelloBundle/Form/Type/CustomerType.php + namespace Acme\HelloBundle\Form\Type; use Symfony\Component\Form\FormBuilderInterface; @@ -85,6 +89,7 @@ Now, we have to deal with the four duplicated fields. Here is a (simple) location form type:: // src/Acme/HelloBundle/Form/Type/LocationType.php + namespace Acme\HelloBundle\Form\Type; use Symfony\Component\Form\FormBuilderInterface; diff --git a/cookbook/security/custom_authentication_provider.rst b/cookbook/security/custom_authentication_provider.rst index bdbc1220bf6..f050367d067 100644 --- a/cookbook/security/custom_authentication_provider.rst +++ b/cookbook/security/custom_authentication_provider.rst @@ -52,6 +52,7 @@ provider. .. code-block:: php // src/Acme/DemoBundle/Security/Authentication/Token/WsseUserToken.php + namespace Acme\DemoBundle\Security\Authentication\Token; use Symfony\Component\Security\Core\Authentication\Token\AbstractToken; @@ -61,11 +62,11 @@ provider. public $created; public $digest; public $nonce; - + public function __construct(array $roles = array()) { parent::__construct($roles); - + // If the user has roles, consider it authenticated $this->setAuthenticated(count($roles) > 0); } @@ -98,6 +99,7 @@ set an authenticated token in the security context if successful. .. code-block:: php // src/Acme/DemoBundle/Security/Firewall/WsseListener.php + namespace Acme\DemoBundle\Security\Firewall; use Symfony\Component\HttpFoundation\Response; @@ -141,7 +143,7 @@ set an authenticated token in the security context if successful. if ($returnValue instanceof TokenInterface) { return $this->securityContext->setToken($returnValue); - } else if ($returnValue instanceof Response) { + } elseif ($returnValue instanceof Response) { return $event->setResponse($returnValue); } } catch (AuthenticationException $e) { @@ -184,6 +186,7 @@ the ``PasswordDigest`` header value matches with the user's password. .. code-block:: php // src/Acme/DemoBundle/Security/Authentication/Provider/WsseProvider.php + namespace Acme\DemoBundle\Security\Authentication\Provider; use Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface; @@ -208,7 +211,7 @@ the ``PasswordDigest`` header value matches with the user's password. { $user = $this->userProvider->loadUserByUsername($token->getUsername()); - if ($user && $this->validateDigest($token->digest, $token->nonce, $token->created, $user->getPassword())) { + if ($user && $this->validateDigest($token->digest, $token->nonce, $token->created, $user->getPassword())) { $authenticatedToken = new WsseUserToken($user->getRoles()); $authenticatedToken->setUser($user); @@ -265,6 +268,7 @@ create a class which implements .. code-block:: php // src/Acme/DemoBundle/DependencyInjection/Security/Factory/WsseFactory.php + namespace Acme\DemoBundle\DependencyInjection\Security\Factory; use Symfony\Component\DependencyInjection\ContainerBuilder; diff --git a/cookbook/security/custom_provider.rst b/cookbook/security/custom_provider.rst index 3f9753d939f..2da8e97ec36 100644 --- a/cookbook/security/custom_provider.rst +++ b/cookbook/security/custom_provider.rst @@ -28,11 +28,12 @@ class: ``getRoles()``, ``getPassword()``, ``getSalt()``, ``getUsername()``, Let's see this in action:: // src/Acme/WebserviceUserBundle/Security/User.php + namespace Acme\WebserviceUserBundle\Security\User; use Symfony\Component\Security\Core\User\UserInterface; - class WebserviceUser implements UserInterface + class User implements UserInterface { private $username; private $password; @@ -65,7 +66,7 @@ Let's see this in action:: public function getUsername() { return $this->username; - } + } public function eraseCredentials() { @@ -114,6 +115,7 @@ more details, see :class:`Symfony\\Component\\Security\\Core\\User\\UserProvider Here's an example of how this might look:: // src/Acme/WebserviceUserBundle/Security/User/WebserviceUserProvider.php + namespace Acme\WebserviceUserBundle\Security\User; use Symfony\Component\Security\Core\User\UserProviderInterface; diff --git a/cookbook/security/entity_provider.rst b/cookbook/security/entity_provider.rst index e53ad15a23d..b325ed73d28 100644 --- a/cookbook/security/entity_provider.rst +++ b/cookbook/security/entity_provider.rst @@ -161,8 +161,6 @@ For more details on each of these, see :class:`Symfony\\Component\\Security\\Cor namespace Acme\UserBundle\Entity; - use Symfony\Component\Security\Core\User\EquatableInterface; - // ... public function isEqualTo(UserInterface $user) diff --git a/cookbook/security/target_path.rst b/cookbook/security/target_path.rst index 2aa42d9a40a..aa92d03428f 100644 --- a/cookbook/security/target_path.rst +++ b/cookbook/security/target_path.rst @@ -46,6 +46,7 @@ configuration file. This can be done from your main configuration file (in Next, create your own ``ExceptionListener``:: // src/Acme/HelloBundle/Security/Firewall/ExceptionListener.php + namespace Acme\HelloBundle\Security\Firewall; use Symfony\Component\HttpFoundation\Request; diff --git a/cookbook/service_container/event_listener.rst b/cookbook/service_container/event_listener.rst index 6d63f68d7d9..3728b0491f1 100644 --- a/cookbook/service_container/event_listener.rst +++ b/cookbook/service_container/event_listener.rst @@ -15,6 +15,7 @@ us to modify how exceptions are shown by our application. The ``KernelEvents::E event is just one of the core kernel events:: // src/Acme/DemoBundle/Listener/AcmeExceptionListener.php + namespace Acme\DemoBundle\Listener; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; @@ -26,11 +27,11 @@ event is just one of the core kernel events:: // We get the exception object from the received event $exception = $event->getException(); $message = 'My Error says: ' . $exception->getMessage(); - + // Customize our response object to display our exception details $response->setContent($message); $response->setStatusCode($exception->getStatusCode()); - + // Send our modified response object to the event $event->setResponse($response); } @@ -85,6 +86,7 @@ event, you might need to check the type of the request. This can be easily done as follow:: // src/Acme/DemoBundle/Listener/AcmeRequestListener.php + namespace Acme\DemoBundle\Listener; use Symfony\Component\HttpKernel\Event\GetResponseEvent; diff --git a/cookbook/templating/twig_extension.rst b/cookbook/templating/twig_extension.rst index 5addd8f8f6e..49dcf25f176 100644 --- a/cookbook/templating/twig_extension.rst +++ b/cookbook/templating/twig_extension.rst @@ -29,7 +29,6 @@ As an example we will create a price filter to format a given number into price: use Twig_Extension; use Twig_Filter_Method; - use Twig_Function_Method; class AcmeExtension extends Twig_Extension { @@ -39,7 +38,7 @@ As an example we will create a price filter to format a given number into price: 'price' => new Twig_Filter_Method($this, 'priceFilter'), ); } - + public function priceFilter($number, $decimals = 0, $decPoint = '.', $thousandsSep = ',') { $price = number_format($number, $decimals, $decPoint, $thousandsSep); @@ -53,7 +52,7 @@ As an example we will create a price filter to format a given number into price: return 'acme_extension'; } } - + .. tip:: Along with custom filters, you can also add custom `functions` and register `global variables`. diff --git a/quick_tour/the_big_picture.rst b/quick_tour/the_big_picture.rst index 9d81bace9ce..648f7bc9249 100644 --- a/quick_tour/the_big_picture.rst +++ b/quick_tour/the_big_picture.rst @@ -202,6 +202,7 @@ controller *logical name*, and it references the ``indexAction`` method from the ``Acme\DemoBundle\Controller\WelcomeController`` class:: // src/Acme/DemoBundle/Controller/WelcomeController.php + namespace Acme\DemoBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; diff --git a/reference/constraints/File.rst b/reference/constraints/File.rst index 5a68bff04f2..08fc2d8cf80 100644 --- a/reference/constraints/File.rst +++ b/reference/constraints/File.rst @@ -44,6 +44,7 @@ the author. In your form, the ``bioFile`` property would be a ``file`` type. The ``Author`` class might look as follows:: // src/Acme/BlogBundle/Entity/Author.php + namespace Acme\BlogBundle\Entity; use Symfony\Component\HttpFoundation\File\File; diff --git a/reference/constraints/Image.rst b/reference/constraints/Image.rst index 4f2c0ae2c99..54b9df31864 100644 --- a/reference/constraints/Image.rst +++ b/reference/constraints/Image.rst @@ -42,6 +42,7 @@ image for the author. In your form, the ``headshot`` property would be a ``file`` type. The ``Author`` class might look as follows:: // src/Acme/BlogBundle/Entity/Author.php + namespace Acme\BlogBundle\Entity; use Symfony\Component\HttpFoundation\File\File; diff --git a/reference/constraints/True.rst b/reference/constraints/True.rst index 77813414b7c..08f9ee81a8c 100644 --- a/reference/constraints/True.rst +++ b/reference/constraints/True.rst @@ -28,6 +28,7 @@ example, suppose you have the following method: .. code-block:: php // src/Acme/BlogBundle/Entity/Author.php + namespace Acme\BlogBundle\Entity; class Author diff --git a/reference/dic_tags.rst b/reference/dic_tags.rst index 77f1ef6e191..19bfd6258aa 100644 --- a/reference/dic_tags.rst +++ b/reference/dic_tags.rst @@ -83,6 +83,7 @@ For simplicity, you'll often extend an the interface directly:: // src/Acme/MainBundle/Form/Type/MyFormTypeExtension.php + namespace Acme\MainBundle\Form\Type\MyFormTypeExtension; use Symfony\Component\Form\AbstractTypeExtension; @@ -154,6 +155,7 @@ To register your own cache warmer, first create a service that implements the :class:`Symfony\\Component\\HttpKernel\\CacheWarmer\\CacheWarmerInterface` interface:: // src/Acme/MainBundle/Cache/MyCustomWarmer.php + namespace Acme\MainBundle\Cache; use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface; @@ -532,6 +534,7 @@ other source, first create a class that implements the :class:`Symfony\\Component\\Translation\\Loader\\LoaderInterface` interface:: // src/Acme/MainBundle/Translation/MyCustomLoader.php + namespace Acme\MainBundle\Translation; use Symfony\Component\Translation\Loader\LoaderInterface From 8b2e2502787deb7f678f78126a657de876b50f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brikou=20Carr=C3=A9?= Date: Tue, 3 Jul 2012 08:58:39 +0200 Subject: [PATCH 2/6] reverted extra line addition --- book/controller.rst | 3 --- book/doctrine.rst | 2 -- book/forms.rst | 5 ----- book/from_flat_php_to_symfony2.rst | 1 - book/page_creation.rst | 3 --- book/routing.rst | 2 -- book/security.rst | 1 - book/testing.rst | 3 --- book/translation.rst | 1 - book/validation.rst | 1 - cookbook/bundles/extension.rst | 2 -- cookbook/bundles/inheritance.rst | 2 -- cookbook/console/console_command.rst | 1 - cookbook/doctrine/event_listeners_subscribers.rst | 1 - cookbook/doctrine/file_uploads.rst | 1 - cookbook/doctrine/reverse_engineering.rst | 1 - cookbook/form/create_custom_field_type.rst | 6 ++---- cookbook/form/data_transformers.rst | 3 --- cookbook/form/dynamic_form_generation.rst | 1 - cookbook/form/form_collections.rst | 5 ----- cookbook/form/use_virtuals_forms.rst | 5 ----- cookbook/security/custom_authentication_provider.rst | 4 ---- cookbook/security/custom_provider.rst | 2 -- cookbook/security/entity_provider.rst | 6 ------ cookbook/security/target_path.rst | 1 - cookbook/service_container/event_listener.rst | 2 -- cookbook/templating/twig_extension.rst | 1 - cookbook/testing/doctrine.rst | 1 - quick_tour/the_big_picture.rst | 1 - reference/constraints/File.rst | 1 - reference/constraints/Image.rst | 1 - reference/constraints/True.rst | 1 - reference/dic_tags.rst | 3 --- 33 files changed, 2 insertions(+), 72 deletions(-) diff --git a/book/controller.rst b/book/controller.rst index 03a03df640f..02c265f256c 100644 --- a/book/controller.rst +++ b/book/controller.rst @@ -94,7 +94,6 @@ a controller object. Controllers are also called *actions*. :linenos: // src/Acme/HelloBundle/Controller/HelloController.php - namespace Acme\HelloBundle\Controller; use Symfony\Component\HttpFoundation\Response; @@ -208,7 +207,6 @@ passed to that method: setInfo()`` and ``->setExample()`` methods:: // src/Acme/HelloBundle/DependencyExtension/Configuration.php - namespace Acme\HelloBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; diff --git a/cookbook/bundles/inheritance.rst b/cookbook/bundles/inheritance.rst index 3031d7aa2c5..15df88c6620 100644 --- a/cookbook/bundles/inheritance.rst +++ b/cookbook/bundles/inheritance.rst @@ -17,7 +17,6 @@ where you want the overridden files to live. Start by registering the ``FOSUserB as the "parent" of your bundle:: // src/Acme/UserBundle/AcmeUserBundle.php - namespace Acme\UserBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; @@ -42,7 +41,6 @@ just create your own ``RegistrationController.php`` file, override the bundle's original method, and change its functionality:: // src/Acme/UserBundle/Controller/RegistrationController.php - namespace Acme\UserBundle\Controller; use FOS\UserBundle\Controller\RegistrationController as BaseController; diff --git a/cookbook/console/console_command.rst b/cookbook/console/console_command.rst index a3eea07cc44..784f00b9a0a 100644 --- a/cookbook/console/console_command.rst +++ b/cookbook/console/console_command.rst @@ -19,7 +19,6 @@ Edition) to greet us from the command line, create ``GreetCommand.php`` and add the following to it:: // src/Acme/DemoBundle/Command/GreetCommand.php - namespace Acme\DemoBundle\Command; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; diff --git a/cookbook/doctrine/event_listeners_subscribers.rst b/cookbook/doctrine/event_listeners_subscribers.rst index bee1e9c386c..73c27a0018b 100644 --- a/cookbook/doctrine/event_listeners_subscribers.rst +++ b/cookbook/doctrine/event_listeners_subscribers.rst @@ -85,7 +85,6 @@ listener on the event ``postPersist``. That class behind that service must have a ``postPersist`` method, which will be called when the event is thrown:: // src/Acme/SearchBundle/Listener/SearchIndexer.php - namespace Acme\SearchBundle\Listener; use Doctrine\ORM\Event\LifecycleEventArgs; diff --git a/cookbook/doctrine/file_uploads.rst b/cookbook/doctrine/file_uploads.rst index 39785789124..de1d7c017c6 100644 --- a/cookbook/doctrine/file_uploads.rst +++ b/cookbook/doctrine/file_uploads.rst @@ -25,7 +25,6 @@ Basic Setup First, create a simple Doctrine Entity class to work with:: // src/Acme/DemoBundle/Entity/Document.php - namespace Acme\DemoBundle\Entity; use Doctrine\ORM\Mapping as ORM; diff --git a/cookbook/doctrine/reverse_engineering.rst b/cookbook/doctrine/reverse_engineering.rst index 26401e11aa0..045b7263712 100644 --- a/cookbook/doctrine/reverse_engineering.rst +++ b/cookbook/doctrine/reverse_engineering.rst @@ -109,7 +109,6 @@ The newly created ``BlogComment`` entity class looks as follow: \Form\Type``. Make sure the field extends :class:`Symfony\\Component\\Form\\AbstractType`:: - # src/Acme/DemoBundle/Form/Type/GenderType.php + // src/Acme/DemoBundle/Form/Type/GenderType.php namespace Acme\DemoBundle\Form\Type; use Symfony\Component\Form\AbstractType; @@ -149,7 +149,6 @@ You can now use your custom field type immediately, simply by creating a new instance of the type in one of your forms:: // src/Acme/DemoBundle/Form/Type/AuthorType.php - namespace Acme\DemoBundle\Form\Type; use Symfony\Component\Form\AbstractType; @@ -232,7 +231,7 @@ returned by the ``getName`` method defined earlier. We'll see the importance of this in a moment when we use the custom field type. But first, add a ``__construct`` argument to ``GenderType``, which receives the gender configuration:: - # src/Acme/DemoBundle/Form/Type/GenderType.php + // src/Acme/DemoBundle/Form/Type/GenderType.php namespace Acme\DemoBundle\Form\Type; use Symfony\Component\OptionsResolver\OptionsResolverInterface; @@ -263,7 +262,6 @@ registered as a service. And because we used the ``form.type`` alias in its configuration, using the field is now much easier:: // src/Acme/DemoBundle/Form/Type/AuthorType.php - namespace Acme\DemoBundle\Form\Type; use Symfony\Component\Form\FormBuilderInterface; diff --git a/cookbook/form/data_transformers.rst b/cookbook/form/data_transformers.rst index d912f00eeae..c7c035f84e8 100644 --- a/cookbook/form/data_transformers.rst +++ b/cookbook/form/data_transformers.rst @@ -25,7 +25,6 @@ will enter the issue number. The field will display an error if a non existing n was entered:: // src/Acme/TaskBundle/Form/Type/IssueSelectorType.php - namespace Acme\TaskBundle\Form\Type; use Symfony\Component\Form\AbstractType; @@ -96,7 +95,6 @@ was entered:: Next, we create the data transformer, which does the actual conversion:: // src/Acme/TaskBundle/Form/DataTransformer/IssueToNumberTransformer.php - namespace Acme\TaskBundle\Form\DataTransformer; use Symfony\Component\Form\DataTransformerInterface; @@ -188,7 +186,6 @@ manager can be automatically injected: You can now add the type to your form by its alias as follows:: // src/Acme/TaskBundle/Form/Type/TaskType.php - namespace Acme\TaskBundle\Form\Type; use Symfony\Component\Form\AbstractType; diff --git a/cookbook/form/dynamic_form_generation.rst b/cookbook/form/dynamic_form_generation.rst index 87837da2993..3e0720b9585 100644 --- a/cookbook/form/dynamic_form_generation.rst +++ b/cookbook/form/dynamic_form_generation.rst @@ -89,7 +89,6 @@ is new (e.g. hasn't been persisted to the database). Based on that, the subscrib might look like the following:: // src/Acme/DemoBundle/Form/EventListener/AddNameFieldSubscriber.php - namespace Acme\DemoBundle\Form\EventListener; use Symfony\Component\Form\Event\DataEvent; diff --git a/cookbook/form/form_collections.rst b/cookbook/form/form_collections.rst index 02b6cfdc811..f33ba6705d4 100755 --- a/cookbook/form/form_collections.rst +++ b/cookbook/form/form_collections.rst @@ -23,7 +23,6 @@ Let's start there: suppose that each ``Task`` belongs to multiple ``Tags`` objects. Start by creating a simple ``Task`` class:: // src/Acme/TaskBundle/Entity/Task.php - namespace Acme\TaskBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; @@ -70,7 +69,6 @@ Now, create a ``Tag`` class. As you saw above, a ``Task`` can have many ``Tag`` objects:: // src/Acme/TaskBundle/Entity/Tag.php - namespace Acme\TaskBundle\Entity; class Tag @@ -87,7 +85,6 @@ Now let's get to the forms. Create a form class so that a ``Tag`` object can be modified by the user:: // src/Acme/TaskBundle/Form/Type/TagType.php - namespace Acme\TaskBundle\Form\Type; use Symfony\Component\Form\AbstractType; @@ -122,7 +119,6 @@ Notice that we embed a collection of ``TagType`` forms using the :doc:`collection` field type:: // src/Acme/TaskBundle/Form/Type/TaskType.php - namespace Acme\TaskBundle\Form\Type; use Symfony\Component\Form\AbstractType; @@ -154,7 +150,6 @@ Notice that we embed a collection of ``TagType`` forms using the In your controller, you'll now initialize a new instance of ``TaskType``:: // src/Acme/TaskBundle/Controller/TaskController.php - namespace Acme\TaskBundle\Controller; use Acme\TaskBundle\Entity\Task; diff --git a/cookbook/form/use_virtuals_forms.rst b/cookbook/form/use_virtuals_forms.rst index 25e7d5afcf1..8759e517c6c 100644 --- a/cookbook/form/use_virtuals_forms.rst +++ b/cookbook/form/use_virtuals_forms.rst @@ -10,7 +10,6 @@ duplicated fields in different entities. For example, imagine you have two entities, a ``Company`` and a ``Customer``:: // src/Acme/HelloBundle/Entity/Company.php - namespace Acme\HelloBundle\Entity; class Company @@ -27,7 +26,6 @@ For example, imagine you have two entities, a ``Company`` and a ``Customer``:: .. code-block:: php // src/Acme/HelloBundle/Entity/Customer.php - namespace Acme\HelloBundle\Entity; class Customer @@ -50,7 +48,6 @@ a ``Customer``. Start by creating a very simple ``CompanyType`` and ``CustomerType``:: // src/Acme/HelloBundle/Form/Type/CompanyType.php - namespace Acme\HelloBundle\Form\Type; use Symfony\Component\Form\FormBuilderInterface; @@ -69,7 +66,6 @@ Start by creating a very simple ``CompanyType`` and ``CustomerType``:: .. code-block:: php // src/Acme/HelloBundle/Form/Type/CustomerType.php - namespace Acme\HelloBundle\Form\Type; use Symfony\Component\Form\FormBuilderInterface; @@ -89,7 +85,6 @@ Now, we have to deal with the four duplicated fields. Here is a (simple) location form type:: // src/Acme/HelloBundle/Form/Type/LocationType.php - namespace Acme\HelloBundle\Form\Type; use Symfony\Component\Form\FormBuilderInterface; diff --git a/cookbook/security/custom_authentication_provider.rst b/cookbook/security/custom_authentication_provider.rst index f050367d067..dce5426000c 100644 --- a/cookbook/security/custom_authentication_provider.rst +++ b/cookbook/security/custom_authentication_provider.rst @@ -52,7 +52,6 @@ provider. .. code-block:: php // src/Acme/DemoBundle/Security/Authentication/Token/WsseUserToken.php - namespace Acme\DemoBundle\Security\Authentication\Token; use Symfony\Component\Security\Core\Authentication\Token\AbstractToken; @@ -99,7 +98,6 @@ set an authenticated token in the security context if successful. .. code-block:: php // src/Acme/DemoBundle/Security/Firewall/WsseListener.php - namespace Acme\DemoBundle\Security\Firewall; use Symfony\Component\HttpFoundation\Response; @@ -186,7 +184,6 @@ the ``PasswordDigest`` header value matches with the user's password. .. code-block:: php // src/Acme/DemoBundle/Security/Authentication/Provider/WsseProvider.php - namespace Acme\DemoBundle\Security\Authentication\Provider; use Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface; @@ -268,7 +265,6 @@ create a class which implements .. code-block:: php // src/Acme/DemoBundle/DependencyInjection/Security/Factory/WsseFactory.php - namespace Acme\DemoBundle\DependencyInjection\Security\Factory; use Symfony\Component\DependencyInjection\ContainerBuilder; diff --git a/cookbook/security/custom_provider.rst b/cookbook/security/custom_provider.rst index 2da8e97ec36..48bc6973230 100644 --- a/cookbook/security/custom_provider.rst +++ b/cookbook/security/custom_provider.rst @@ -28,7 +28,6 @@ class: ``getRoles()``, ``getPassword()``, ``getSalt()``, ``getUsername()``, Let's see this in action:: // src/Acme/WebserviceUserBundle/Security/User.php - namespace Acme\WebserviceUserBundle\Security\User; use Symfony\Component\Security\Core\User\UserInterface; @@ -115,7 +114,6 @@ more details, see :class:`Symfony\\Component\\Security\\Core\\User\\UserProvider Here's an example of how this might look:: // src/Acme/WebserviceUserBundle/Security/User/WebserviceUserProvider.php - namespace Acme\WebserviceUserBundle\Security\User; use Symfony\Component\Security\Core\User\UserProviderInterface; diff --git a/cookbook/security/entity_provider.rst b/cookbook/security/entity_provider.rst index b325ed73d28..c290c736199 100644 --- a/cookbook/security/entity_provider.rst +++ b/cookbook/security/entity_provider.rst @@ -43,7 +43,6 @@ focus on the most important methods that come from the .. code-block:: php // src/Acme/UserBundle/Entity/User.php - namespace Acme\UserBundle\Entity; use Doctrine\ORM\Mapping as ORM; @@ -158,7 +157,6 @@ For more details on each of these, see :class:`Symfony\\Component\\Security\\Cor .. code-block:: php // src/Acme/UserBundle/Entity/User.php - namespace Acme\UserBundle\Entity; // ... @@ -273,7 +271,6 @@ For this example, the first three methods will return ``true`` whereas the .. code-block:: php // src/Acme/UserBundle/Entity/User.php - namespace Acme\Bundle\UserBundle\Entity; // ... @@ -331,7 +328,6 @@ The code below shows the implementation of the ``UserRepository`` class:: // src/Acme/UserBundle/Entity/UserRepository.php - namespace Acme\UserBundle\Entity; use Symfony\Component\Security\Core\User\UserInterface; @@ -427,7 +423,6 @@ more users. As a group is also a role, the previous ``getRoles()`` method now returns the list of related groups:: // src/Acme/UserBundle/Entity/User.php - namespace Acme\Bundle\UserBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; @@ -517,7 +512,6 @@ relationship in the ``UserRepository::loadUserByUsername()`` method. This will fetch the user and his associated roles / groups with a single query:: // src/Acme/UserBundle/Entity/UserRepository.php - namespace Acme\Bundle\UserBundle\Entity; // ... diff --git a/cookbook/security/target_path.rst b/cookbook/security/target_path.rst index aa92d03428f..2aa42d9a40a 100644 --- a/cookbook/security/target_path.rst +++ b/cookbook/security/target_path.rst @@ -46,7 +46,6 @@ configuration file. This can be done from your main configuration file (in Next, create your own ``ExceptionListener``:: // src/Acme/HelloBundle/Security/Firewall/ExceptionListener.php - namespace Acme\HelloBundle\Security\Firewall; use Symfony\Component\HttpFoundation\Request; diff --git a/cookbook/service_container/event_listener.rst b/cookbook/service_container/event_listener.rst index 3728b0491f1..fe200dc3a89 100644 --- a/cookbook/service_container/event_listener.rst +++ b/cookbook/service_container/event_listener.rst @@ -15,7 +15,6 @@ us to modify how exceptions are shown by our application. The ``KernelEvents::E event is just one of the core kernel events:: // src/Acme/DemoBundle/Listener/AcmeExceptionListener.php - namespace Acme\DemoBundle\Listener; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; @@ -86,7 +85,6 @@ event, you might need to check the type of the request. This can be easily done as follow:: // src/Acme/DemoBundle/Listener/AcmeRequestListener.php - namespace Acme\DemoBundle\Listener; use Symfony\Component\HttpKernel\Event\GetResponseEvent; diff --git a/cookbook/templating/twig_extension.rst b/cookbook/templating/twig_extension.rst index 49dcf25f176..3175d828e0c 100644 --- a/cookbook/templating/twig_extension.rst +++ b/cookbook/templating/twig_extension.rst @@ -24,7 +24,6 @@ To get your custom functionality you must first create a Twig Extension class. As an example we will create a price filter to format a given number into price:: // src/Acme/DemoBundle/Twig/AcmeExtension.php - namespace Acme\DemoBundle\Twig; use Twig_Extension; diff --git a/cookbook/testing/doctrine.rst b/cookbook/testing/doctrine.rst index b8ea7f59d4b..a321e821199 100644 --- a/cookbook/testing/doctrine.rst +++ b/cookbook/testing/doctrine.rst @@ -21,7 +21,6 @@ to get a valid connection. In this case, you'll extend the ``WebTestCase``, which makes all of this quite easy:: // src/Acme/StoreBundle/Tests/Entity/ProductRepositoryFunctionalTest.php - namespace Acme\StoreBundle\Tests\Entity; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; diff --git a/quick_tour/the_big_picture.rst b/quick_tour/the_big_picture.rst index 648f7bc9249..9d81bace9ce 100644 --- a/quick_tour/the_big_picture.rst +++ b/quick_tour/the_big_picture.rst @@ -202,7 +202,6 @@ controller *logical name*, and it references the ``indexAction`` method from the ``Acme\DemoBundle\Controller\WelcomeController`` class:: // src/Acme/DemoBundle/Controller/WelcomeController.php - namespace Acme\DemoBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; diff --git a/reference/constraints/File.rst b/reference/constraints/File.rst index 08fc2d8cf80..5a68bff04f2 100644 --- a/reference/constraints/File.rst +++ b/reference/constraints/File.rst @@ -44,7 +44,6 @@ the author. In your form, the ``bioFile`` property would be a ``file`` type. The ``Author`` class might look as follows:: // src/Acme/BlogBundle/Entity/Author.php - namespace Acme\BlogBundle\Entity; use Symfony\Component\HttpFoundation\File\File; diff --git a/reference/constraints/Image.rst b/reference/constraints/Image.rst index 54b9df31864..4f2c0ae2c99 100644 --- a/reference/constraints/Image.rst +++ b/reference/constraints/Image.rst @@ -42,7 +42,6 @@ image for the author. In your form, the ``headshot`` property would be a ``file`` type. The ``Author`` class might look as follows:: // src/Acme/BlogBundle/Entity/Author.php - namespace Acme\BlogBundle\Entity; use Symfony\Component\HttpFoundation\File\File; diff --git a/reference/constraints/True.rst b/reference/constraints/True.rst index 08f9ee81a8c..77813414b7c 100644 --- a/reference/constraints/True.rst +++ b/reference/constraints/True.rst @@ -28,7 +28,6 @@ example, suppose you have the following method: .. code-block:: php // src/Acme/BlogBundle/Entity/Author.php - namespace Acme\BlogBundle\Entity; class Author diff --git a/reference/dic_tags.rst b/reference/dic_tags.rst index 19bfd6258aa..77f1ef6e191 100644 --- a/reference/dic_tags.rst +++ b/reference/dic_tags.rst @@ -83,7 +83,6 @@ For simplicity, you'll often extend an the interface directly:: // src/Acme/MainBundle/Form/Type/MyFormTypeExtension.php - namespace Acme\MainBundle\Form\Type\MyFormTypeExtension; use Symfony\Component\Form\AbstractTypeExtension; @@ -155,7 +154,6 @@ To register your own cache warmer, first create a service that implements the :class:`Symfony\\Component\\HttpKernel\\CacheWarmer\\CacheWarmerInterface` interface:: // src/Acme/MainBundle/Cache/MyCustomWarmer.php - namespace Acme\MainBundle\Cache; use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface; @@ -534,7 +532,6 @@ other source, first create a class that implements the :class:`Symfony\\Component\\Translation\\Loader\\LoaderInterface` interface:: // src/Acme/MainBundle/Translation/MyCustomLoader.php - namespace Acme\MainBundle\Translation; use Symfony\Component\Translation\Loader\LoaderInterface From f4422d195f02e899c835a5c3e6238732a4771ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brikou=20Carr=C3=A9?= Date: Tue, 3 Jul 2012 09:04:58 +0200 Subject: [PATCH 3/6] added lf between namespace and use statement --- book/controller.rst | 3 +++ book/from_flat_php_to_symfony2.rst | 1 + book/routing.rst | 2 ++ 3 files changed, 6 insertions(+) diff --git a/book/controller.rst b/book/controller.rst index 02c265f256c..82189588bf8 100644 --- a/book/controller.rst +++ b/book/controller.rst @@ -95,6 +95,7 @@ a controller object. Controllers are also called *actions*. // src/Acme/HelloBundle/Controller/HelloController.php namespace Acme\HelloBundle\Controller; + use Symfony\Component\HttpFoundation\Response; class HelloController @@ -208,6 +209,7 @@ passed to that method: Date: Tue, 3 Jul 2012 09:09:04 +0200 Subject: [PATCH 4/6] reverted extra space in docblock declaration --- cookbook/form/data_transformers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/form/data_transformers.rst b/cookbook/form/data_transformers.rst index c7c035f84e8..3226464d5d8 100644 --- a/cookbook/form/data_transformers.rst +++ b/cookbook/form/data_transformers.rst @@ -135,7 +135,7 @@ Next, we create the data transformer, which does the actual conversion:: /** * Transforms a string (number) to an object (issue). * - * @param string $number + * @param string $number * @return Issue|null * @throws TransformationFailedException if object (issue) is not found. */ From ff2631fc7e4d2b6ebb8d78075817f290eaa8983e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brikou=20Carr=C3=A9?= Date: Tue, 3 Jul 2012 09:15:20 +0200 Subject: [PATCH 5/6] fixed path to WebserviceUser.php --- cookbook/security/custom_provider.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cookbook/security/custom_provider.rst b/cookbook/security/custom_provider.rst index 48bc6973230..dcccf96bea4 100644 --- a/cookbook/security/custom_provider.rst +++ b/cookbook/security/custom_provider.rst @@ -27,12 +27,12 @@ class: ``getRoles()``, ``getPassword()``, ``getSalt()``, ``getUsername()``, Let's see this in action:: - // src/Acme/WebserviceUserBundle/Security/User.php + // src/Acme/WebserviceUserBundle/Security/User/WebserviceUser.php namespace Acme\WebserviceUserBundle\Security\User; use Symfony\Component\Security\Core\User\UserInterface; - class User implements UserInterface + class WebserviceUser implements UserInterface { private $username; private $password; @@ -262,4 +262,4 @@ options, the password may be encoded multiple times and encoded to base64. encode_as_base64: false iterations: 1 -.. _MessageDigestPasswordEncoder: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Security/Core/Encoder/MessageDigestPasswordEncoder.php \ No newline at end of file +.. _MessageDigestPasswordEncoder: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Security/Core/Encoder/MessageDigestPasswordEncoder.php From 66ca932da4025e6fc1c4e5f6e0f2165aa40b5cea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brikou=20Carr=C3=A9?= Date: Tue, 3 Jul 2012 09:31:19 +0200 Subject: [PATCH 6/6] moved use statement --- book/page_creation.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/book/page_creation.rst b/book/page_creation.rst index bf62bbafd14..0f4c41d7e10 100644 --- a/book/page_creation.rst +++ b/book/page_creation.rst @@ -48,7 +48,7 @@ greeted. To create the page, follow the simple two-step process. ``web`` directory of your new Symfony2 project. For detailed information on this process, see the documentation on the web server you are using. Here's the relevant documentation page for some web server you might be using: - + * For Apache HTTP Server, refer to `Apache's DirectoryIndex documentation`_. * For Nginx, refer to `Nginx HttpCoreModule location documentation`_. @@ -223,8 +223,10 @@ Create the ``indexAction`` method that Symfony will execute when the ``hello`` route is matched:: // src/Acme/HelloBundle/Controller/HelloController.php + namespace Acme\HelloBundle\Controller; + + use Symfony\Component\HttpFoundation\Response; - // ... class HelloController { public function indexAction($name)