Skip to content

Commit ddb83e2

Browse files
Cleanup fix new rector findings
1 parent d0ba205 commit ddb83e2

9 files changed

+28
-28
lines changed

Classes/Database/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function doInsert($tablename, $values, $debug = 0, array $options = [])
117117
$this->insertCrdateAndTimestamp($values, $tablename),
118118
$debug
119119
);
120-
$this->log('doInsert', $tablename, '1=1 AND `'.$tablename.'`.`uid`=\''.$newUid.'\'', $values);
120+
$this->log('doInsert', $tablename, '1=1 AND `'.$tablename."`.`uid`='".$newUid."'", $values);
121121

122122
return $newUid;
123123
}

mod1/util/class.tx_mklib_mod1_util_Language.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public static function getAddLocalizationLinks(
190190
$onclick = $mod->issueCommand(
191191
'&cmd['.$item->getTableName().']['.$item->getUid().'][localize]='.$lang['uid']
192192
);
193-
$onclick = 'window.location.href=\''.$onclick.'\'; return false;';
193+
$onclick = "window.location.href='".$onclick."'; return false;";
194194

195195
$out .= sprintf(
196196
'<a href="#" onclick="%1$s">%2$s</a>',

srv/class.tx_mklib_srv_StaticCountries.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,21 @@ protected function getSearchClass(): string
7373

7474
public function create(array $data): never
7575
{
76-
throw new Exception('creating a static country via the service can\'t be done.');
76+
throw new Exception("creating a static country via the service can't be done.");
7777
}
7878

7979
public function handleUpdate(Sys25\RnBase\Domain\Model\RecordInterface $model, array $data, $where = '', $debug = 0, $noQuoteFields = ''): never
8080
{
81-
throw new Exception('updating a static country via the service can\'t be done.');
81+
throw new Exception("updating a static country via the service can't be done.");
8282
}
8383

8484
public function handleDelete(Sys25\RnBase\Domain\Model\RecordInterface $model, $where = '', $mode = 0, $table = null): never
8585
{
86-
throw new Exception('deleting a static country via the service can\'t be done.');
86+
throw new Exception("deleting a static country via the service can't be done.");
8787
}
8888

8989
public function handleCreation(array $data): never
9090
{
91-
throw new Exception('creating a static country via the service can\'t be done.');
91+
throw new Exception("creating a static country via the service can't be done.");
9292
}
9393
}

srv/class.tx_mklib_srv_StaticCountryZones.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,21 @@ public function getByZnCode($znCode)
7575

7676
public function create(array $data): never
7777
{
78-
throw new Exception('creating a static country zone via the service can\'t be done.');
78+
throw new Exception("creating a static country zone via the service can't be done.");
7979
}
8080

8181
public function handleUpdate(Sys25\RnBase\Domain\Model\RecordInterface $model, array $data, $where = '', $debug = 0, $noQuoteFields = ''): never
8282
{
83-
throw new Exception('updating a static country zone via the service can\'t be done.');
83+
throw new Exception("updating a static country zone via the service can't be done.");
8484
}
8585

8686
public function handleDelete(Sys25\RnBase\Domain\Model\RecordInterface $model, $where = '', $mode = 0, $table = null): never
8787
{
88-
throw new Exception('deleting a static country zone via the service can\'t be done.');
88+
throw new Exception("deleting a static country zone via the service can't be done.");
8989
}
9090

9191
public function handleCreation(array $data): never
9292
{
93-
throw new Exception('creating a static country zone via the service can\'t be done.');
93+
throw new Exception("creating a static country zone via the service can't be done.");
9494
}
9595
}

tests/action/tx_mklib_tests_action_ShowSingeItemTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ public function testHandleRequestSubstitutesPageTitleNotIfNotConfigured(): void
404404
self::assertNotEquals(
405405
$this->defaultSubstitutedPageTitle,
406406
Sys25\RnBase\Utility\TYPO3::getTSFE()->page['title'],
407-
Sys25\RnBase\Utility\TYPO3::class.'::getTSFE()->page[\'title\'] doch ersetzt'
407+
Sys25\RnBase\Utility\TYPO3::class."::getTSFE()->page['title'] doch ersetzt"
408408
);
409409
self::assertNotEquals(
410410
$this->defaultSubstitutedPageTitle,
@@ -464,7 +464,7 @@ public function testHandleRequestSubstitutesPageTitleIfConfigured(): void
464464
self::assertEquals(
465465
$this->defaultSubstitutedPageTitle,
466466
Sys25\RnBase\Utility\TYPO3::getTSFE()->page['title'],
467-
Sys25\RnBase\Utility\TYPO3::class.'::getTSFE()->page[\'title\'] falsch ersetzt'
467+
Sys25\RnBase\Utility\TYPO3::class."::getTSFE()->page['title'] falsch ersetzt"
468468
);
469469
self::assertEquals(
470470
$this->defaultSubstitutedPageTitle,

tests/class.tx_mklib_tests_DBTestCaseSkeleton.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ protected static function importStaticTables(
120120
protected function setUp(): void
121121
{
122122
self::markTestSkipped(
123-
'Database tests don\'t work after the support for TYPO3 9 was introduced'.
124-
' in rn_base and it\'s database connection. Needs refactoring.'
123+
"Database tests don't work after the support for TYPO3 9 was introduced".
124+
" in rn_base and it's database connection. Needs refactoring."
125125
);
126126

127127
try {

tests/mod1/tx_mklib_tests_mod1_Util.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ public static function removeVcAndFormToken(&$sString): void
6363
// auf der cli über cc ist der formtoken um 2 zeichen länger
6464
// den formToken gibt es erst ab TYPO3 4.5
6565
$sVcAndFormTokenRegex = '/&amp;vC=(.*?)&formToken=(.*?)\'\)/';
66-
$sString = preg_replace($sVcAndFormTokenRegex, '\')', (string) $sString);
66+
$sString = preg_replace($sVcAndFormTokenRegex, "')", (string) $sString);
6767
$moduleTokenRegex = '/%26moduleToken%3D(.*?)&amp/';
6868
$sString = preg_replace($moduleTokenRegex, '&amp', (string) $sString);
69-
$sString = str_replace('=1&amp;', '=1\'', $sString);
69+
$sString = str_replace('=1&amp;', "=1'", $sString);
7070
}
7171

7272
/**

tests/repository/tx_mklib_tests_repository_AbstractTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,10 @@ public function testHandleUpdateBuildsWhereClauseWhenNoneGiven(): void
345345
$databaseConnection->expects(self::once())
346346
->method('fullQuoteStr')
347347
->with('123')
348-
->willReturn('\'quoted123\'');
348+
->willReturn("'quoted123'");
349349
$databaseConnection->expects(self::once())
350350
->method('doUpdate')
351-
->with('unknown', '1=1 AND `unknown`.`uid`=\'quoted123\'');
351+
->with('unknown', "1=1 AND `unknown`.`uid`='quoted123'");
352352

353353
$repository->expects(self::once())
354354
->method('getDatabaseUtility')
@@ -384,12 +384,12 @@ public function testHandleUpdateEliminatesNonTcaColumns(): void
384384
$databaseConnection->expects(self::once())
385385
->method('fullQuoteStr')
386386
->with('123')
387-
->willReturn('\'quoted123\'');
387+
->willReturn("'quoted123'");
388388
$databaseConnection->expects(self::once())
389389
->method('doUpdate')
390390
->with(
391391
'unknown',
392-
'1=1 AND `unknown`.`uid`=\'quoted123\'',
392+
"1=1 AND `unknown`.`uid`='quoted123'",
393393
['column_1' => 'new value']
394394
);
395395

@@ -427,10 +427,10 @@ public function testHandleUpdateCallsSecureFromCrossSiteScripting(): void
427427
$databaseConnection->expects(self::once())
428428
->method('fullQuoteStr')
429429
->with('123')
430-
->willReturn('\'quoted123\'');
430+
->willReturn("'quoted123'");
431431
$databaseConnection->expects(self::once())
432432
->method('doUpdate')
433-
->with('unknown', '1=1 AND `unknown`.`uid`=\'quoted123\'', ['secured']);
433+
->with('unknown', "1=1 AND `unknown`.`uid`='quoted123'", ['secured']);
434434

435435
$repository->expects(self::once())
436436
->method('getDatabaseUtility')
@@ -471,12 +471,12 @@ public function testHandleUpdateRemovesUidColumn(): void
471471
$databaseConnection->expects(self::once())
472472
->method('fullQuoteStr')
473473
->with('123')
474-
->willReturn('\'quoted123\'');
474+
->willReturn("'quoted123'");
475475
$databaseConnection->expects(self::once())
476476
->method('doUpdate')
477477
->with(
478478
'unknown',
479-
'1=1 AND `unknown`.`uid`=\'quoted123\'',
479+
"1=1 AND `unknown`.`uid`='quoted123'",
480480
['column_1' => 'new value']
481481
);
482482

tests/scheduler/tx_mklib_tests_scheduler_DeleteFromDatabaseTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ public function testDeleteRowCallsDeleteOnDatabaseUtilityCorrect(): void
110110
$databaseConnection->expects(self::once())
111111
->method('fullQuoteStr')
112112
->with('123')
113-
->willReturn('\'quoted123\'');
113+
->willReturn("'quoted123'");
114114

115115
$databaseConnection->expects(self::once())
116116
->method('delete')
117117
->with(
118118
$this->options['table'],
119-
'uid = \'quoted123\'',
119+
"uid = 'quoted123'",
120120
$this->options['mode']
121121
);
122122

@@ -135,12 +135,12 @@ public function testDeleteRowCallsDeleteOnDatabaseUtilityCorrectWhenSelectFields
135135
$databaseConnection->expects(self::once())
136136
->method('fullQuoteStr')
137137
->with('123')
138-
->willReturn('\'quoted123\'');
138+
->willReturn("'quoted123'");
139139
$databaseConnection->expects(self::once())
140140
->method('delete')
141141
->with(
142142
$this->options['table'],
143-
$this->options['uidField'].' = \'quoted123\'',
143+
$this->options['uidField']." = 'quoted123'",
144144
$this->options['mode']
145145
);
146146

0 commit comments

Comments
 (0)