Visitar URL original
Add missing native return types · phpmyadmin/phpmyadmin@b07f039 · GitHub
Skip to content

Commit b07f039

Browse files
committed
Add missing native return types
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent 556594b commit b07f039

6 files changed

Lines changed: 7 additions & 17 deletions

File tree

‎examples/signon-script.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
* @return array<int,string>
2222
*/
23-
function get_login_credentials($user)
23+
function get_login_credentials($user): array
2424
{
2525
/* Optionally we can use passed username */
2626
if (! empty($user)) {

‎phpcs.xml.dist‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@
4747
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification">
4848
<severity>4</severity>
4949
</rule>
50-
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint">
51-
<severity>4</severity>
52-
</rule>
5350
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification">
5451
<severity>4</severity>
5552
</rule>

‎test/classes/AbstractTestCase.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ protected function tearDown(): void
222222
*
223223
* @return mixed the output from the protected method.
224224
*/
225-
protected function callFunction($object, string $className, string $methodName, array $params)
225+
protected function callFunction($object, string $className, string $methodName, array $params): mixed
226226
{
227227
$class = new ReflectionClass($className);
228228
$method = $class->getMethod($methodName);

‎test/classes/InsertEditTest.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3482,10 +3482,8 @@ public function testGetHtmlForInsertEditRowBasedOnColumnPrivileges(): void
34823482
* Convert mixed type value to string
34833483
*
34843484
* @param mixed $value
3485-
*
3486-
* @return string
34873485
*/
3488-
private function parseString($value)
3486+
private function parseString($value): string
34893487
{
34903488
if (is_string($value)) {
34913489
return $value;

‎test/classes/UrlTest.php‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,16 +182,14 @@ public function testGetHiddenFields(): void
182182
);
183183
}
184184

185-
/** @return void */
186-
public function testBuildHttpQueryWithUrlQueryEncryptionDisabled()
185+
public function testBuildHttpQueryWithUrlQueryEncryptionDisabled(): void
187186
{
188187
$GLOBALS['config']->set('URLQueryEncryption', false);
189188
$params = ['db' => 'test_db', 'table' => 'test_table', 'pos' => 0];
190189
$this->assertEquals('db=test_db&table=test_table&pos=0', Url::buildHttpQuery($params));
191190
}
192191

193-
/** @return void */
194-
public function testBuildHttpQueryWithUrlQueryEncryptionEnabled()
192+
public function testBuildHttpQueryWithUrlQueryEncryptionEnabled(): void
195193
{
196194
$_SESSION = [];
197195
$GLOBALS['config']->set('URLQueryEncryption', true);
@@ -213,8 +211,7 @@ public function testBuildHttpQueryWithUrlQueryEncryptionEnabled()
213211
$this->assertSame('{"db":"test_db","table":"test_table"}', $decrypted);
214212
}
215213

216-
/** @return void */
217-
public function testQueryEncryption()
214+
public function testQueryEncryption(): void
218215
{
219216
$_SESSION = [];
220217
$GLOBALS['config']->set('URLQueryEncryption', true);

‎test/selenium/TestBase.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -887,10 +887,8 @@ public function moveto(RemoteWebElement $element): void
887887
/**
888888
* Wrapper around alertText method to not use it on not supported
889889
* browsers.
890-
*
891-
* @return mixed
892890
*/
893-
public function alertText()
891+
public function alertText(): mixed
894892
{
895893
/**
896894
* Not supported in Safari Webdriver, see

0 commit comments

Comments
 (0)