From a51c0f915eb20bbb423fcc87e91d5a493a087ca6 Mon Sep 17 00:00:00 2001 From: Wouter J Date: Fri, 3 Apr 2015 13:59:47 +0200 Subject: [PATCH 1/6] Removed remaining setDefaultOptions usage --- 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 bfa8b472895..d3a368f9ea7 100644 --- a/cookbook/form/data_transformers.rst +++ b/cookbook/form/data_transformers.rst @@ -130,7 +130,7 @@ by calling ``addModelTransformer`` (or ``addViewTransformer`` - see // the "em" is an option that you pass when creating your form. Check out // the 3rd argument to createForm in the next code block to see how this - // is passed to the form (also see setDefaultOptions). + // is passed to the form (see also configureOptions). $entityManager = $options['em']; $transformer = new IssueToNumberTransformer($entityManager); From 3b12cffbb61c5d79dfafbb72dcae271d86feaab6 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Sat, 3 Jan 2015 18:58:18 +0200 Subject: [PATCH 2/6] Update controller.rst --- book/controller.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/book/controller.rst b/book/controller.rst index c10092f10c8..2e01aef0ee7 100644 --- a/book/controller.rst +++ b/book/controller.rst @@ -5,7 +5,7 @@ Controller ========== A controller is a PHP callable you create that takes information from the -HTTP request and constructs and returns an HTTP response (as a Symfony +HTTP request and creates and returns an HTTP response (as a Symfony ``Response`` object). The response could be an HTML page, an XML document, a serialized JSON array, an image, a redirect, a 404 error or anything else you can dream up. The controller contains whatever arbitrary logic *your @@ -34,7 +34,7 @@ common examples: for the homepage of the site. * *Controller B* reads the ``slug`` parameter from the request to load a - blog entry from the database and create a ``Response`` object displaying + blog entry from the database and creates a ``Response`` object displaying that blog. If the ``slug`` can't be found in the database, it creates and returns a ``Response`` object with a 404 status code. @@ -478,7 +478,9 @@ You can also put templates in deeper sub-directories. Just try to avoid creating unnecessarily deep structures:: // renders app/Resources/views/hello/greetings/index.html.twig - return $this->render('hello/greetings/index.html.twig', array('name' => $name)); + return $this->render('hello/greetings/index.html.twig', array( + 'name' => $name + )); The Symfony templating engine is explained in great detail in the :doc:`Templating ` chapter. @@ -513,7 +515,7 @@ via the ``get()`` method. Here are several common services you might need:: $mailer = $this->get('mailer'); -What other services exist? You can list all services, use the ``container:debug`` +What other services exist? To list all services, use the ``container:debug`` console command: .. code-block:: bash From a07402a2597f1388d412d66fd341b1726bf8177a Mon Sep 17 00:00:00 2001 From: John Bafford Date: Sat, 4 Apr 2015 23:21:07 -0400 Subject: [PATCH 3/6] Add missing word in bundles best practice description --- best_practices/creating-the-project.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/best_practices/creating-the-project.rst b/best_practices/creating-the-project.rst index b180e2d3de6..a180eef9fd2 100644 --- a/best_practices/creating-the-project.rst +++ b/best_practices/creating-the-project.rst @@ -94,7 +94,7 @@ ProductBundle, InvoiceBundle, etc. But a bundle is *meant* to be something that can be reused as a stand-alone piece of software. If UserBundle cannot be used *"as is"* in other Symfony -apps, then it shouldn't be its own bundle. Moreover InvoiceBundle depends on +apps, then it shouldn't be its own bundle. Moreover, if InvoiceBundle depends on ProductBundle, then there's no advantage to having two separate bundles. .. best-practice:: From d2fc0314a0251f54d3ee5d3ad858d11aa4e8df37 Mon Sep 17 00:00:00 2001 From: Alexander Schwenn Date: Mon, 6 Apr 2015 02:18:43 +0200 Subject: [PATCH 4/6] [Cookbook] Update serializer.rst Fix indentation of yaml example for service configuration and show best practice file locations --- cookbook/serializer.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cookbook/serializer.rst b/cookbook/serializer.rst index 762a0f86d19..4c658d90aa6 100644 --- a/cookbook/serializer.rst +++ b/cookbook/serializer.rst @@ -74,16 +74,16 @@ Here is an example on how to load the .. code-block:: yaml - # app/config/config.yml - services: - get_set_method_normalizer: - class: Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer - tags: - - { name: serializer.normalizer } + # app/config/services.yml + services: + get_set_method_normalizer: + class: Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer + tags: + - { name: serializer.normalizer } .. code-block:: xml - + @@ -92,7 +92,7 @@ Here is an example on how to load the .. code-block:: php - // app/config/config.php + // app/config/services.php use Symfony\Component\DependencyInjection\Definition; $definition = new Definition( From 52fb19d4326393327cd9a24a72a295c29e5dace3 Mon Sep 17 00:00:00 2001 From: manelselles Date: Tue, 7 Apr 2015 17:22:32 +0200 Subject: [PATCH 5/6] [Book] app_dev with php built-in web server Console commands are in dev mode by default. Don't use app_dev on url with php built-in web server because it is already in dev mode. --- book/controller.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/controller.rst b/book/controller.rst index c10092f10c8..195231fd36f 100644 --- a/book/controller.rst +++ b/book/controller.rst @@ -201,7 +201,7 @@ to the controller: return $collection; -Now, you can go to ``/hello/ryan`` (e.g. ``http://localhost:8000/app_dev.php/hello/ryan`` +Now, you can go to ``/hello/ryan`` (e.g. ``http://localhost:8000/hello/ryan`` if you're using the :doc:`built-in web server `) and Symfony will execute the ``HelloController::indexAction()`` controller and pass in ``ryan`` for the ``$name`` variable. Creating a "page" means From 3a7acfb02a1065c461c472a004352974e1766bab Mon Sep 17 00:00:00 2001 From: Linas Merkevicius Date: Sun, 5 Apr 2015 23:26:32 +0300 Subject: [PATCH 6/6] Fixed loadUserByUsername function coding errors --- cookbook/security/entity_provider.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbook/security/entity_provider.rst b/cookbook/security/entity_provider.rst index b015fa8ee4f..afdb719fd4a 100644 --- a/cookbook/security/entity_provider.rst +++ b/cookbook/security/entity_provider.rst @@ -435,9 +435,9 @@ interface requires three methods: ``loadUserByUsername($username)``, ->setParameter('username', $username) ->setParameter('email', $username) ->getQuery() - ->getOneOrNullResult() + ->getOneOrNullResult(); - if ($user) { + if (null === $user) { $message = sprintf( 'Unable to find an active admin AppBundle:User object identified by "%s".', $username