Passed
Push — master ( bf11d1...f2923d )
by Anthony
03:06
created
Command/CreateAdminCommand.php 1 patch
Indentation   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -13,80 +13,80 @@
 block discarded – undo
13 13
 
14 14
 class CreateAdminCommand extends Command
15 15
 {
16
-    /** @var EntityManagerInterface */
17
-    private $em;
16
+				/** @var EntityManagerInterface */
17
+				private $em;
18 18
 
19
-    /** @var UserPasswordEncoderInterface */
20
-    private $passwordEncoder;
19
+				/** @var UserPasswordEncoderInterface */
20
+				private $passwordEncoder;
21 21
 
22
-    /**
23
-     * CreateAdminCommand constructor.
24
-     * @param EntityManagerInterface $em
25
-     * @param UserPasswordEncoderInterface $passwordEncoder
26
-     * @param string|null $name
27
-     */
28
-    public function __construct(EntityManagerInterface $em, UserPasswordEncoderInterface $passwordEncoder, string $name = null)
29
-    {
30
-        parent::__construct($name);
31
-        $this->em = $em;
32
-        $this->passwordEncoder = $passwordEncoder;
33
-    }
22
+				/**
23
+				 * CreateAdminCommand constructor.
24
+				 * @param EntityManagerInterface $em
25
+				 * @param UserPasswordEncoderInterface $passwordEncoder
26
+				 * @param string|null $name
27
+				 */
28
+				public function __construct(EntityManagerInterface $em, UserPasswordEncoderInterface $passwordEncoder, string $name = null)
29
+				{
30
+								parent::__construct($name);
31
+								$this->em = $em;
32
+								$this->passwordEncoder = $passwordEncoder;
33
+				}
34 34
 
35
-    protected function configure()
36
-    {
37
-        $this
38
-            ->setName('ribsadmin:create-admin')
39
-            ->setDescription('Create an admin in ribs admin')
40
-            ->addArgument(
41
-                'firstname',
42
-                InputArgument::REQUIRED,
43
-                'Firstname of admin to create'
44
-            )
45
-            ->addArgument(
46
-                'lastname',
47
-                InputArgument::REQUIRED,
48
-                'Lastname of admin to create'
49
-            )
50
-            ->addArgument(
51
-                'email',
52
-                InputArgument::REQUIRED,
53
-                'email of admin to create'
54
-            )
55
-            ->addArgument(
56
-                'password',
57
-                InputArgument::REQUIRED,
58
-                'password of admin to create'
59
-            )
60
-        ;
61
-    }
35
+				protected function configure()
36
+				{
37
+								$this
38
+												->setName('ribsadmin:create-admin')
39
+												->setDescription('Create an admin in ribs admin')
40
+												->addArgument(
41
+																'firstname',
42
+																InputArgument::REQUIRED,
43
+																'Firstname of admin to create'
44
+												)
45
+												->addArgument(
46
+																'lastname',
47
+																InputArgument::REQUIRED,
48
+																'Lastname of admin to create'
49
+												)
50
+												->addArgument(
51
+																'email',
52
+																InputArgument::REQUIRED,
53
+																'email of admin to create'
54
+												)
55
+												->addArgument(
56
+																'password',
57
+																InputArgument::REQUIRED,
58
+																'password of admin to create'
59
+												)
60
+								;
61
+				}
62 62
 
63
-    protected function execute(InputInterface $input, OutputInterface $output)
64
-    {
65
-        $firstname = $input->getArgument('firstname');
66
-        $lastname = $input->getArgument('lastname');
67
-        $email = $input->getArgument('email');
68
-        $password = $input->getArgument('password');
63
+				protected function execute(InputInterface $input, OutputInterface $output)
64
+				{
65
+								$firstname = $input->getArgument('firstname');
66
+								$lastname = $input->getArgument('lastname');
67
+								$email = $input->getArgument('email');
68
+								$password = $input->getArgument('password');
69 69
 
70
-        $output->writeln("Create admin " . $firstname . " " . $lastname);
70
+								$output->writeln("Create admin " . $firstname . " " . $lastname);
71 71
 
72
-        $user = new User();
73
-        $user->setFirstname($firstname);
74
-        $user->setLastname($lastname);
75
-        $user->setAccessRights("*");
76
-        $this->em->persist($user);
72
+								$user = new User();
73
+								$user->setFirstname($firstname);
74
+								$user->setLastname($lastname);
75
+								$user->setAccessRights("*");
76
+								$this->em->persist($user);
77 77
 
78
-        $account = new Account();
79
-        $temp_password = $this->passwordEncoder->encodePassword($account, $password);
80
-        $account->setPassword($temp_password);
81
-        $account->setUser($user);
82
-        $account->setEmail($email);
83
-        $account->setUsername(substr($firstname, 0, 1).".".$lastname);
84
-        $this->em->persist($account);
78
+								$account = new Account();
79
+								$temp_password = $this->passwordEncoder->encodePassword($account, $password);
80
+								$account->setPassword($temp_password);
81
+								$account->setUser($user);
82
+								$account->setEmail($email);
83
+								$account->setUsername(substr($firstname, 0, 1).".".$lastname);
84
+								$this->em->persist($account);
85 85
 
86
-        $this->em->flush();
86
+								$this->em->flush();
87 87
 
88
-        $output->writeln("End Create admin " . $firstname . " " . $lastname);
88
+								$output->writeln("End Create admin " . $firstname . " " . $lastname);
89 89
 
90
-        return 0;
91
-    }
90
+								return 0;
91
+				}
92 92
 }
Please login to merge, or discard this patch.
Entity/Module.php 1 patch
Indentation   +338 added lines, -338 removed lines patch added patch discarded remove patch
@@ -13,342 +13,342 @@
 block discarded – undo
13 13
  */
14 14
 class Module
15 15
 {
16
-    /**
17
-     * @var integer
18
-     *
19
-     * @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true})
20
-     * @ORM\Id
21
-     * @ORM\GeneratedValue(strategy="IDENTITY")
22
-     */
23
-    private $id;
24
-
25
-    /**
26
-     * @var string
27
-     *
28
-     * @ORM\Column(name="package_name", type="string", length=255, nullable=false)
29
-     */
30
-    private $packageName;
31
-
32
-    /**
33
-     * @var string
34
-     *
35
-     * @ORM\Column(name="title_tag", type="string", length=70, nullable=true)
36
-     */
37
-    private $titleTag;
38
-
39
-    /**
40
-     * @var string
41
-     *
42
-     * @ORM\Column(name="description_tag", type="string", length=160, nullable=true)
43
-     */
44
-    private $descriptionTag;
45
-
46
-    /**
47
-     * @var string
48
-     *
49
-     * @ORM\Column(name="title", type="string", length=255, nullable=false)
50
-     */
51
-    private $title;
52
-
53
-    /**
54
-     * @var string
55
-     *
56
-     * @ORM\Column(name="template", type="string", length=255, nullable=true)
57
-     */
58
-    private $template;
59
-
60
-    /**
61
-     * @var string
62
-     *
63
-     * @ORM\Column(name="url", type="string", length=255, nullable=true)
64
-     */
65
-    private $url;
66
-
67
-    /**
68
-     * @var string
69
-     *
70
-     * @ORM\Column(name="url_admin", type="string", length=255, nullable=true)
71
-     */
72
-    private $urlAdmin;
73
-
74
-    /**
75
-     * @var boolean
76
-     *
77
-     * @ORM\Column(name="active", type="boolean", nullable=false)
78
-     */
79
-    private $active;
80
-
81
-    /**
82
-     * @var integer
83
-     *
84
-     * @ORM\Column(name="`order`", type="integer", nullable=true)
85
-     */
86
-    private $order;
87
-
88
-    /**
89
-     * @var boolean
90
-     *
91
-     * @ORM\Column(name="displayed", type="boolean", nullable=false)
92
-     */
93
-    private $displayed;
94
-
95
-    /**
96
-     * @var boolean
97
-     *
98
-     * @ORM\Column(name="dev_mode", type="boolean", nullable=false)
99
-     */
100
-    private $devMode;
101
-
102
-    /**
103
-     * @var \DateTime
104
-     *
105
-     * @Gedmo\Timestampable(on="create")
106
-     * @ORM\Column(name="creation_date", type="date", nullable=true)
107
-     */
108
-    private $creationDate;
109
-
110
-    /**
111
-     * @var \DateTime
112
-     *
113
-     * @Gedmo\Timestampable(on="update")
114
-     * @ORM\Column(name="update_date", type="date", nullable=true)
115
-     */
116
-    private $updateDate;
117
-
118
-    /**
119
-     * @return int
120
-     */
121
-    public function getId(): int
122
-    {
123
-        return $this->id;
124
-    }
125
-
126
-    /**
127
-     * @param int $id
128
-     */
129
-    public function setId(int $id)
130
-    {
131
-        $this->id = $id;
132
-    }
133
-
134
-    /**
135
-     * @return string
136
-     */
137
-    public function getPackageName(): ?string
138
-    {
139
-        return $this->packageName;
140
-    }
141
-
142
-    /**
143
-     * @param string $package_name
144
-     */
145
-    public function setPackageName(string $package_name)
146
-    {
147
-        $this->packageName = $package_name;
148
-    }
149
-
150
-    /**
151
-     * @return string
152
-     */
153
-    public function getTitleTag(): ?string
154
-    {
155
-        return $this->titleTag;
156
-    }
157
-
158
-    /**
159
-     * @param string $titleTag
160
-     */
161
-    public function setTitleTag(string $titleTag)
162
-    {
163
-        $this->titleTag = $titleTag;
164
-    }
165
-
166
-    /**
167
-     * @return string
168
-     */
169
-    public function getDescriptionTag(): ?string
170
-    {
171
-        return $this->descriptionTag;
172
-    }
173
-
174
-    /**
175
-     * @param string $descriptionTag
176
-     */
177
-    public function setDescriptionTag(string $descriptionTag)
178
-    {
179
-        $this->descriptionTag = $descriptionTag;
180
-    }
181
-
182
-    /**
183
-     * @return string
184
-     */
185
-    public function getTitle(): ?string
186
-    {
187
-        return $this->title;
188
-    }
189
-
190
-    /**
191
-     * @param string $title
192
-     */
193
-    public function setTitle(string $title)
194
-    {
195
-        $this->title = $title;
196
-    }
197
-
198
-    /**
199
-     * @return string
200
-     */
201
-    public function getTemplate(): ?string
202
-    {
203
-        return $this->template;
204
-    }
205
-
206
-    /**
207
-     * @param string $template
208
-     */
209
-    public function setTemplate(string $template)
210
-    {
211
-        $this->template = $template;
212
-    }
213
-
214
-    /**
215
-     * @return string
216
-     */
217
-    public function getUrl(): ?string
218
-    {
219
-        return $this->url;
220
-    }
221
-
222
-    /**
223
-     * @param string $url
224
-     */
225
-    public function setUrl(string $url)
226
-    {
227
-        $this->url = $url;
228
-    }
229
-
230
-    /**
231
-     * @return string
232
-     */
233
-    public function getUrlAdmin(): ?string
234
-    {
235
-        return $this->urlAdmin;
236
-    }
237
-
238
-    /**
239
-     * @param string $urlAdmin
240
-     */
241
-    public function setUrlAdmin(string $urlAdmin)
242
-    {
243
-        $this->urlAdmin = $urlAdmin;
244
-    }
245
-
246
-    /**
247
-     * @return boolean
248
-     */
249
-    public function getActive(): ?bool
250
-    {
251
-        return $this->active;
252
-    }
253
-
254
-    /**
255
-     * @param bool $active
256
-     */
257
-    public function setActive(bool $active)
258
-    {
259
-        $this->active = $active;
260
-    }
261
-
262
-    /**
263
-     * @return int
264
-     */
265
-    public function getOrder(): ?int
266
-    {
267
-        return $this->order;
268
-    }
269
-
270
-    /**
271
-     * @param int $order
272
-     */
273
-    public function setOrder(int $order)
274
-    {
275
-        $this->order = $order;
276
-    }
277
-
278
-    /**
279
-     * @return bool
280
-     */
281
-    public function getDisplayed(): ?bool
282
-    {
283
-        return $this->displayed;
284
-    }
285
-
286
-    /**
287
-     * @param bool $displayed
288
-     */
289
-    public function setDisplayed(bool $displayed)
290
-    {
291
-        $this->displayed = $displayed;
292
-    }
293
-
294
-    /**
295
-     * @return bool
296
-     */
297
-    public function getDevMode(): bool
298
-    {
299
-        return $this->devMode;
300
-    }
301
-
302
-    /**
303
-     * @param bool $devMode
304
-     * @return Module
305
-     */
306
-    public function setDevMode(bool $devMode): Module
307
-    {
308
-        $this->devMode = $devMode;
309
-
310
-        return $this;
311
-    }
312
-
313
-    /**
314
-     * @return \DateTime
315
-     */
316
-    public function getCreationDate(): \DateTime
317
-    {
318
-        return $this->creationDate;
319
-    }
320
-
321
-    /**
322
-     * @param \DateTime $creationDate
323
-     */
324
-    public function setCreationDate(\DateTime $creationDate)
325
-    {
326
-        $this->creationDate = $creationDate;
327
-    }
328
-
329
-    /**
330
-     * @return \DateTime
331
-     */
332
-    public function getUpdateDate(): \DateTime
333
-    {
334
-        return $this->updateDate;
335
-    }
336
-
337
-    /**
338
-     * @param \DateTime $updateDate
339
-     */
340
-    public function setUpdateDate(\DateTime $updateDate)
341
-    {
342
-        $this->updateDate = $updateDate;
343
-    }
344
-
345
-    public function getFormattedActive()
346
-    {
347
-        return $this->getActive() ? "Oui" : "Non";
348
-    }
349
-
350
-    public function getFormattedDisplayed()
351
-    {
352
-        return $this->getDisplayed() ? "Oui" : "Non";
353
-    }
16
+				/**
17
+				 * @var integer
18
+				 *
19
+				 * @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true})
20
+				 * @ORM\Id
21
+				 * @ORM\GeneratedValue(strategy="IDENTITY")
22
+				 */
23
+				private $id;
24
+
25
+				/**
26
+				 * @var string
27
+				 *
28
+				 * @ORM\Column(name="package_name", type="string", length=255, nullable=false)
29
+				 */
30
+				private $packageName;
31
+
32
+				/**
33
+				 * @var string
34
+				 *
35
+				 * @ORM\Column(name="title_tag", type="string", length=70, nullable=true)
36
+				 */
37
+				private $titleTag;
38
+
39
+				/**
40
+				 * @var string
41
+				 *
42
+				 * @ORM\Column(name="description_tag", type="string", length=160, nullable=true)
43
+				 */
44
+				private $descriptionTag;
45
+
46
+				/**
47
+				 * @var string
48
+				 *
49
+				 * @ORM\Column(name="title", type="string", length=255, nullable=false)
50
+				 */
51
+				private $title;
52
+
53
+				/**
54
+				 * @var string
55
+				 *
56
+				 * @ORM\Column(name="template", type="string", length=255, nullable=true)
57
+				 */
58
+				private $template;
59
+
60
+				/**
61
+				 * @var string
62
+				 *
63
+				 * @ORM\Column(name="url", type="string", length=255, nullable=true)
64
+				 */
65
+				private $url;
66
+
67
+				/**
68
+				 * @var string
69
+				 *
70
+				 * @ORM\Column(name="url_admin", type="string", length=255, nullable=true)
71
+				 */
72
+				private $urlAdmin;
73
+
74
+				/**
75
+				 * @var boolean
76
+				 *
77
+				 * @ORM\Column(name="active", type="boolean", nullable=false)
78
+				 */
79
+				private $active;
80
+
81
+				/**
82
+				 * @var integer
83
+				 *
84
+				 * @ORM\Column(name="`order`", type="integer", nullable=true)
85
+				 */
86
+				private $order;
87
+
88
+				/**
89
+				 * @var boolean
90
+				 *
91
+				 * @ORM\Column(name="displayed", type="boolean", nullable=false)
92
+				 */
93
+				private $displayed;
94
+
95
+				/**
96
+				 * @var boolean
97
+				 *
98
+				 * @ORM\Column(name="dev_mode", type="boolean", nullable=false)
99
+				 */
100
+				private $devMode;
101
+
102
+				/**
103
+				 * @var \DateTime
104
+				 *
105
+				 * @Gedmo\Timestampable(on="create")
106
+				 * @ORM\Column(name="creation_date", type="date", nullable=true)
107
+				 */
108
+				private $creationDate;
109
+
110
+				/**
111
+				 * @var \DateTime
112
+				 *
113
+				 * @Gedmo\Timestampable(on="update")
114
+				 * @ORM\Column(name="update_date", type="date", nullable=true)
115
+				 */
116
+				private $updateDate;
117
+
118
+				/**
119
+				 * @return int
120
+				 */
121
+				public function getId(): int
122
+				{
123
+								return $this->id;
124
+				}
125
+
126
+				/**
127
+				 * @param int $id
128
+				 */
129
+				public function setId(int $id)
130
+				{
131
+								$this->id = $id;
132
+				}
133
+
134
+				/**
135
+				 * @return string
136
+				 */
137
+				public function getPackageName(): ?string
138
+				{
139
+								return $this->packageName;
140
+				}
141
+
142
+				/**
143
+				 * @param string $package_name
144
+				 */
145
+				public function setPackageName(string $package_name)
146
+				{
147
+								$this->packageName = $package_name;
148
+				}
149
+
150
+				/**
151
+				 * @return string
152
+				 */
153
+				public function getTitleTag(): ?string
154
+				{
155
+								return $this->titleTag;
156
+				}
157
+
158
+				/**
159
+				 * @param string $titleTag
160
+				 */
161
+				public function setTitleTag(string $titleTag)
162
+				{
163
+								$this->titleTag = $titleTag;
164
+				}
165
+
166
+				/**
167
+				 * @return string
168
+				 */
169
+				public function getDescriptionTag(): ?string
170
+				{
171
+								return $this->descriptionTag;
172
+				}
173
+
174
+				/**
175
+				 * @param string $descriptionTag
176
+				 */
177
+				public function setDescriptionTag(string $descriptionTag)
178
+				{
179
+								$this->descriptionTag = $descriptionTag;
180
+				}
181
+
182
+				/**
183
+				 * @return string
184
+				 */
185
+				public function getTitle(): ?string
186
+				{
187
+								return $this->title;
188
+				}
189
+
190
+				/**
191
+				 * @param string $title
192
+				 */
193
+				public function setTitle(string $title)
194
+				{
195
+								$this->title = $title;
196
+				}
197
+
198
+				/**
199
+				 * @return string
200
+				 */
201
+				public function getTemplate(): ?string
202
+				{
203
+								return $this->template;
204
+				}
205
+
206
+				/**
207
+				 * @param string $template
208
+				 */
209
+				public function setTemplate(string $template)
210
+				{
211
+								$this->template = $template;
212
+				}
213
+
214
+				/**
215
+				 * @return string
216
+				 */
217
+				public function getUrl(): ?string
218
+				{
219
+								return $this->url;
220
+				}
221
+
222
+				/**
223
+				 * @param string $url
224
+				 */
225
+				public function setUrl(string $url)
226
+				{
227
+								$this->url = $url;
228
+				}
229
+
230
+				/**
231
+				 * @return string
232
+				 */
233
+				public function getUrlAdmin(): ?string
234
+				{
235
+								return $this->urlAdmin;
236
+				}
237
+
238
+				/**
239
+				 * @param string $urlAdmin
240
+				 */
241
+				public function setUrlAdmin(string $urlAdmin)
242
+				{
243
+								$this->urlAdmin = $urlAdmin;
244
+				}
245
+
246
+				/**
247
+				 * @return boolean
248
+				 */
249
+				public function getActive(): ?bool
250
+				{
251
+								return $this->active;
252
+				}
253
+
254
+				/**
255
+				 * @param bool $active
256
+				 */
257
+				public function setActive(bool $active)
258
+				{
259
+								$this->active = $active;
260
+				}
261
+
262
+				/**
263
+				 * @return int
264
+				 */
265
+				public function getOrder(): ?int
266
+				{
267
+								return $this->order;
268
+				}
269
+
270
+				/**
271
+				 * @param int $order
272
+				 */
273
+				public function setOrder(int $order)
274
+				{
275
+								$this->order = $order;
276
+				}
277
+
278
+				/**
279
+				 * @return bool
280
+				 */
281
+				public function getDisplayed(): ?bool
282
+				{
283
+								return $this->displayed;
284
+				}
285
+
286
+				/**
287
+				 * @param bool $displayed
288
+				 */
289
+				public function setDisplayed(bool $displayed)
290
+				{
291
+								$this->displayed = $displayed;
292
+				}
293
+
294
+				/**
295
+				 * @return bool
296
+				 */
297
+				public function getDevMode(): bool
298
+				{
299
+								return $this->devMode;
300
+				}
301
+
302
+				/**
303
+				 * @param bool $devMode
304
+				 * @return Module
305
+				 */
306
+				public function setDevMode(bool $devMode): Module
307
+				{
308
+								$this->devMode = $devMode;
309
+
310
+								return $this;
311
+				}
312
+
313
+				/**
314
+				 * @return \DateTime
315
+				 */
316
+				public function getCreationDate(): \DateTime
317
+				{
318
+								return $this->creationDate;
319
+				}
320
+
321
+				/**
322
+				 * @param \DateTime $creationDate
323
+				 */
324
+				public function setCreationDate(\DateTime $creationDate)
325
+				{
326
+								$this->creationDate = $creationDate;
327
+				}
328
+
329
+				/**
330
+				 * @return \DateTime
331
+				 */
332
+				public function getUpdateDate(): \DateTime
333
+				{
334
+								return $this->updateDate;
335
+				}
336
+
337
+				/**
338
+				 * @param \DateTime $updateDate
339
+				 */
340
+				public function setUpdateDate(\DateTime $updateDate)
341
+				{
342
+								$this->updateDate = $updateDate;
343
+				}
344
+
345
+				public function getFormattedActive()
346
+				{
347
+								return $this->getActive() ? "Oui" : "Non";
348
+				}
349
+
350
+				public function getFormattedDisplayed()
351
+				{
352
+								return $this->getDisplayed() ? "Oui" : "Non";
353
+				}
354 354
 }
Please login to merge, or discard this patch.