Merge pull request #1350 from PrivateBin/strict_types

enable strict types
This commit is contained in:
El RIDO 2024-06-08 18:36:17 +02:00 committed by GitHub
commit d190507fbe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
50 changed files with 53 additions and 52 deletions

View file

@ -2,6 +2,7 @@
## 1.7.4 (not yet released) ## 1.7.4 (not yet released)
* CHANGED: Saving markdown pastes uses `.md` extension instead of `.txt` (#1293) * CHANGED: Saving markdown pastes uses `.md` extension instead of `.txt` (#1293)
* CHANGED: Enable strict type checking in PHP (#1350)
* FIXED: Reset password input field on creation of new paste (#1194) * FIXED: Reset password input field on creation of new paste (#1194)
* FIXED: Allow database schema upgrade to skip versions (#1343) * FIXED: Allow database schema upgrade to skip versions (#1343)

View file

@ -1,5 +1,5 @@
#!/usr/bin/env php #!/usr/bin/env php
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,5 +1,5 @@
#!/usr/bin/env php #!/usr/bin/env php
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *
@ -413,7 +413,7 @@ class ConfigurationTestGenerator
private function _getHeader() private function _getHeader()
{ {
return <<<'EOT' return <<<'EOT'
<?php <?php declare(strict_types=1);
/** /**
* DO NOT EDIT: This file is generated automatically using configGenerator.php * DO NOT EDIT: This file is generated automatically using configGenerator.php
*/ */

View file

@ -1,5 +1,5 @@
#!/usr/bin/env php #!/usr/bin/env php
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,5 +1,5 @@
#!/usr/bin/env php #!/usr/bin/env php
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *
@ -181,7 +181,7 @@ abstract class AbstractData
protected function getOpenSlot(array &$comments, $postdate) protected function getOpenSlot(array &$comments, $postdate)
{ {
if (array_key_exists($postdate, $comments)) { if (array_key_exists($postdate, $comments)) {
$parts = explode('.', $postdate, 2); $parts = explode('.', (string) $postdate, 2);
if (!array_key_exists(1, $parts)) { if (!array_key_exists(1, $parts)) {
$parts[1] = 0; $parts[1] = 0;
} }

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* VizHash_GD * VizHash_GD
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* PrivateBin * PrivateBin
* *

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use Google\Cloud\Core\Exception\BadRequestException; use Google\Cloud\Core\Exception\BadRequestException;
use Google\Cloud\Core\Exception\NotFoundException; use Google\Cloud\Core\Exception\NotFoundException;

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use PrivateBin\Configuration; use PrivateBin\Configuration;

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use PrivateBin\Controller; use PrivateBin\Controller;

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use PrivateBin\Data\Database; use PrivateBin\Data\Database;
use PrivateBin\Persistence\ServerSalt; use PrivateBin\Persistence\ServerSalt;

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use Google\Auth\HttpHandler\HttpHandlerFactory; use Google\Auth\HttpHandler\HttpHandlerFactory;
use GuzzleHttp\Client; use GuzzleHttp\Client;

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use PrivateBin\Controller; use PrivateBin\Controller;

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use PrivateBin\Data\Filesystem; use PrivateBin\Data\Filesystem;

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use Google\Auth\HttpHandler\HttpHandlerFactory; use Google\Auth\HttpHandler\HttpHandlerFactory;
use GuzzleHttp\Client; use GuzzleHttp\Client;

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use PrivateBin\Filter; use PrivateBin\Filter;

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use PrivateBin\FormatV2; use PrivateBin\FormatV2;

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use PrivateBin\I18n; use PrivateBin\I18n;
@ -198,7 +198,7 @@ class I18nTest extends TestCase
$languageCount = 0; $languageCount = 0;
foreach ($languageIterator as $file) { foreach ($languageIterator as $file) {
++$languageCount; ++$languageCount;
$this->assertTrue(copy($file, $path . DIRECTORY_SEPARATOR . $file->getBasename())); $this->assertTrue(copy($file->getPathname(), $path . DIRECTORY_SEPARATOR . $file->getBasename()));
} }
I18nMock::resetPath($path); I18nMock::resetPath($path);

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use PrivateBin\Controller; use PrivateBin\Controller;

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use PrivateBin\Data\Database; use PrivateBin\Data\Database;
use PrivateBin\Data\Filesystem; use PrivateBin\Data\Filesystem;

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use Identicon\Identicon; use Identicon\Identicon;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use PrivateBin\Data\Filesystem; use PrivateBin\Data\Filesystem;

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use PrivateBin\Data\Filesystem; use PrivateBin\Data\Filesystem;

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use PrivateBin\Data\Filesystem; use PrivateBin\Data\Filesystem;

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use PrivateBin\Request; use PrivateBin\Request;

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use PrivateBin\I18n; use PrivateBin\I18n;

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use PrivateBin\Data\Filesystem; use PrivateBin\Data\Filesystem;

View file

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use PrivateBin\Configuration; use PrivateBin\Configuration;