@@ -15,7 +15,7 @@ |
||
| 15 | 15 | { |
| 16 | 16 | // replace this example code with whatever you need |
| 17 | 17 | return $this->render('default/index.html.twig', array( |
| 18 | - 'base_dir' => realpath($this->container->getParameter('kernel.root_dir').'/..'), |
|
| 18 | + 'base_dir' => realpath($this->container->getParameter('kernel.root_dir') . '/..'), |
|
| 19 | 19 | )); |
| 20 | 20 | } |
| 21 | 21 | } |
@@ -28,21 +28,21 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | if ($env == 'test') { |
| 30 | 30 | return [ |
| 31 | - __DIR__.'/test/role.yml', |
|
| 32 | - __DIR__.'/test/tag.yml', |
|
| 33 | - __DIR__.'/test/category.yml', |
|
| 34 | - __DIR__.'/test/user.yml', |
|
| 35 | - __DIR__.'/test/article.yml', |
|
| 36 | - __DIR__.'/test/comment.yml', |
|
| 31 | + __DIR__ . '/test/role.yml', |
|
| 32 | + __DIR__ . '/test/tag.yml', |
|
| 33 | + __DIR__ . '/test/category.yml', |
|
| 34 | + __DIR__ . '/test/user.yml', |
|
| 35 | + __DIR__ . '/test/article.yml', |
|
| 36 | + __DIR__ . '/test/comment.yml', |
|
| 37 | 37 | ]; |
| 38 | 38 | } |
| 39 | 39 | return [ |
| 40 | - __DIR__.'/dev/role.yml', |
|
| 41 | - __DIR__.'/dev/tag.yml', |
|
| 42 | - __DIR__.'/dev/category.yml', |
|
| 43 | - __DIR__.'/dev/user.yml', |
|
| 44 | - __DIR__.'/dev/article.yml', |
|
| 45 | - __DIR__.'/dev/comment.yml', |
|
| 40 | + __DIR__ . '/dev/role.yml', |
|
| 41 | + __DIR__ . '/dev/tag.yml', |
|
| 42 | + __DIR__ . '/dev/category.yml', |
|
| 43 | + __DIR__ . '/dev/user.yml', |
|
| 44 | + __DIR__ . '/dev/article.yml', |
|
| 45 | + __DIR__ . '/dev/comment.yml', |
|
| 46 | 46 | ]; |
| 47 | 47 | } |
| 48 | 48 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | 'anonymous', |
| 56 | 56 | ]; |
| 57 | 57 | |
| 58 | - return $roles[$count-1]; |
|
| 58 | + return $roles[$count - 1]; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | public function picture() |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: victor |
|
| 5 | - * Date: 08.01.16 |
|
| 6 | - * Time: 18:45 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: victor |
|
| 5 | + * Date: 08.01.16 |
|
| 6 | + * Time: 18:45 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace AppBundle\Twig; |
| 10 | 10 | |
@@ -24,9 +24,9 @@ |
||
| 24 | 24 | $this->assertContains('1 Comments', $crawler->filter('.post-comment a')->text()); |
| 25 | 25 | $this->assertContains('Test category (1)', $crawler->filter('.widget .category-list a')->text()); |
| 26 | 26 | $this->assertContains('5 Test title', $crawler->filter('.widget .blogposts.popular a')->text()); |
| 27 | - $this->assertContains($date->format('M d, Y').' | by User name', $crawler->filter('.widget .blogposts.popular .text-muted')->text()); |
|
| 27 | + $this->assertContains($date->format('M d, Y') . ' | by User name', $crawler->filter('.widget .blogposts.popular .text-muted')->text()); |
|
| 28 | 28 | $this->assertContains('Test title', $crawler->filter('.widget .blogposts.latest a')->text()); |
| 29 | - $this->assertContains($date->format('M d, Y').' | by User name', $crawler->filter('.widget .blogposts.latest .text-muted')->text()); |
|
| 29 | + $this->assertContains($date->format('M d, Y') . ' | by User name', $crawler->filter('.widget .blogposts.latest .text-muted')->text()); |
|
| 30 | 30 | $this->assertContains('User name', $crawler->filter('.widget .recent-comments .media-heading a')->eq(0)->text()); |
| 31 | 31 | $this->assertContains('Test title', $crawler->filter('.widget .recent-comments .media-heading a')->eq(1)->text()); |
| 32 | 32 | $this->assertContains('Text comment', $crawler->filter('.widget .recent-comments .text-muted')->text()); |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: victor |
|
| 5 | - * Date: 10.01.16 |
|
| 6 | - * Time: 12:49 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: victor |
|
| 5 | + * Date: 10.01.16 |
|
| 6 | + * Time: 12:49 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace AppBundle\Tests\Form\Type; |
| 10 | 10 | |
@@ -472,19 +472,19 @@ discard block |
||
| 472 | 472 | { |
| 473 | 473 | return null === $this->photo |
| 474 | 474 | ? null |
| 475 | - : $this->getUploadRootDir().'/'.$this->photo; |
|
| 475 | + : $this->getUploadRootDir() . '/' . $this->photo; |
|
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | public function getWebPath() |
| 479 | 479 | { |
| 480 | 480 | return null === $this->photo |
| 481 | 481 | ? null |
| 482 | - : $this->getUploadDir().'/'.$this->photo; |
|
| 482 | + : $this->getUploadDir() . '/' . $this->photo; |
|
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | protected function getUploadRootDir() |
| 486 | 486 | { |
| 487 | - return __DIR__.'/../../../web/'.$this->getUploadDir(); |
|
| 487 | + return __DIR__ . '/../../../web/' . $this->getUploadDir(); |
|
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | protected function getUploadDir() |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | { |
| 501 | 501 | if (null !== $this->getFile()) { |
| 502 | 502 | $filename = sha1(uniqid(mt_rand(), true)); |
| 503 | - $this->photo = $filename.'.'.$this->getFile()->guessExtension(); |
|
| 503 | + $this->photo = $filename . '.' . $this->getFile()->guessExtension(); |
|
| 504 | 504 | } |
| 505 | 505 | } |
| 506 | 506 | |
@@ -517,9 +517,9 @@ discard block |
||
| 517 | 517 | $this->getFile()->move($this->getUploadRootDir(), $this->photo); |
| 518 | 518 | |
| 519 | 519 | if (isset($this->temp)) { |
| 520 | - unlink($this->getUploadRootDir().'/'.$this->temp); |
|
| 520 | + unlink($this->getUploadRootDir() . '/' . $this->temp); |
|
| 521 | 521 | |
| 522 | - $this->clearCache($this->getUploadDir().'/'.$this->temp); |
|
| 522 | + $this->clearCache($this->getUploadDir() . '/' . $this->temp); |
|
| 523 | 523 | |
| 524 | 524 | $this->temp = null; |
| 525 | 525 | } |
@@ -481,19 +481,19 @@ discard block |
||
| 481 | 481 | { |
| 482 | 482 | return null === $this->picture |
| 483 | 483 | ? null |
| 484 | - : $this->getUploadRootDir().'/'.$this->picture; |
|
| 484 | + : $this->getUploadRootDir() . '/' . $this->picture; |
|
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | public function getWebPath() |
| 488 | 488 | { |
| 489 | 489 | return null === $this->picture |
| 490 | 490 | ? null |
| 491 | - : $this->getUploadDir().'/'.$this->picture; |
|
| 491 | + : $this->getUploadDir() . '/' . $this->picture; |
|
| 492 | 492 | } |
| 493 | 493 | |
| 494 | 494 | protected function getUploadRootDir() |
| 495 | 495 | { |
| 496 | - return __DIR__.'/../../../web/'.$this->getUploadDir(); |
|
| 496 | + return __DIR__ . '/../../../web/' . $this->getUploadDir(); |
|
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | protected function getUploadDir() |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | { |
| 510 | 510 | if (null !== $this->getFile()) { |
| 511 | 511 | $filename = sha1(uniqid(mt_rand(), true)); |
| 512 | - $this->picture = $filename.'.'.$this->getFile()->guessExtension(); |
|
| 512 | + $this->picture = $filename . '.' . $this->getFile()->guessExtension(); |
|
| 513 | 513 | } |
| 514 | 514 | } |
| 515 | 515 | |
@@ -526,9 +526,9 @@ discard block |
||
| 526 | 526 | $this->getFile()->move($this->getUploadRootDir(), $this->picture); |
| 527 | 527 | |
| 528 | 528 | if (isset($this->temp)) { |
| 529 | - unlink($this->getUploadRootDir().'/'.$this->temp); |
|
| 529 | + unlink($this->getUploadRootDir() . '/' . $this->temp); |
|
| 530 | 530 | |
| 531 | - $this->clearCache($this->getUploadDir().'/'.$this->temp); |
|
| 531 | + $this->clearCache($this->getUploadDir() . '/' . $this->temp); |
|
| 532 | 532 | |
| 533 | 533 | $this->temp = null; |
| 534 | 534 | } |
@@ -111,7 +111,7 @@ |
||
| 111 | 111 | if ($action == "edit") { |
| 112 | 112 | $role = $em->getRepository('AppBundle:Role') |
| 113 | 113 | ->find($id); |
| 114 | - $title = 'Edit role id: '.$id; |
|
| 114 | + $title = 'Edit role id: ' . $id; |
|
| 115 | 115 | } |
| 116 | 116 | else { |
| 117 | 117 | $role = new Role(); |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; |
| 9 | 9 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; |
| 10 | 10 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
| 11 | -use Symfony\Component\Form\Extension\Core\Type\ChoiceType; |
|
| 12 | 11 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; |
| 13 | 12 | use Symfony\Component\HttpFoundation\Request; |
| 14 | 13 | |
@@ -66,8 +66,7 @@ discard block |
||
| 66 | 66 | $user = $em->getRepository('AppBundle:User') |
| 67 | 67 | ->find($id); |
| 68 | 68 | $title = 'Edit user id: '.$id; |
| 69 | - } |
|
| 70 | - else { |
|
| 69 | + } else { |
|
| 71 | 70 | $user = new User(); |
| 72 | 71 | $title = 'Create new user'; |
| 73 | 72 | } |
@@ -147,8 +146,7 @@ discard block |
||
| 147 | 146 | } |
| 148 | 147 | |
| 149 | 148 | $renderedForm = $form->createView(); |
| 150 | - } |
|
| 151 | - else { |
|
| 149 | + } else { |
|
| 152 | 150 | $message .= 'You must to delete related records before.'; |
| 153 | 151 | $renderedForm = ''; |
| 154 | 152 | } |
@@ -112,7 +112,7 @@ |
||
| 112 | 112 | $em = $this->getDoctrine()->getManager(); |
| 113 | 113 | $comment = $em->getRepository('AppBundle:Comment') |
| 114 | 114 | ->find($id); |
| 115 | - $title = 'Edit comment id: "'.$id. '" for article "' . $comment->getArticle()->getTitle() . '"'; |
|
| 115 | + $title = 'Edit comment id: "' . $id . '" for article "' . $comment->getArticle()->getTitle() . '"'; |
|
| 116 | 116 | |
| 117 | 117 | $form = $this->createForm(CommentAdminType::class, $comment, [ |
| 118 | 118 | 'em' => $em, |