Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

#7 - Some symfony 2 code style to methods

  • Loading branch information...
commit 79019f2615f7c4d5e97e4eb0a37adc7025b272ef 1 parent 37f32ff
Eduardo Gulias Davis authored April 14, 2012
29  src/SFM/WebsiteBundle/Controller/DefaultController.php
@@ -20,7 +20,8 @@ class DefaultController extends Controller {
20 20
      * @return array
21 21
      * @Route("/", name="home")
22 22
      */
23  
-    public function indexAction() {
  23
+    public function indexAction()
  24
+    {
24 25
         $em = $this->getDoctrine()->getEntityManager();
25 26
         $nextEvent = $em->getRepository('SFMWebsiteBundle:Event')->getNextEvent();
26 27
         $sfm = $this->get('sfm.feed_generator')->generateEventsFeed();
@@ -28,12 +29,12 @@ public function indexAction() {
28 29
         $response = $this->render('SFMWebsiteBundle:Default:index.html.twig', array(
29 30
             'current' => 'home',
30 31
             'nextEvent' => $nextEvent,
31  
-                ));        
  32
+                ));
32 33
         $response->setExpires(new \DateTime('now + 15 minutes'));
33 34
         $response->setMaxAge(15 * 60);
34  
-        
35  
-        return $response;       
36  
-        
  35
+
  36
+        return $response;
  37
+
37 38
     }
38 39
 
39 40
     /**
@@ -43,7 +44,8 @@ public function indexAction() {
43 44
      * @Route("/acerca-de", name="about")
44 45
      * @Template()
45 46
      */
46  
-    public function aboutAction() {
  47
+    public function aboutAction()
  48
+    {
47 49
         /**
48 50
          * Better a random order than alphabetical :)
49 51
          */
@@ -70,7 +72,8 @@ public function aboutAction() {
70 72
      * @Method("get")
71 73
      * @Template()
72 74
      */
73  
-    public function contactAction() {
  75
+    public function contactAction()
  76
+    {
74 77
         return array(
75 78
             'current' => 'contact',
76 79
         );
@@ -84,7 +87,8 @@ public function contactAction() {
84 87
      * @Method("post")
85 88
      * @Template()
86 89
      */
87  
-    public function sendMailAction() {
  90
+    public function sendMailAction()
  91
+    {
88 92
         $contactData = array(
89 93
             'nombre' => $this->getRequest()->get('nombre'),
90 94
             'email' => $this->getRequest()->get('email'),
@@ -116,7 +120,8 @@ public function sendMailAction() {
116 120
      *
117 121
      * @param array $contactData Data given from contact form.
118 122
      */
119  
-    private function sendMailOnContactFormSuccess(Array $contactData) {
  123
+    private function sendMailOnContactFormSuccess(Array $contactData)
  124
+    {
120 125
         $mailTo = $this->container->getParameter('contactmail');
121 126
 
122 127
         $message = \Swift_Message::newInstance()
@@ -134,7 +139,8 @@ private function sendMailOnContactFormSuccess(Array $contactData) {
134 139
      * @param array $contactData
135 140
      * @throws \Symfony\Component\HttpKernel\Exception\HttpException
136 141
      */
137  
-    private function validateContactData(array $contactData) {
  142
+    private function validateContactData(array $contactData)
  143
+    {
138 144
         $collectionConstraint = new Collection(array(
139 145
                     'nombre' => array(
140 146
                         new NotBlank()
@@ -154,7 +160,8 @@ private function validateContactData(array $contactData) {
154 160
         }
155 161
     }
156 162
 
157  
-    private function parseErrors($errors) {
  163
+    private function parseErrors($errors)
  164
+    {
158 165
 
159 166
         $translator = $this->container->get('translator');
160 167
         $parsedErrors = array();

0 notes on commit 79019f2

Please sign in to comment.
Something went wrong with that request. Please try again.