2525use Symfony \Component \OptionsResolver \OptionsResolver ;
2626
2727/**
28- * Fetch entities from doctrine
28+ * Fetch entities from doctrine.
2929 */
3030class DatabaseReaderTask extends AbstractConfigurableTask implements IterableTaskInterface, FinalizableTaskInterface
3131{
@@ -42,11 +42,11 @@ public function __construct(
4242 /**
4343 * Moves the internal pointer to the next element,
4444 * return true if the task has a next element
45- * return false if the task has terminated it's iteration
45+ * return false if the task has terminated it's iteration.
4646 */
4747 public function next (ProcessState $ state ): bool
4848 {
49- if (! $ this ->statement ) {
49+ if (!$ this ->statement ) {
5050 return false ;
5151 }
5252
@@ -58,20 +58,20 @@ public function next(ProcessState $state): bool
5858 public function execute (ProcessState $ state ): void
5959 {
6060 $ options = $ this ->getOptions ($ state );
61- if (! $ this ->statement ) {
61+ if (!$ this ->statement ) {
6262 $ this ->statement = $ this ->initializeStatement ($ state );
6363 }
6464
6565 // Check if the next item has been stored by the next() call
66- if ($ this -> nextItem !== null ) {
66+ if (null !== $ this -> nextItem ) {
6767 $ result = $ this ->nextItem ;
6868 $ this ->nextItem = null ;
6969 } else {
7070 $ result = $ this ->statement ->fetchAssociative ();
7171 }
7272
7373 // Handle empty results
74- if ($ result === false ) {
74+ if (false === $ result ) {
7575 $ logContext = [
7676 'options ' => $ options ,
7777 ];
@@ -82,10 +82,10 @@ public function execute(ProcessState $state): void
8282 return ;
8383 }
8484
85- if ($ options ['paginate ' ] !== null ) {
85+ if (null !== $ options ['paginate ' ]) {
8686 $ results = [];
8787 $ i = 0 ;
88- while ($ result !== false && $ i ++ < $ options ['paginate ' ]) {
88+ while (false !== $ result && $ i ++ < $ options ['paginate ' ]) {
8989 $ results [] = $ result ;
9090 $ result = $ this ->statement ->fetchAssociative ();
9191 }
@@ -106,7 +106,7 @@ protected function initializeStatement(ProcessState $state): Result
106106 $ connection = $ this ->getConnection ($ state );
107107 $ sql = $ options ['sql ' ];
108108
109- if ($ sql === null ) {
109+ if (null === $ sql ) {
110110 $ qb = $ connection ->createQueryBuilder ();
111111 $ qb
112112 ->select ('tbl.* ' )
@@ -172,7 +172,7 @@ protected function configureOptions(OptionsResolver $resolver): void
172172
173173 protected function getConnection (ProcessState $ state ): Connection
174174 {
175- /** @noinspection PhpIncompatibleReturnTypeInspection */
175+ /* @noinspection PhpIncompatibleReturnTypeInspection */
176176 return $ this ->doctrine ->getConnection ($ this ->getOption ($ state , 'connection ' ));
177177 }
178178}
0 commit comments