Completed
Push — develop ( 7e8dc0...09c52f )
by Axel
10:44
created
Manager/ProjectManager.php 4 patches
Unused Use Statements   -4 removed lines patch added patch discarded remove patch
@@ -3,13 +3,9 @@
 block discarded – undo
3 3
 namespace Developtech\AgilityBundle\Manager;
4 4
 
5 5
 use Doctrine\ORM\EntityManager;
6
-
7 6
 use Developtech\AgilityBundle\Entity\Project;
8
-
9 7
 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
10
-
11 8
 use Symfony\Component\Security\Core\User\UserInterface;
12
-
13 9
 use Developtech\AgilityBundle\Utils\Slugger;
14 10
 
15 11
 class ProjectManager {
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     protected $slugger;
20 20
 
21 21
     /**
22
-     * @param Doctrine\ORM\EntityManager $em
22
+     * @param EntityManager $em
23 23
      * @param Slugger $slugger
24 24
      */
25 25
     public function __construct(EntityManager $em, Slugger $slugger) {
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      * @param string $name
52 52
 	 * @param string $description
53 53
      * @param UserInterface $productOwner
54
-     * @return \DevelopTech\AgilityBundle\ProjectModel
54
+     * @return \Developtech\AgilityBundle\Model\ProjectModel
55 55
      */
56 56
     public function createProject($name, $description, UserInterface $productOwner) {
57 57
         $project =
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     /**
51 51
      * @param string $name
52
-	 * @param string $description
52
+     * @param string $description
53 53
      * @param UserInterface $productOwner
54 54
      * @return \DevelopTech\AgilityBundle\ProjectModel
55 55
      */
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
             (new Project())
59 59
             ->setName($name)
60 60
             ->setSlug($this->slugger->slugify($name))
61
-			->setDescription($description)
61
+            ->setDescription($description)
62 62
             ->setProductOwner($productOwner)
63 63
         ;
64 64
 		
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     /**
72 72
      * @param integer $id
73 73
      * @param string $name
74
-	 * @param string $description
74
+     * @param string $description
75 75
      * @param UserInterface $productOwner
76 76
      * @throws NotFoundHttpException
77 77
      * @return ProjectModel
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         $project
84 84
             ->setName($name)
85 85
             ->setSlug($this->slugger->slugify($name))
86
-			->setDescription($description)
86
+            ->setDescription($description)
87 87
         ;
88 88
         if($productOwner !== null) {
89 89
             $project->setProductOwner($productOwner);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function getProject($slug) {
43 43
         $project = $this->em->getRepository(Project::class)->findOneBySlug($slug);
44
-        if($project === null) {
44
+        if ($project === null) {
45 45
             throw new NotFoundHttpException('Project not found');
46 46
         }
47 47
         return $project;
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             ->setSlug($this->slugger->slugify($name))
86 86
 			->setDescription($description)
87 87
         ;
88
-        if($productOwner !== null) {
88
+        if ($productOwner !== null) {
89 89
             $project->setProductOwner($productOwner);
90 90
         }
91 91
 		
Please login to merge, or discard this patch.
Tests/Manager/ProjectManagerTest.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@
 block discarded – undo
121 121
      * @return Project|null
122 122
      */
123 123
     public function getProjectMock($id) {
124
-        if($id === 2) {
124
+        if ($id === 2) {
125 125
             return null;
126 126
         }
127 127
         return
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,6 +63,9 @@  discard block
 block discarded – undo
63 63
         $this->manager->editProject(2, 'Unknown project', 'Where is my project ?');
64 64
     }
65 65
 
66
+    /**
67
+     * @return \Doctrine\ORM\EntityManager
68
+     */
66 69
     public function getEntityManagerMock() {
67 70
         $entityManagerMock = $this
68 71
             ->getMockBuilder('Doctrine\ORM\EntityManager')
@@ -118,7 +121,7 @@  discard block
 block discarded – undo
118 121
 
119 122
     /**
120 123
      * @param mixed $id
121
-     * @return Project|null
124
+     * @return null|\Developtech\AgilityBundle\Model\ProjectModel
122 125
      */
123 126
     public function getProjectMock($id) {
124 127
         if($id === 2) {
Please login to merge, or discard this patch.
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -3,12 +3,9 @@
 block discarded – undo
3 3
 namespace Developtech\AgilityBundle\Tests\Manager;
4 4
 
5 5
 use Developtech\AgilityBundle\Manager\ProjectManager;
6
-
7 6
 use Developtech\AgilityBundle\Entity\Project;
8 7
 use Developtech\AgilityBundle\Tests\Mock\User;
9
-
10 8
 use Developtech\AgilityBundle\Utils\Slugger;
11
-
12 9
 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
13 10
 
14 11
 class ProjectManagerTest extends \PHPUnit_Framework_TestCase {
Please login to merge, or discard this patch.
Tests/Manager/FeatureManagerTest.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
     }
78 78
 
79 79
     public function getFeatureMock($id) {
80
-        if($id === 2) {
80
+        if ($id === 2) {
81 81
             return null;
82 82
         }
83 83
         return
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -59,6 +59,9 @@
 block discarded – undo
59 59
         $this->assertEquals(95, $feature->getProductOwnerValue());
60 60
     }
61 61
 
62
+    /**
63
+     * @return \Doctrine\ORM\EntityManager
64
+     */
62 65
     public function getEntityManagerMock() {
63 66
         $entityManagerMock = $this
64 67
             ->getMockBuilder('Doctrine\ORM\EntityManager')
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -3,11 +3,9 @@
 block discarded – undo
3 3
 namespace Developtech\AgilityBundle\Tests\Manager;
4 4
 
5 5
 use Developtech\AgilityBundle\Manager\FeatureManager;
6
-
7 6
 use Developtech\AgilityBundle\Entity\Feature;
8 7
 use Developtech\AgilityBundle\Tests\Mock\User;
9 8
 use Developtech\AgilityBundle\Entity\Project;
10
-
11 9
 use Developtech\AgilityBundle\Utils\Slugger;
12 10
 
13 11
 class FeatureManagerTest extends \PHPUnit_Framework_TestCase {
Please login to merge, or discard this patch.
Manager/FeatureManager.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
     }
50 50
 
51 51
     /**
52
-    *  @param ProjectModel $project
52
+     *  @param ProjectModel $project
53 53
      * @param string $name
54 54
      * @param string $description
55 55
      * @param integer $status
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
      * @return Feature
23 23
      */
24 24
     public function getFeature($id) {
25
-        if(($feature = $this->em->getRepository(Feature::class)->find($id)) === null) {
25
+        if (($feature = $this->em->getRepository(Feature::class)->find($id)) === null) {
26 26
             throw new NotFoundHttpException('Feature not found');
27 27
         }
28 28
         return $feature;
Please login to merge, or discard this patch.
Tests/Manager/FeedbackManagerTest.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -71,6 +71,9 @@
 block discarded – undo
71 71
         $this->assertEquals(3, $this->manager->countFeedbacksPerStatus((new Project())->setId(1), Feedback::STATUS_OPEN));
72 72
     }
73 73
 
74
+    /**
75
+     * @return \Doctrine\ORM\EntityManager
76
+     */
74 77
     public function getEntityManagerMock() {
75 78
         $entityManagerMock = $this
76 79
             ->getMockBuilder('Doctrine\ORM\EntityManager')
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -3,11 +3,9 @@
 block discarded – undo
3 3
 namespace Developtech\AgilityBundle\Tests\Manager;
4 4
 
5 5
 use Developtech\AgilityBundle\Manager\FeedbackManager;
6
-
7 6
 use Developtech\AgilityBundle\Entity\Feedback;
8 7
 use Developtech\AgilityBundle\Tests\Mock\User;
9 8
 use Developtech\AgilityBundle\Entity\Project;
10
-
11 9
 use Developtech\AgilityBundle\Utils\Slugger;
12 10
 
13 11
 class FeedbackManagerTest extends \PHPUnit_Framework_TestCase {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@
 block discarded – undo
131 131
     }
132 132
 
133 133
     public function getFeedbackMock($id) {
134
-        if($id === 2) {
134
+        if ($id === 2) {
135 135
             return null;
136 136
         }
137 137
         return
Please login to merge, or discard this patch.
Manager/FeedbackManager.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
      * @return FeedbackModel
59 59
      */
60 60
     public function getFeedback($id) {
61
-        if(($feedback = $this->em->getRepository(Feedback::class)->find($id)) === null) {
61
+        if (($feedback = $this->em->getRepository(Feedback::class)->find($id)) === null) {
62 62
             throw new NotFoundHttpException('Feedback not found');
63 63
         }
64 64
         return $feedback;
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,13 +26,13 @@
 block discarded – undo
26 26
     }
27 27
 
28 28
     /**
29
-    * @param ProjectModel $project
30
-    * @param UserInterface $author
31
-    * @param array $orderBy
32
-    * @param integer $limit
33
-    * @param integer $offset
34
-    * @return array
35
-    */
29
+     * @param ProjectModel $project
30
+     * @param UserInterface $author
31
+     * @param array $orderBy
32
+     * @param integer $limit
33
+     * @param integer $offset
34
+     * @return array
35
+     */
36 36
     public function getProjectFeedbacksByAuthor(ProjectModel $project, UserInterface $author, $orderBy = null, $limit = null, $offset = null) {
37 37
         return $this->em->getRepository(Feedback::class)->findBy([
38 38
             'project' => $project,
Please login to merge, or discard this patch.
Tests/bootstrap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$loader = @include __DIR__ . '/../vendor/autoload.php';
3
+$loader = @include __DIR__.'/../vendor/autoload.php';
4 4
 if (!$loader) {
5 5
     die(<<<'EOT'
6 6
 You must set up the project dependencies, run the following commands:
Please login to merge, or discard this patch.
Model/JobModel.php 2 patches
Doc Comments   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
   /**
29 29
    * @param string $name
30
-   * @return FeatureModel
30
+   * @return JobModel
31 31
    */
32 32
   public function setName($name) {
33 33
       $this->name = $name;
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
   /**
46 46
    * @param string $slug
47
-   * @return FeatureModel
47
+   * @return JobModel
48 48
    */
49 49
   public function setSlug($slug) {
50 50
       $this->slug = $slug;
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
   /**
63 63
    * @param string $description
64
-   * @return FeatureModel
64
+   * @return JobModel
65 65
    */
66 66
   public function setDescription($description) {
67 67
       $this->description = $description;
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
   /**
80 80
    * @param ProjectModel $project
81
-   * @return FeatureModel
81
+   * @return JobModel
82 82
    */
83 83
   public function setProject(ProjectModel $project) {
84 84
       $this->project = $project;
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
   }
88 88
 
89 89
   /**
90
-   * @return FeatureModel
90
+   * @return ProjectModel
91 91
    */
92 92
   public function getProject() {
93 93
       return $this->project;
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
   /**
97 97
    * @param integer $status
98
-   * @return FeatureModel
98
+   * @return JobModel
99 99
    */
100 100
   public function setStatus($status) {
101 101
       $this->status = $status;
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
   /**
114 114
    * @param UserInterface $responsible
115
-   * @return FeatureModel
115
+   * @return JobModel
116 116
    */
117 117
   public function setResponsible(UserInterface $responsible = null) {
118 118
       $this->responsible = $responsible;
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
    *
134 134
    * @param \DateTime $createdAt
135 135
    *
136
-   * @return ProjectModel
136
+   * @return JobModel
137 137
    */
138 138
   public function setCreatedAt($createdAt)
139 139
   {
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
    *
158 158
    * @param \DateTime $updatedAt
159 159
    *
160
-   * @return ProjectModel
160
+   * @return JobModel
161 161
    */
162 162
   public function setUpdatedAt($updatedAt)
163 163
   {
Please login to merge, or discard this patch.
Indentation   +170 added lines, -170 removed lines patch added patch discarded remove patch
@@ -5,174 +5,174 @@
 block discarded – undo
5 5
 use Symfony\Component\Security\Core\User\UserInterface;
6 6
 
7 7
 abstract class JobModel {
8
-  /** @var string */
9
-  protected $name;
10
-  /** @var string */
11
-  protected $slug;
12
-  /** @var string*/
13
-  protected $description;
14
-  /** @var \DateTime*/
15
-  protected $createdAt;
16
-  /** @var \DateTime */
17
-  protected $updatedAt;
18
-  /** @var integer */
19
-  protected $status;
20
-  /** @var ProjectModel */
21
-  protected $project;
22
-  /** @var object */
23
-  protected $responsible;
24
-
25
-  const TYPE_FEATURE = 'US';
26
-  const TYPE_FEEDBACK = 'FB';
27
-
28
-  /**
29
-   * @param string $name
30
-   * @return FeatureModel
31
-   */
32
-  public function setName($name) {
33
-      $this->name = $name;
34
-
35
-      return $this;
36
-  }
37
-
38
-  /**
39
-   * @return string
40
-   */
41
-  public function getName() {
42
-      return $this->name;
43
-  }
44
-
45
-  /**
46
-   * @param string $slug
47
-   * @return FeatureModel
48
-   */
49
-  public function setSlug($slug) {
50
-      $this->slug = $slug;
51
-
52
-      return $this;
53
-  }
54
-
55
-  /**
56
-   * @return string
57
-   */
58
-  public function getSlug() {
59
-      return $this->slug;
60
-  }
61
-
62
-  /**
63
-   * @param string $description
64
-   * @return FeatureModel
65
-   */
66
-  public function setDescription($description) {
67
-      $this->description = $description;
68
-
69
-      return $this;
70
-  }
71
-
72
-  /**
73
-   * @return string
74
-   */
75
-  public function getDescription() {
76
-      return $this->description;
77
-  }
78
-
79
-  /**
80
-   * @param ProjectModel $project
81
-   * @return FeatureModel
82
-   */
83
-  public function setProject(ProjectModel $project) {
84
-      $this->project = $project;
85
-
86
-      return $this;
87
-  }
88
-
89
-  /**
90
-   * @return FeatureModel
91
-   */
92
-  public function getProject() {
93
-      return $this->project;
94
-  }
95
-
96
-  /**
97
-   * @param integer $status
98
-   * @return FeatureModel
99
-   */
100
-  public function setStatus($status) {
101
-      $this->status = $status;
102
-
103
-      return $this;
104
-  }
105
-
106
-  /**
107
-   * @return integer
108
-   */
109
-  public function getStatus() {
110
-      return $this->status;
111
-  }
112
-
113
-  /**
114
-   * @param UserInterface $responsible
115
-   * @return FeatureModel
116
-   */
117
-  public function setResponsible(UserInterface $responsible = null) {
118
-      $this->responsible = $responsible;
119
-
120
-      return $this;
121
-  }
122
-
123
-  /**
124
-   * @return object
125
-   */
126
-  public function getResponsible() {
127
-      return $this->responsible;
128
-  }
129
-
130
-
131
-  /**
132
-   * Set createdAt
133
-   *
134
-   * @param \DateTime $createdAt
135
-   *
136
-   * @return ProjectModel
137
-   */
138
-  public function setCreatedAt($createdAt)
139
-  {
140
-      $this->createdAt = $createdAt;
141
-
142
-      return $this;
143
-  }
144
-
145
-  /**
146
-   * Get createdAt
147
-   *
148
-   * @return \DateTime
149
-   */
150
-  public function getCreatedAt()
151
-  {
152
-      return $this->createdAt;
153
-  }
154
-
155
-  /**
156
-   * Set updatedAt
157
-   *
158
-   * @param \DateTime $updatedAt
159
-   *
160
-   * @return ProjectModel
161
-   */
162
-  public function setUpdatedAt($updatedAt)
163
-  {
164
-      $this->updatedAt = $updatedAt;
165
-
166
-      return $this;
167
-  }
168
-
169
-  /**
170
-   * Get updatedAt
171
-   *
172
-   * @return \DateTime
173
-   */
174
-  public function getUpdatedAt()
175
-  {
176
-      return $this->updatedAt;
177
-  }
8
+    /** @var string */
9
+    protected $name;
10
+    /** @var string */
11
+    protected $slug;
12
+    /** @var string*/
13
+    protected $description;
14
+    /** @var \DateTime*/
15
+    protected $createdAt;
16
+    /** @var \DateTime */
17
+    protected $updatedAt;
18
+    /** @var integer */
19
+    protected $status;
20
+    /** @var ProjectModel */
21
+    protected $project;
22
+    /** @var object */
23
+    protected $responsible;
24
+
25
+    const TYPE_FEATURE = 'US';
26
+    const TYPE_FEEDBACK = 'FB';
27
+
28
+    /**
29
+     * @param string $name
30
+     * @return FeatureModel
31
+     */
32
+    public function setName($name) {
33
+        $this->name = $name;
34
+
35
+        return $this;
36
+    }
37
+
38
+    /**
39
+     * @return string
40
+     */
41
+    public function getName() {
42
+        return $this->name;
43
+    }
44
+
45
+    /**
46
+     * @param string $slug
47
+     * @return FeatureModel
48
+     */
49
+    public function setSlug($slug) {
50
+        $this->slug = $slug;
51
+
52
+        return $this;
53
+    }
54
+
55
+    /**
56
+     * @return string
57
+     */
58
+    public function getSlug() {
59
+        return $this->slug;
60
+    }
61
+
62
+    /**
63
+     * @param string $description
64
+     * @return FeatureModel
65
+     */
66
+    public function setDescription($description) {
67
+        $this->description = $description;
68
+
69
+        return $this;
70
+    }
71
+
72
+    /**
73
+     * @return string
74
+     */
75
+    public function getDescription() {
76
+        return $this->description;
77
+    }
78
+
79
+    /**
80
+     * @param ProjectModel $project
81
+     * @return FeatureModel
82
+     */
83
+    public function setProject(ProjectModel $project) {
84
+        $this->project = $project;
85
+
86
+        return $this;
87
+    }
88
+
89
+    /**
90
+     * @return FeatureModel
91
+     */
92
+    public function getProject() {
93
+        return $this->project;
94
+    }
95
+
96
+    /**
97
+     * @param integer $status
98
+     * @return FeatureModel
99
+     */
100
+    public function setStatus($status) {
101
+        $this->status = $status;
102
+
103
+        return $this;
104
+    }
105
+
106
+    /**
107
+     * @return integer
108
+     */
109
+    public function getStatus() {
110
+        return $this->status;
111
+    }
112
+
113
+    /**
114
+     * @param UserInterface $responsible
115
+     * @return FeatureModel
116
+     */
117
+    public function setResponsible(UserInterface $responsible = null) {
118
+        $this->responsible = $responsible;
119
+
120
+        return $this;
121
+    }
122
+
123
+    /**
124
+     * @return object
125
+     */
126
+    public function getResponsible() {
127
+        return $this->responsible;
128
+    }
129
+
130
+
131
+    /**
132
+     * Set createdAt
133
+     *
134
+     * @param \DateTime $createdAt
135
+     *
136
+     * @return ProjectModel
137
+     */
138
+    public function setCreatedAt($createdAt)
139
+    {
140
+        $this->createdAt = $createdAt;
141
+
142
+        return $this;
143
+    }
144
+
145
+    /**
146
+     * Get createdAt
147
+     *
148
+     * @return \DateTime
149
+     */
150
+    public function getCreatedAt()
151
+    {
152
+        return $this->createdAt;
153
+    }
154
+
155
+    /**
156
+     * Set updatedAt
157
+     *
158
+     * @param \DateTime $updatedAt
159
+     *
160
+     * @return ProjectModel
161
+     */
162
+    public function setUpdatedAt($updatedAt)
163
+    {
164
+        $this->updatedAt = $updatedAt;
165
+
166
+        return $this;
167
+    }
168
+
169
+    /**
170
+     * Get updatedAt
171
+     *
172
+     * @return \DateTime
173
+     */
174
+    public function getUpdatedAt()
175
+    {
176
+        return $this->updatedAt;
177
+    }
178 178
 }
Please login to merge, or discard this patch.
Repository/FeedbackRepository.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@
 block discarded – undo
21 21
      */
22 22
     public function countPerStatus(ProjectModel $project, $status) {
23 23
         $statement = $this->getEntityManager()->getConnection()->prepare(
24
-            "SELECT COUNT(*) as nb_feedbacks FROM {$this->getEntityManager()->getClassMetadata(Job::class)->getTableName()} " .
25
-            "WHERE project_id = :project_id AND status = :status AND type = '" . Job::TYPE_FEEDBACK . "'"
24
+            "SELECT COUNT(*) as nb_feedbacks FROM {$this->getEntityManager()->getClassMetadata(Job::class)->getTableName()} ".
25
+            "WHERE project_id = :project_id AND status = :status AND type = '".Job::TYPE_FEEDBACK."'"
26 26
         );
27 27
         $statement->execute([
28 28
             'project_id' => $project->getId(),
Please login to merge, or discard this patch.