11<?php
22
3+ declare (strict_types=1 );
4+
35/**
46 * Quantum PHP Framework
57 *
@@ -161,37 +163,37 @@ private function getSteps(): array
161163 return [
162164 [
163165 'message ' => 'Creating API module ' ,
164- 'action ' => function () {
166+ 'action ' => function (): void {
165167 $ this ->createModule ('Api ' , 'DemoApi ' , false );
166168 },
167169 ],
168170 [
169171 'message ' => 'Creating Web module ' ,
170- 'action ' => function () {
172+ 'action ' => function (): void {
171173 $ this ->createModule ('Web ' , 'DemoWeb ' , true );
172174 },
173175 ],
174176 [
175177 'message ' => 'Cleaning up uploads & rebuilding database ' ,
176- 'action ' => function () {
178+ 'action ' => function (): void {
177179 $ this ->resetDatabase ();
178180 },
179181 ],
180182 [
181183 'message ' => 'Generating users ' ,
182- 'action ' => function () {
184+ 'action ' => function (): void {
183185 $ this ->generatedUsers = $ this ->generateUsers ();
184186 },
185187 ],
186188 [
187189 'message ' => 'Generating posts ' ,
188- 'action ' => function () {
190+ 'action ' => function (): void {
189191 $ this ->generatedPosts = $ this ->generatePosts ($ this ->generatedUsers );
190192 },
191193 ],
192194 [
193195 'message ' => 'Generating comments ' ,
194- 'action ' => function () {
196+ 'action ' => function (): void {
195197 $ this ->generateComments ($ this ->generatedUsers , $ this ->generatedPosts );
196198 },
197199 ],
@@ -295,7 +297,7 @@ private function generateComments(array $users, array $posts): void
295297 $ this ->runCommandInternally (self ::COMMANDS ['comment_create ' ], [
296298 'post_uuid ' => $ post ['uuid ' ],
297299 'user_uuid ' => $ commentUser ['uuid ' ],
298- 'content ' => textCleanUp ($ this ->faker ->realText (rand (20 , 100 ))),
300+ 'content ' => textCleanUp ($ this ->faker ->realText (random_int (20 , 100 ))),
299301 ]);
300302 }
301303 }
@@ -374,9 +376,7 @@ private function generatePostData(array $user): array
374376 */
375377 private function getRandomUserExcept (array $ users , string $ excludeUuid ): array
376378 {
377- $ candidates = array_filter ($ users , function ($ u ) use ($ excludeUuid ) {
378- return $ u ['uuid ' ] !== $ excludeUuid ;
379- });
379+ $ candidates = array_filter ($ users , fn (array $ u ): bool => $ u ['uuid ' ] !== $ excludeUuid );
380380
381381 $ candidates = array_values ($ candidates );
382382 return $ candidates [array_rand ($ candidates )];
@@ -454,7 +454,7 @@ private function resetDatabase(): void
454454 * @param array $arguments
455455 * @throws ExceptionInterface
456456 */
457- private function runCommandInternally (string $ commandName , array $ arguments = [])
457+ private function runCommandInternally (string $ commandName , array $ arguments = []): void
458458 {
459459 $ command = $ this ->getApplication ()->find ($ commandName );
460460 $ command ->run (new ArrayInput ($ arguments ), new NullOutput ());
@@ -464,7 +464,7 @@ private function runCommandInternally(string $commandName, array $arguments = []
464464 * @param string $commandName
465465 * @param array $arguments
466466 */
467- private function runCommandExternally (string $ commandName , array $ arguments = [])
467+ private function runCommandExternally (string $ commandName , array $ arguments = []): void
468468 {
469469 $ command = $ this ->buildCommand ($ commandName , $ arguments );
470470 $ this ->runExternalProcess ($ command );
0 commit comments