Merge pull request #5491 from marc1706/ticket/14948

[ticket/14948] Update to PHP 7.1+ and Twig 2.x
This commit is contained in:
Derk 2019-01-02 23:34:52 +01:00 committed by GitHub
commit 8bbf591cdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
221 changed files with 1254 additions and 1049 deletions

View file

@ -9,13 +9,13 @@ environment:
matrix:
- db: mssql
db_version: sql2012sp1
php: 7.0
php: 7.1
- db: mssql
db_version: sql2014
php: 7.0
php: 7.1
- db: mssql
db_version: sql2016
php: 7.1.12
php: 7.2
# - db: mssql
# db_version: sql2017
# php: 7.1
@ -63,10 +63,11 @@ before_test:
# Get MSSQL driver
if ($env:db -eq "mssql") {
cd c:\tools\php\ext
$DLLVersion = "4.1.6.1"
curl -o php_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-vc14-x64.zip https://windows.php.net/downloads/pecl/releases/sqlsrv/$($:DLLVersion)/php_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-vc14-x64.zip
$DLLVersion = "5.3.0"
$VCVersion = If ([System.Version]"$($env:php)" -ge [System.Version]"7.2") {"vc15"} Else {"vc14"}
curl -o php_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-vc14-x64.zip https://windows.php.net/downloads/pecl/releases/sqlsrv/$($:DLLVersion)/php_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-$($VCVersion)-x64.zip
7z x -y php_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-vc14-x64.zip > $null
curl -o php_pdo_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-vc14-x64.zip https://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/$($DLLVersion)/php_pdo_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-vc14-x64.zip
curl -o php_pdo_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-vc14-x64.zip https://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/$($DLLVersion)/php_pdo_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-$($VCVersion)-x64.zip
7z x -y php_pdo_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-vc14-x64.zip > $null
Remove-Item c:\tools\php\* -include .zip
cd c:\tools\php

View file

@ -3,29 +3,28 @@ sudo: required
matrix:
include:
- php: 5.6
env: DB=none;NOTESTS=1
- php: 5.6
env: DB=mariadb
- php: 5.6
env: DB=postgres
- php: 5.6
env: DB=sqlite3
- php: 5.6
env: DB=mysqli;SLOWTESTS=1
- php: 5.6
env: DB=mysqli # MyISAM
- php: 5.6
env: DB=mysql
- php: 7.0
env: DB=mysqli
- php: 7.1
env: DB=none;NOTESTS=1
- php: 7.1
env: DB=mariadb
- php: 7.1
env: DB=postgres
- php: 7.1
env: DB=sqlite3
- php: 7.1
env: DB=mysqli;SLOWTESTS=1
- php: 7.1
env: DB=mysqli # MyISAM
- php: 7.2
env: DB=mysqli
- php: 7.2
env: DB=mysqli
- php: 7.3
env: DB=mysqli
- php: nightly
env: DB=mysqli
allow_failures:
- php: 7.3
- php: nightly
fast_finish: true

View file

@ -81,29 +81,36 @@
--ignore=${project.basedir}/phpBB/phpbb/db/migration/data/v30x/*
phpBB/phpbb"
dir="." returnProperty="retval-php-strict" passthru="true" />
<php function="preg_replace" returnProperty="sniffIgnoreList">
<param value="/\s+/"/>
<param value=""/>
<param value="${project.basedir}/phpBB/cache/*,
${project.basedir}/phpBB/develop/*,
${project.basedir}/phpBB/ext/*,
${project.basedir}/phpBB/includes/diff/*.php,
${project.basedir}/phpBB/includes/sphinxapi.php,
${project.basedir}/phpBB/includes/utf/data/*,
${project.basedir}/phpBB/install/data/*,
${project.basedir}/phpBB/install/database_update.php,
${project.basedir}/phpBB/phpbb/*,
${project.basedir}/phpBB/vendor/*,
${project.basedir}/phpBB/vendor-ext/*,
${project.basedir}/phpBB/config.php,
${project.basedir}/phpBB/config_dev.php,
${project.basedir}/phpBB/config_test.php"/>
</php>
<exec command="phpBB/vendor/bin/phpcs
-s -p
--extensions=php
--standard=build/code_sniffer/ruleset-php-legacy-core.xml
--ignore=${project.basedir}/phpBB/cache/*
--ignore=${project.basedir}/phpBB/develop/*
--ignore=${project.basedir}/phpBB/ext/*
--ignore=${project.basedir}/phpBB/includes/diff/*.php
--ignore=${project.basedir}/phpBB/includes/sphinxapi.php
--ignore=${project.basedir}/phpBB/includes/utf/data/*
--ignore=${project.basedir}/phpBB/install/data/*
--ignore=${project.basedir}/phpBB/install/database_update.php
--ignore=${project.basedir}/phpBB/phpbb/*
--ignore=${project.basedir}/phpBB/vendor/*
--ignore=${project.basedir}/phpBB/vendor-ext/*
--ignore=${sniffIgnoreList}
phpBB"
dir="." returnProperty="retval-php-legacy" passthru="true" />
<exec command="phpBB/vendor/bin/phpcs
-s -p
--extensions=php
--standard=build/code_sniffer/ruleset-php-extensions.xml
--ignore=${project.basedir}/phpBB/ext/*/tests/*
--ignore=${project.basedir}/phpBB/ext/*/vendor/*
--ignore=${project.basedir}/phpBB/ext/*/tests/*,${project.basedir}/phpBB/ext/*/vendor/*
phpBB/ext"
dir="." returnProperty="retval-php-ext" passthru="true" />
<if>

View file

@ -11,6 +11,9 @@
*
*/
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\Sniff;
/**
* Checks that each PHP source file contains a valid header as defined by the
* phpBB Coding Guidelines.
@ -18,7 +21,7 @@
* @package code_sniffer
* @author Manuel Pichler <mapi@phpundercontrol.org>
*/
class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
class phpbb_Sniffs_Commenting_FileCommentSniff implements Sniff
{
/**
* Returns an array of tokens this test wants to listen for.
@ -33,13 +36,13 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
*
* @return null
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
public function process(File $phpcsFile, $stackPtr): void
{
// We are only interested in the first file comment.
if ($stackPtr !== 0)
@ -62,7 +65,7 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
// Mark as error if this is not a doc comment
else if ($start === false || $tokens[$start]['code'] !== T_DOC_COMMENT_OPEN_TAG)
{
$phpcsFile->addError('Missing required file doc comment.', $stackPtr);
$phpcsFile->addError('Missing required file doc comment.', $stackPtr, 'MissingComment');
return;
}
@ -82,7 +85,7 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
if ($tokens[$token]['column'] === 1 && (($tokens[$token]['content'] !== '*' && $tokens[$token]['content'] !== ' ') || ($tokens[$token]['content'] === ' ' && $tokens[$token + 1]['content'] !== '*')))
{
$message = 'The file doc comment should not be indented.';
$phpcsFile->addWarning($message, $token);
$phpcsFile->addWarning($message, $token, 'CommentIndented');
}
}
@ -95,13 +98,13 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
if (!(($tokens[$start + 2]['content'] !== '*' && $tokens[$start + 4]['content'] !== '*') || ($tokens[$start + 3]['content'] !== '*' && $tokens[$start + 6]['content'] !== '*')))
{
$message = 'The first file comment line should be empty.';
$phpcsFile->addWarning($message, ($start + 1));
$phpcsFile->addWarning($message, ($start + 1), 'CommentFirstNotEmpty');
}
if ($tokens[$end - 3]['content'] !== '*' && $tokens[$end - 6]['content'] !== '*')
{
$message = 'The last file comment line should be empty.';
$phpcsFile->addWarning($message, $end - 1);
$phpcsFile->addWarning($message, $end - 1, 'CommentLastNotEmpty');
}
//$this->processPackage($phpcsFile, $start, $tags);
@ -113,59 +116,59 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
/**
* Checks that the tags array contains a valid package tag
*
* @param PHP_CodeSniffer_File $phpcsFile The context source file instance.
* @param File $phpcsFile The context source file instance.
* @param integer The stack pointer for the first comment token.
* @param array(string=>array) $tags The found file doc comment tags.
*
* @return null
* @return void
*/
protected function processPackage(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags)
protected function processPackage(File $phpcsFile, $ptr, $tags): void
{
if (!isset($tags['package']))
{
$message = 'Missing require @package tag in file doc comment.';
$phpcsFile->addError($message, $ptr);
$phpcsFile->addError($message, $ptr, 'MissingTagPackage');
}
else if (preg_match('/^([\w]+)$/', $tags['package'][0]) === 0)
{
$message = 'Invalid content found for @package tag.';
$phpcsFile->addWarning($message, $tags['package'][1]);
$phpcsFile->addWarning($message, $tags['package'][1], 'InvalidTagPackage');
}
}
/**
* Checks that the tags array contains a valid version tag
*
* @param PHP_CodeSniffer_File $phpcsFile The context source file instance.
* @param File $phpcsFile The context source file instance.
* @param integer The stack pointer for the first comment token.
* @param array(string=>array) $tags The found file doc comment tags.
*
* @return null
* @return void
*/
protected function processVersion(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags)
protected function processVersion(File $phpcsFile, $ptr, $tags): void
{
if (!isset($tags['version']))
{
$message = 'Missing require @version tag in file doc comment.';
$phpcsFile->addError($message, $ptr);
$phpcsFile->addError($message, $ptr, 'MissingTagVersion');
}
else if (preg_match('/^\$Id:[^\$]+\$$/', $tags['version'][0]) === 0)
{
$message = 'Invalid content found for @version tag, use "$Id: $".';
$phpcsFile->addError($message, $tags['version'][1]);
$phpcsFile->addError($message, $tags['version'][1], 'InvalidTagVersion');
}
}
/**
* Checks that the tags array contains a valid copyright tag
*
* @param PHP_CodeSniffer_File $phpcsFile The context source file instance.
* @param File $phpcsFile The context source file instance.
* @param integer The stack pointer for the first comment token.
* @param array(string=>array) $tags The found file doc comment tags.
*
* @return null
* @return void
*/
protected function processCopyright(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags)
protected function processCopyright(File $phpcsFile, $ptr, $tags): void
{
$copyright = '(c) phpBB Limited <https://www.phpbb.com>';
$tokens = $phpcsFile->getTokens();
@ -177,7 +180,7 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
if ($tokens[$tag + 2]['content'] !== $copyright)
{
$message = 'Invalid content found for the first @copyright tag, use "' . $copyright . '".';
$phpcsFile->addError($message, $tags['copyright'][0][1]);
$phpcsFile->addError($message, $tags['copyright'][0][1], 'InvalidTagCopyright');
}
return;
@ -185,19 +188,19 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
}
$message = 'Missing require @copyright tag in file doc comment.';
$phpcsFile->addError($message, $ptr);
$phpcsFile->addError($message, $ptr, 'MissingTagCopyright');
}
/**
* Checks that the tags array contains a valid license tag
*
* @param PHP_CodeSniffer_File $phpcsFile The context source file instance.
* @param File $phpcsFile The context source file instance.
* @param integer The stack pointer for the first comment token.
* @param array(string=>array) $tags The found file doc comment tags.
*
* @return null
* @return void
*/
protected function processLicense(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags)
protected function processLicense(File $phpcsFile, $ptr, $tags): void
{
$license = 'GNU General Public License, version 2 (GPL-2.0)';
$tokens = $phpcsFile->getTokens();
@ -210,7 +213,7 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
if ($found)
{
$message = 'It must be only one @license tag in file doc comment.';
$phpcsFile->addError($message, $ptr);
$phpcsFile->addError($message, $ptr, 'MultiTagVersion');
}
$found = true;
@ -218,7 +221,7 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
if ($tokens[$tag + 2]['content'] !== $license)
{
$message = 'Invalid content found for @license tag, use "' . $license . '".';
$phpcsFile->addError($message, $tags['license'][0][1]);
$phpcsFile->addError($message, $tags['license'][0][1], 'InvalidTagLicense');
}
}
}
@ -226,7 +229,7 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
if (!$found)
{
$message = 'Missing require @license tag in file doc comment.';
$phpcsFile->addError($message, $ptr);
$phpcsFile->addError($message, $ptr, 'MissingTagLicense');
}
}
}

View file

@ -11,11 +11,14 @@
*
*/
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\Sniff;
/**
* Checks that the opening brace of a control structures is on the line after.
* From Generic_Sniffs_Functions_OpeningFunctionBraceBsdAllmanSniff
*/
class phpbb_Sniffs_ControlStructures_OpeningBraceBsdAllmanSniff implements PHP_CodeSniffer_Sniff
class phpbb_Sniffs_ControlStructures_OpeningBraceBsdAllmanSniff implements Sniff
{
/**
* Registers the tokens that this sniff wants to listen for.
@ -36,13 +39,13 @@ class phpbb_Sniffs_ControlStructures_OpeningBraceBsdAllmanSniff implements PHP_C
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token in the
* stack passed in $tokens.
*
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
public function process(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();

View file

@ -11,11 +11,14 @@
*
*/
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\Sniff;
/**
* Checks that there is exactly one space between the keyword and the opening
* parenthesis of a control structures.
*/
class phpbb_Sniffs_ControlStructures_OpeningParenthesisSniff implements PHP_CodeSniffer_Sniff
class phpbb_Sniffs_ControlStructures_OpeningParenthesisSniff implements Sniff
{
/**
* Registers the tokens that this sniff wants to listen for.
@ -36,13 +39,13 @@ class phpbb_Sniffs_ControlStructures_OpeningParenthesisSniff implements PHP_Code
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token in the
* stack passed in $tokens.
*
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
public function process(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();

View file

@ -11,10 +11,13 @@
*
*/
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\Sniff;
/**
* Checks that each use statement is used.
*/
class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
class phpbb_Sniffs_Namespaces_UnusedUseSniff implements Sniff
{
/**
* {@inheritdoc}
@ -24,7 +27,7 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
return array(T_USE);
}
protected function check($phpcsFile, $found_name, $full_name, $short_name, $line)
protected function check(File $phpcsFile, $found_name, $full_name, $short_name, $line)
{
if ($found_name === $full_name)
@ -44,7 +47,7 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
/**
* {@inheritdoc}
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
public function process(File $phpcsFile, $stackPtr)
{
if ($this->should_ignore_use($phpcsFile, $stackPtr) === true)
{
@ -179,13 +182,13 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
/**
* Check if this use statement is part of the namespace block.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token in
* the stack passed in $tokens.
*
* @return bool
*/
private function should_ignore_use(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
private function should_ignore_use(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
@ -207,7 +210,7 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
}
/**
* @param PHP_CodeSniffer_File $phpcsFile
* @param File $phpcsFile
* @param int $field
* @param array $tokens
* @param string $class_name_full
@ -216,7 +219,7 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
*
* @return bool
*/
private function checkDocblock(PHP_CodeSniffer_File $phpcsFile, $comment_end, $tokens, $class_name_full, $class_name_short)
private function checkDocblock(File $phpcsFile, $comment_end, $tokens, $class_name_full, $class_name_short)
{
$ok = false;

View file

@ -12,7 +12,7 @@
*/
/**
* Minimum Requirement: PHP 5.4.0
* Minimum Requirement: PHP 7.1.0
*/
if (!defined('IN_PHPBB'))

View file

@ -25,8 +25,9 @@
"phpbb/phpbb-core": "self.version"
},
"require": {
"php": ">=5.6",
"bantu/ini-get-wrapper": "1.0.*",
"php": ">=7.1",
"ext-json": "*",
"bantu/ini-get-wrapper": "~1.0",
"composer/composer": "^1.6",
"composer/installers": "^1.4",
"google/recaptcha": "~1.1",
@ -36,32 +37,32 @@
"paragonie/random_compat": "^1.4",
"patchwork/utf8": "^1.1",
"s9e/text-formatter": "^1.3",
"symfony/config": "~3.1",
"symfony/console": "~3.1",
"symfony/debug": "~3.1",
"symfony/dependency-injection": "~3.1",
"symfony/event-dispatcher": "~3.1",
"symfony/filesystem": "~3.1",
"symfony/finder": "~3.1",
"symfony/http-foundation": "~3.1",
"symfony/http-kernel": "~3.1",
"symfony/proxy-manager-bridge": "~3.1",
"symfony/routing": "~3.1",
"symfony/twig-bridge": "~3.1",
"symfony/yaml": "~3.1",
"symfony/config": "~3.4",
"symfony/console": "~3.4",
"symfony/debug": "~3.4",
"symfony/dependency-injection": "~3.4",
"symfony/event-dispatcher": "~3.4",
"symfony/filesystem": "~3.4",
"symfony/finder": "~3.4",
"symfony/http-foundation": "~3.4",
"symfony/http-kernel": "~3.4",
"symfony/proxy-manager-bridge": "~3.4",
"symfony/routing": "~3.4",
"symfony/twig-bridge": "~3.4",
"symfony/yaml": "~3.4",
"twig/twig": "^1.0 || ^2.0"
},
"require-dev": {
"fabpot/goutte": "~3.1",
"facebook/webdriver": "~1.1",
"fabpot/goutte": "~3.2",
"facebook/webdriver": "~1.6",
"laravel/homestead": "~7.0",
"phing/phing": "2.4.*",
"phpunit/dbunit": "~2.0",
"phpunit/phpunit": "^5.7",
"squizlabs/php_codesniffer": "2.*",
"symfony/browser-kit": "~3.1",
"symfony/css-selector": "~3.1",
"symfony/dom-crawler": "~3.1"
"phing/phing": "~2.4",
"phpunit/dbunit": "~4.0",
"phpunit/phpunit": "^7.0",
"squizlabs/php_codesniffer": "~3.4",
"symfony/browser-kit": "~3.4",
"symfony/css-selector": "~3.4",
"symfony/dom-crawler": "~3.4"
},
"extra": {
"branch-alias": {
@ -70,7 +71,7 @@
},
"config": {
"platform": {
"php": "5.6"
"php": "7.1"
}
}
}

1369
phpBB/composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -147,7 +147,7 @@
<li>Oracle</li>
</ul>
</li>
<li><strong>PHP 5.4.7+</strong> with support for the database you intend to use.</li>
<li><strong>PHP 7.1.0+</strong> with support for the database you intend to use.</li>
<li>The following PHP modules are required:
<ul>
<li>json</li>

View file

@ -265,7 +265,7 @@
<ul>
<li>Your server type/version, e.g. Apache 2.2.3, IIS 7, Sambar, etc.</li>
<li>PHP version and mode of operation, e.g. PHP 5.4.0 as a module, PHP 5.4.0 running as CGI, etc.</li>
<li>PHP version and mode of operation, e.g. PHP 7.1.0 as a module, PHP 7.1.0 running as CGI, etc.</li>
<li>DB type/version, e.g. MySQL 5.0.77, PostgreSQL 9.0.6, MSSQL Server 2000 (via ODBC), etc.</li>
</ul>
@ -323,11 +323,11 @@
<div class="content">
<p>phpBB 3.2.x takes advantage of new features added in PHP 5.5.9. We recommend that you upgrade to the latest stable release of PHP to run phpBB. The minimum version required is PHP 5.5.9 and the maximum supported version is the latest stable version of PHP.</p>
<p>phpBB 3.2.x takes advantage of new features added in PHP 7.1.0. We recommend that you upgrade to the latest stable release of PHP to run phpBB. The minimum version required is PHP 7.1.0 and the maximum supported version is the latest stable version of PHP.</p>
<p>Please remember that running any application on a development (unstable, e.g. a beta release) version of PHP can lead to strange/unexpected results which may appear to be bugs in the application. Therefore, we recommend you upgrade to the newest stable version of PHP before running phpBB. If you are running a development version of PHP please check any bugs you find on a system running a stable release before submitting.</p>
<p>This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MariaDB 5.x, PostgreSQL 8.x, Oracle 8 and SQLite 3. Versions of PHP used range from 5.4.7 above 5.6.x to 7.1.x and 7.2.x without problem.</p>
<p>This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MariaDB 5.x, PostgreSQL 8.x, Oracle 8 and SQLite 3. Versions of PHP used range from 7.1.0 to 7.2.x and 7.3.x without issues.</p>
<a name="phpsec"></a><h3>7.i. Notice on PHP security issues</h3>

View file

@ -305,8 +305,8 @@ class compress_zip extends compress
}
}
}
// This is a directory, we are not writting files
continue;
// This is a directory, we are not writing files
continue 2;
}
else
{

View file

@ -23,11 +23,11 @@ $level = E_ALL & ~E_NOTICE & ~E_DEPRECATED;
error_reporting($level);
/**
* Minimum Requirement: PHP 5.4.0
* Minimum Requirement: PHP 7.1.0
*/
if (version_compare(PHP_VERSION, '5.4') < 0)
if (version_compare(PHP_VERSION, '7.1') < 0)
{
die('You are running an unsupported PHP version. Please upgrade to PHP 5.4.0 or higher before trying to install or update to phpBB 3.2');
die('You are running an unsupported PHP version. Please upgrade to PHP 7.1.0 or higher before trying to install or update to phpBB 3.3');
}
// Register globals and magic quotes have been dropped in PHP 5.4 so no need for extra checks

View file

@ -20,9 +20,9 @@ define('PHPBB_ENVIRONMENT', 'production');
$phpbb_root_path = '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
if (version_compare(PHP_VERSION, '5.4') < 0)
if (version_compare(PHP_VERSION, '7.1') < 0)
{
die('You are running an unsupported PHP version. Please upgrade to PHP 5.4.0 or higher before trying to install or update to phpBB 3.2');
die('You are running an unsupported PHP version. Please upgrade to PHP 7.1.0 or higher before trying to install or update to phpBB 3.3');
}
$startup_new_path = $phpbb_root_path . 'install/update/update/new/install/startup.' . $phpEx;

View file

@ -105,7 +105,7 @@ $lang = array_merge($lang, array(
// Server requirements
'PHP_VERSION_REQD' => 'PHP version',
'PHP_VERSION_REQD_EXPLAIN' => 'phpBB requires PHP version 5.4.0 or higher.',
'PHP_VERSION_REQD_EXPLAIN' => 'phpBB requires PHP version 7.1.0 or higher.',
'PHP_GETIMAGESIZE_SUPPORT' => 'PHP getimagesize() function is required',
'PHP_GETIMAGESIZE_SUPPORT_EXPLAIN' => 'In order for phpBB to function correctly, the getimagesize function needs to be available.',
'PCRE_UTF_SUPPORT' => 'PCRE UTF-8 support',

View file

@ -25,7 +25,7 @@ abstract class memory extends \phpbb\cache\driver\base
*/
function __construct()
{
global $phpbb_root_path, $dbname, $table_prefix, $phpbb_container;
global $dbname, $table_prefix, $phpbb_container;
$this->cache_dir = $phpbb_container->getParameter('core.cache_dir');
$this->key_prefix = substr(md5($dbname . $table_prefix), 0, 8) . '_';

View file

@ -98,7 +98,7 @@ class check_server_environment extends \phpbb\install\task_base
{
$php_version = PHP_VERSION;
if (version_compare($php_version, '5.4') < 0)
if (version_compare($php_version, '7.1') < 0)
{
$this->response_helper->add_error_message('PHP_VERSION_REQD', 'PHP_VERSION_REQD_EXPLAIN');

View file

@ -42,13 +42,6 @@ class asset
*/
public function set_url($url)
{
if (version_compare(PHP_VERSION, '5.4.7') < 0 && substr($url, 0, 2) === '//')
{
// Workaround for PHP 5.4.6 and older bug #62844 - add fake scheme and then remove it
$this->components = parse_url('http:' . $url);
$this->components['scheme'] = '';
return;
}
$this->components = parse_url($url);
}

View file

@ -15,20 +15,10 @@ namespace phpbb\template\twig;
class lexer extends \Twig_Lexer
{
public function set_environment(\Twig_Environment $env)
public function tokenize(\Twig_Source $source)
{
$this->env = $env;
}
public function tokenize($code, $filename = null)
{
// Handle \Twig_Source format input
if ($code instanceof \Twig_Source)
{
$source = $code;
$code = $source->getCode();
$filename = $source->getName();
}
$code = $source->getCode();
$filename = $source->getName();
// Our phpBB tags
// Commented out tokens are handled separately from the main replace

View file

@ -41,7 +41,7 @@ class defineparser extends \Twig_TokenParser
{
// This would happen if someone improperly formed their DEFINE syntax
// e.g. <!-- DEFINE $VAR = foo -->
throw new \Twig_Error_Syntax('Invalid DEFINE', $token->getLine(), $this->parser->getFilename());
throw new \Twig_Error_Syntax('Invalid DEFINE', $token->getLine(), $this->parser->getStream()->getSourceContext()->getPath());
}
$stream->expect(\Twig_Token::BLOCK_END_TYPE);

View file

@ -8,7 +8,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="tests/bootstrap.php"
>
<testsuites>
@ -25,8 +24,7 @@
<file>./tests/lint_test.php</file>
</testsuite>
<testsuite name="phpBB UI Tests">
<directory suffix="_test.php" phpVersion="5.3.19"
phpVersionOperator=">=">./tests/ui</directory>
<directory suffix="_test.php">./tests/ui</directory>
</testsuite>
</testsuites>

View file

@ -27,7 +27,7 @@ class phpbb_acp_board_select_auth_method_test extends phpbb_test_case
);
}
public function setUp()
public function setUp(): void
{
parent::setUp();

View file

@ -21,6 +21,9 @@ class phpbb_attachment_delete_test extends \phpbb_database_test_case
/** @var \phpbb\db\driver\driver_interface */
protected $db;
/** @var \phpbb\event\dispatcher_interface */
protected $dispatcher;
/** @var \phpbb\attachment\resync */
protected $resync;
@ -35,13 +38,10 @@ class phpbb_attachment_delete_test extends \phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/resync.xml');
}
public function setUp()
public function setUp(): void
{
global $db, $phpbb_root_path;
parent::setUp();
$cache = $this->createMock('\phpbb\cache\driver\driver_interface');
$this->config = new \phpbb\config\config(array());
$this->db = $this->new_dbal();
$this->resync = new \phpbb\attachment\resync($this->db);

View file

@ -17,7 +17,7 @@ class phpbb_attachment_manager_test extends \phpbb_test_case
protected $resync;
protected $upload;
public function setUp()
public function setUp(): void
{
$this->delete = $this->getMockBuilder('\phpbb\attachment\delete')
->disableOriginalConstructor()

View file

@ -24,7 +24,7 @@ class phpbb_attachment_resync_test extends \phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/resync.xml');
}
public function setUp()
public function setUp(): void
{
parent::setUp();

View file

@ -74,7 +74,7 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/resync.xml');
}
public function setUp()
public function setUp(): void
{
global $config, $phpbb_root_path, $phpEx;

View file

@ -17,7 +17,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
protected $user;
protected $request;
protected function setup()
protected function setup(): void
{
parent::setUp();

View file

@ -25,7 +25,7 @@ class phpbb_auth_provider_oauth_token_storage_test extends phpbb_database_test_c
protected $state_table;
protected $user;
protected function setup()
protected function setup(): void
{
parent::setUp();
@ -73,7 +73,10 @@ class phpbb_auth_provider_oauth_token_storage_test extends phpbb_database_test_c
$token = $cache_token;
}
$this->setExpectedException($exception);
if (!empty($exception))
{
$this->expectException($exception);
}
$stored_token = $this->token_storage->retrieveAccessToken($this->service_name);
$this->assertEquals($token, $stored_token);
@ -120,7 +123,10 @@ class phpbb_auth_provider_oauth_token_storage_test extends phpbb_database_test_c
$token = $cache_token;
}
$this->setExpectedException($exception);
if (!empty($exception))
{
$this->expectException($exception);
}
$stored_token = $this->token_storage->retrieve_access_token_by_session($this->service_name);
$this->assertEquals($token, $stored_token);

View file

@ -25,7 +25,7 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/users.xml');
}
public function setUp()
public function setUp(): void
{
global $phpbb_root_path, $phpEx;

View file

@ -42,7 +42,7 @@ require_once 'test_framework/phpbb_database_test_connection_manager.php';
require_once 'test_framework/phpbb_functional_test_case.php';
require_once 'test_framework/phpbb_ui_test_case.php';
if (version_compare(PHP_VERSION, '5.3.19', ">=") && file_exists(__DIR__ . '/vendor/autoload.php'))
if (file_exists(__DIR__ . '/vendor/autoload.php'))
{
require_once __DIR__ . '/vendor/autoload.php';
}

View file

@ -20,7 +20,6 @@ require_once dirname(__FILE__) . '/common_test_case.php';
class phpbb_cache_apc_driver_test extends phpbb_cache_common_test_case
{
protected static $config;
protected $driver;
public function getDataSet()
{
@ -47,7 +46,7 @@ class phpbb_cache_apc_driver_test extends phpbb_cache_common_test_case
}
}
protected function setUp()
protected function setUp(): void
{
parent::setUp();

View file

@ -20,7 +20,6 @@ require_once dirname(__FILE__) . '/common_test_case.php';
class phpbb_cache_apcu_driver_test extends phpbb_cache_common_test_case
{
protected static $config;
protected $driver;
public function getDataSet()
{
@ -45,9 +44,11 @@ class phpbb_cache_apcu_driver_test extends phpbb_cache_common_test_case
{
self::markTestSkipped('APCu is not enabled for CLI. Set apc.enable_cli=1 in php.ini');
}
parent::setUpBeforeClass();
}
protected function setUp()
protected function setUp(): void
{
global $phpbb_container, $phpbb_root_path;

View file

@ -23,7 +23,7 @@ class phpbb_cache_memory_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/cache_memory.xml');
}
protected function setUp()
protected function setUp(): void
{
global $db;
parent::setUp();

View file

@ -13,6 +13,9 @@
abstract class phpbb_cache_common_test_case extends phpbb_database_test_case
{
/** @var \phpbb\cache\driver\driver_interface */
protected $driver;
public function test_get_put_exists()
{
$this->assertFalse($this->driver->_exists('test_key'));

View file

@ -13,14 +13,12 @@
class phpbb_cache_dummy_driver_test extends phpbb_database_test_case
{
protected $driver;
public function getDataSet()
{
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
}
protected function setUp()
protected function setUp(): void
{
parent::setUp();

View file

@ -16,22 +16,18 @@ require_once dirname(__FILE__) . '/common_test_case.php';
class phpbb_cache_file_driver_test extends phpbb_cache_common_test_case
{
private $cache_dir;
protected $driver;
public function __construct()
{
$this->cache_dir = dirname(__FILE__) . '/../tmp/cache/';
}
public function getDataSet()
{
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
}
protected function setUp()
protected function setUp(): void
{
parent::setUp();
$this->cache_dir = dirname(__FILE__) . '/../tmp/cache/';
if (file_exists($this->cache_dir))
{
// cache directory possibly left after aborted
@ -43,7 +39,7 @@ class phpbb_cache_file_driver_test extends phpbb_cache_common_test_case
$this->driver = new \phpbb\cache\driver\file($this->cache_dir);
}
protected function tearDown()
protected function tearDown(): void
{
if (file_exists($this->cache_dir))
{

View file

@ -13,10 +13,9 @@
require_once dirname(__FILE__) . '/common_test_case.php';
class phpbb_cache_redis_driver_test extends phpbb_cache_common_test_case
class phpbb_cache_redis_driver_test extends \phpbb_cache_common_test_case
{
protected static $config;
protected $driver;
public function getDataSet()
{
@ -41,12 +40,18 @@ class phpbb_cache_redis_driver_test extends phpbb_cache_common_test_case
{
self::markTestSkipped('Test redis host/port is not specified');
}
parent::setUpBeforeClass();
}
protected function setUp()
protected function setUp(): void
{
global $phpbb_root_path, $phpbb_container;
parent::setUp();
$phpbb_container = new phpbb_mock_container_builder();
$phpbb_container->setParameter('core.cache_dir', $phpbb_root_path . 'cache/' . PHPBB_ENVIRONMENT . '/');
$this->driver = new \phpbb\cache\driver\redis(self::$config['host'], self::$config['port']);
$this->driver->purge();
}

View file

@ -23,7 +23,7 @@ class phpbb_captcha_qa_test extends \phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__) . '/../fixtures/empty.xml');
}
public function setUp()
public function setUp(): void
{
global $db, $request, $phpbb_container;

View file

@ -13,7 +13,7 @@
class phpbb_class_loader_test extends \phpbb_test_case
{
public function setUp()
public function setUp(): void
{
global $phpbb_class_loader;
$phpbb_class_loader->unregister();
@ -22,7 +22,7 @@ class phpbb_class_loader_test extends \phpbb_test_case
$phpbb_class_loader_ext->unregister();
}
public function tearDown()
public function tearDown(): void
{
global $phpbb_class_loader_ext;
$phpbb_class_loader_ext->register();

View file

@ -34,7 +34,7 @@ class phpbb_compress_test extends phpbb_test_case
'dir/2_1.txt',
);
protected function setUp()
protected function setUp(): void
{
// Required for compress::add_file
global $phpbb_root_path;
@ -54,7 +54,7 @@ class phpbb_compress_test extends phpbb_test_case
}
}
protected function tearDown()
protected function tearDown(): void
{
foreach (array(dirname(__FILE__) . self::EXTRACT_DIR, dirname(__FILE__) . self::ARCHIVE_DIR) as $dir)
{

View file

@ -22,7 +22,7 @@ class phpbb_config_db_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
}
public function setUp()
public function setUp(): void
{
parent::setUp();

View file

@ -21,7 +21,7 @@ class phpbb_config_db_text_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config_text.xml');
}
public function setUp()
public function setUp(): void
{
parent::setUp();

View file

@ -25,15 +25,12 @@ class phpbb_console_command_cache_purge_test extends phpbb_test_case
protected $db;
protected $config;
public function __construct()
{
$this->cache_dir = dirname(__FILE__) . '/tmp/cache/';
}
protected function setUp()
protected function setUp(): void
{
global $phpbb_root_path, $phpEx;
$this->cache_dir = dirname(__FILE__) . '/tmp/cache/';
if (file_exists($this->cache_dir))
{
// cache directory possibly left after aborted

View file

@ -20,7 +20,7 @@ class phpbb_console_command_config_test extends phpbb_test_case
protected $command_name;
protected $user;
public function setUp()
public function setUp(): void
{
global $phpbb_root_path, $phpEx;

View file

@ -30,7 +30,7 @@ class phpbb_console_command_cron_list_test extends phpbb_test_case
protected $command_tester;
protected function setUp()
protected function setUp(): void
{
global $phpbb_root_path, $phpEx;

View file

@ -32,7 +32,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
}
public function setUp()
public function setUp(): void
{
global $db, $config, $phpbb_root_path, $phpEx;

View file

@ -32,7 +32,7 @@ class phpbb_console_command_thumbnail_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/thumbnail.xml');
}
public function setUp()
public function setUp(): void
{
global $config, $phpbb_root_path, $phpEx, $phpbb_filesystem;
@ -75,7 +75,7 @@ class phpbb_console_command_thumbnail_test extends phpbb_database_test_case
copy(dirname(__FILE__) . '/fixtures/txt.txt', $this->phpbb_root_path . 'files/test_txt');
}
protected function tearDown()
protected function tearDown(): void
{
parent::tearDown();

View file

@ -21,7 +21,7 @@ class phpbb_console_user_activate_test extends phpbb_console_user_base
{
protected $notifications;
public function setUp()
public function setUp(): void
{
parent::setUp();

View file

@ -61,7 +61,10 @@ class phpbb_console_user_add_test extends phpbb_console_user_base
$output->writeln(print_r($response, true));
return $response;
};
$helper = $this->getMock('\Symfony\Component\Console\Helper\QuestionHelper', array('ask'));
$helper = $this->getMockBuilder('\Symfony\Component\Console\Helper\QuestionHelper')
->setMethods(['ask'])
->disableOriginalConstructor()
->getMock();
$helper->expects($this->any())
->method('ask')
->will($this->returnCallback($ask));

View file

@ -30,7 +30,7 @@ abstract class phpbb_console_user_base extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
}
public function setUp()
public function setUp(): void
{
global $auth, $db, $cache, $config, $user, $phpbb_dispatcher, $phpbb_container, $phpbb_root_path, $phpEx;

View file

@ -29,7 +29,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
private $router;
private $routing_helper;
public function setUp()
public function setUp(): void
{
global $phpbb_dispatcher, $phpbb_root_path, $phpEx;

View file

@ -21,7 +21,7 @@ use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
class phpbb_controller_controller_test extends phpbb_test_case
{
public function setUp()
public function setUp(): void
{
$this->extension_manager = new phpbb_mock_extension_manager(
dirname(__FILE__) . '/',
@ -128,7 +128,8 @@ class phpbb_controller_controller_test extends phpbb_test_case
if (!empty($exception))
{
$this->setExpectedException($exception, $exception_message);
$this->expectException($exception);
$this->expectExceptionMessage($exception_message);
}
$this->assertEquals($expected, $resolver->getArguments($symfony_request, $input));

View file

@ -20,7 +20,7 @@ require_once dirname(__FILE__) . '/tasks/simple_should_not_run.php';
class phpbb_cron_manager_test extends \phpbb_test_case
{
public function setUp()
public function setUp(): void
{
$this->manager = $this->create_cron_manager(array(
new phpbb_cron_task_core_dummy_task(),

View file

@ -23,7 +23,7 @@ class phpbb_dbal_auto_increment_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
}
protected function setUp()
protected function setUp(): void
{
parent::setUp();
@ -42,7 +42,7 @@ class phpbb_dbal_auto_increment_test extends phpbb_database_test_case
$this->table_exists = true;
}
protected function tearDown()
protected function tearDown(): void
{
if ($this->table_exists)
{

View file

@ -25,7 +25,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/config.xml');
}
protected function setUp()
protected function setUp(): void
{
parent::setUp();
@ -77,7 +77,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
$this->table_exists = true;
}
protected function tearDown()
protected function tearDown(): void
{
if ($this->table_exists)
{

View file

@ -44,7 +44,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator.xml');
}
public function setUp()
public function setUp(): void
{
parent::setUp();

View file

@ -13,7 +13,7 @@
class phpbb_dbal_migrator_tool_config_test extends phpbb_test_case
{
public function setup()
public function setUp(): void
{
$this->config = new \phpbb\config\config(array());

View file

@ -18,7 +18,7 @@ class phpbb_dbal_migrator_tool_config_text_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator_config_text.xml');
}
public function setup()
public function setUp(): void
{
parent::setup();

View file

@ -21,7 +21,7 @@ class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator_module.xml');
}
public function setup()
public function setUp(): void
{
// Need global $db, $user for delete_module function in acp_modules
global $phpbb_root_path, $phpEx, $skip_add_log, $db, $user, $phpbb_log;

View file

@ -24,7 +24,7 @@ class phpbb_dbal_migrator_tool_permission_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator_permission.xml');
}
public function setup()
public function setUp(): void
{
// Global $db and $cache are needed in acp/auth.php constructor
global $phpbb_root_path, $phpEx, $db, $cache;

View file

@ -16,7 +16,7 @@ class phpbb_dbal_sql_affected_rows_test extends phpbb_database_test_case
/** @var \phpbb\db\driver\driver_interface */
protected $db;
public function setUp()
public function setUp(): void
{
parent::setUp();
$this->db = $this->new_dbal();

View file

@ -16,7 +16,7 @@ class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case
protected $db;
protected $buffer;
public function setUp()
public function setUp(): void
{
parent::setUp();

View file

@ -26,7 +26,7 @@ namespace
protected $phpbb_root_path;
protected $filename;
public function setUp()
public function setUp(): void
{
$this->phpbb_root_path = dirname(__FILE__) . '/';
$this->config_php = new \phpbb\config_php_file($this->phpbb_root_path . 'fixtures/', 'php');

View file

@ -18,7 +18,7 @@ class phpbb_ordered_service_collection_test extends \phpbb_test_case
*/
protected $service_collection;
public function setUp()
public function setUp(): void
{
$container = new phpbb_mock_container_builder();
$container->set('foo', new StdClass);

View file

@ -18,7 +18,7 @@ class phpbb_service_collection_test extends \phpbb_test_case
*/
protected $service_collection;
public function setUp()
public function setUp(): void
{
$container = new phpbb_mock_container_builder();
$container->set('foo', new StdClass);
@ -56,14 +56,16 @@ class phpbb_service_collection_test extends \phpbb_test_case
public function test_get_by_class_many_services_exception()
{
$this->setExpectedException('RuntimeException', 'More than one service definitions found for class "bar_class" in collection.');
$this->expectException('RuntimeException');
$this->expectExceptionMessage('More than one service definitions found for class "bar_class" in collection.');
$this->service_collection->get_by_class('bar_class');
}
public function test_get_by_class_no_service_exception()
{
$this->setExpectedException('RuntimeException', 'No service found for class "baz_class" in collection.');
$this->expectException('RuntimeException');
$this->expectExceptionMessage('No service found for class "baz_class" in collection.');
$this->service_collection->get_by_class('baz_class');
}

View file

@ -19,7 +19,7 @@ class phpbb_email_parsing_test extends phpbb_test_case
/** @var \ReflectionProperty */
protected $reflection_template_property;
public function setUp()
public function setUp(): void
{
global $phpbb_container, $config, $phpbb_root_path, $phpEx, $request, $user;

View file

@ -13,7 +13,7 @@
class phpbb_error_collector_test extends phpbb_test_case
{
public function setUp()
public function setUp(): void
{
parent::setUp();

View file

@ -16,7 +16,7 @@ class phpbb_event_export_php_test extends phpbb_test_case
/** @var \phpbb\event\php_exporter */
protected $exporter;
public function setUp()
public function setUp(): void
{
parent::setUp();

View file

@ -16,7 +16,7 @@ class phpbb_event_php_exporter_test extends phpbb_test_case
/** @var \phpbb\event\php_exporter */
protected $exporter;
public function setUp()
public function setUp(): void
{
parent::setUp();
$this->exporter = new \phpbb\event\php_exporter(dirname(__FILE__) . '/fixtures/');

View file

@ -30,7 +30,7 @@ class phpbb_extension_extension_base_test extends phpbb_test_case
self::$reflection_method_get_migration_file_list->setAccessible(true);
}
public function setUp()
public function setUp(): void
{
$container = new phpbb_mock_container_builder();
$migrator = new phpbb_mock_migrator();

View file

@ -18,7 +18,7 @@ class phpbb_extension_finder_test extends phpbb_test_case
/** @var \phpbb\finder */
protected $finder;
public function setUp()
public function setUp(): void
{
$this->extension_manager = new phpbb_mock_extension_manager(
dirname(__FILE__) . '/',

View file

@ -26,7 +26,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/extensions.xml');
}
protected function setUp()
protected function setUp(): void
{
parent::setUp();

View file

@ -32,7 +32,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/extensions.xml');
}
protected function setUp()
protected function setUp(): void
{
parent::setUp();

View file

@ -24,7 +24,7 @@ class phpbb_extension_modules_test extends phpbb_test_case
protected $finder;
protected $module_manager;
public function setUp()
public function setUp(): void
{
global $phpbb_extension_manager;

View file

@ -25,7 +25,7 @@ class phpbb_feed_attachments_base_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__) . '/../extension/fixtures/extensions.xml');
}
public function setUp()
public function setUp(): void
{
global $phpbb_root_path, $phpEx;
@ -98,7 +98,7 @@ class phpbb_feed_attachments_base_test extends phpbb_database_test_case
if ($expected_exception !== false)
{
$this->setExpectedException($expected_exception);
$this->expectException($expected_exception);
$this->attachments_mocks_feed->get_sql();
}

View file

@ -35,7 +35,7 @@ class phpbb_files_types_base_test extends phpbb_test_case
/** @var string phpBB root path */
protected $phpbb_root_path;
protected function setUp()
protected function setUp(): void
{
global $phpbb_root_path, $phpEx;

View file

@ -38,7 +38,7 @@ class phpbb_files_types_form_test extends phpbb_test_case
/** @var string phpBB root path */
protected $phpbb_root_path;
protected function setUp()
protected function setUp(): void
{
global $phpbb_root_path, $phpEx;

View file

@ -38,7 +38,7 @@ class phpbb_files_types_local_test extends phpbb_test_case
/** @var string phpBB root path */
protected $phpbb_root_path;
protected function setUp()
protected function setUp(): void
{
global $phpbb_root_path, $phpEx;

View file

@ -45,7 +45,7 @@ class phpbb_files_types_remote_test extends phpbb_test_case
/** @var string phpBB root path */
protected $phpbb_root_path;
protected function setUp()
protected function setUp(): void
{
global $config, $phpbb_root_path, $phpEx;

View file

@ -35,7 +35,7 @@ class phpbb_files_upload_test extends phpbb_test_case
/** @var string phpBB root path */
protected $phpbb_root_path;
protected function setUp()
protected function setUp(): void
{
// Global $config required by unique_id
global $config, $phpbb_root_path, $phpEx;

View file

@ -15,7 +15,7 @@ class phpbb_filesystem_clean_path_test extends phpbb_test_case
{
protected $filesystem;
public function setUp()
public function setUp(): void
{
parent::setUp();
$this->filesystem = new \phpbb\filesystem\filesystem();

View file

@ -16,7 +16,7 @@ use phpbb\filesystem\helper as filesystem_helper;
class phpbb_filesystem_helper_clean_path_test extends phpbb_test_case
{
public function setUp()
public function setUp(): void
{
parent::setUp();
}

View file

@ -16,7 +16,7 @@ use phpbb\filesystem\helper as filesystem_helper;
class phpbb_filesystem_helper_is_absolute_test extends phpbb_test_case
{
public function setUp()
public function setUp(): void
{
parent::setUp();
}

View file

@ -25,7 +25,7 @@ class phpbb_filesystem_helper_realpath_test extends phpbb_test_case
self::$filesystem_helper_phpbb_own_realpath->setAccessible(true);
}
public function setUp()
public function setUp(): void
{
parent::setUp();
}

View file

@ -16,7 +16,7 @@ class phpbb_filesystem_is_absolute_test extends phpbb_test_case
/** @var \phpbb\filesystem\filesystem_interface */
protected $filesystem;
public function setUp()
public function setUp(): void
{
parent::setUp();

View file

@ -27,7 +27,7 @@ class phpbb_filesystem_realpath_test extends phpbb_test_case
self::$filesystem_own_realpath->setAccessible(true);
}
public function setUp()
public function setUp(): void
{
parent::setUp();

View file

@ -16,7 +16,7 @@
*/
class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case
{
public function setUp()
public function setUp(): void
{
parent::setUp();

View file

@ -16,7 +16,7 @@
*/
class phpbb_functional_acp_profile_field_test extends phpbb_functional_test_case
{
public function setUp()
public function setUp(): void
{
parent::setUp();

View file

@ -16,7 +16,7 @@
*/
class phpbb_functional_acp_users_test extends phpbb_functional_test_case
{
public function setUp()
public function setUp(): void
{
parent::setUp();

View file

@ -21,7 +21,7 @@ abstract class phpbb_functional_common_avatar_test_case extends phpbb_functional
abstract function get_url();
public function setUp()
public function setUp(): void
{
parent::setUp();
$this->path = __DIR__ . '/fixtures/files/';

View file

@ -37,7 +37,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case
self::$helper->restore_original_ext_dir();
}
public function setUp()
public function setUp(): void
{
parent::setUp();

View file

@ -45,7 +45,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
self::$helper->restore_original_ext_dir();
}
public function setUp()
public function setUp(): void
{
parent::setUp();

View file

@ -41,10 +41,10 @@ class phpbb_functional_extension_global_lang_test extends phpbb_functional_test_
self::$helper->restore_original_ext_dir();
}
public function setUp()
public function setUp(): void
{
parent::setUp();
$this->get_db();
$this->phpbb_extension_manager = $this->get_extension_manager();
@ -52,7 +52,7 @@ class phpbb_functional_extension_global_lang_test extends phpbb_functional_test_
$this->purge_cache();
}
public function tearDown()
public function tearDown(): void
{
parent::tearDown();

View file

@ -40,7 +40,7 @@ class phpbb_functional_extension_module_test extends phpbb_functional_test_case
self::$helper->restore_original_ext_dir();
}
public function setUp()
public function setUp(): void
{
global $db;

View file

@ -41,12 +41,12 @@ class phpbb_functional_extension_permission_lang_test extends phpbb_functional_t
self::$helper->restore_original_ext_dir();
}
public function setUp()
public function setUp(): void
{
parent::setUp();
$this->get_db();
$acl_ary = array(
'auth_option' => 'u_foo',
'is_global' => 1,

View file

@ -20,7 +20,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
static public $init_values = array();
public function setUp()
public function setUp(): void
{
parent::setUp();
$this->purge_cache();

View file

@ -18,14 +18,14 @@ class phpbb_functional_fileupload_form_test extends phpbb_functional_test_case
{
private $path;
public function setUp()
public function setUp(): void
{
parent::setUp();
$this->path = __DIR__ . '/fixtures/files/';
$this->add_lang('posting');
}
public function tearDown()
public function tearDown(): void
{
$iterator = new DirectoryIterator(__DIR__ . '/../../phpBB/files/');
foreach ($iterator as $fileinfo)

View file

@ -37,7 +37,7 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case
/** @var string phpBB root path */
protected $phpbb_root_path;
public function setUp()
public function setUp(): void
{
parent::setUp();
// Only doing this within the functional framework because we need a
@ -69,7 +69,7 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case
$this->phpbb_root_path = $phpbb_root_path;
}
public function tearDown()
public function tearDown(): void
{
global $config, $user;
$user = null;

View file

@ -45,7 +45,7 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case
}
public function tearDown()
public function tearDown(): void
{
$this->login();
$this->admin_login();

Some files were not shown because too many files have changed in this diff Show more