Merge pull request #6528 from marc1706/ticket/17176

[ticket/17176] Upgrade to Symfony 6.3 and PHP 8.1+
This commit is contained in:
Marc Alexander 2023-09-21 18:45:56 +02:00 committed by GitHub
commit 2989b4be6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
126 changed files with 1701 additions and 1643 deletions

View file

@ -22,5 +22,5 @@ fi
if [ "$MYISAM" == '1' ]
then
mysql -h 127.0.0.1 -u root -e 'SET GLOBAL storage_engine=MyISAM;'
mysql -h 127.0.0.1 -u root -e 'SET GLOBAL default_storage_engine=MyISAM;'
fi

View file

@ -16,4 +16,4 @@ mkdir /var/tmp/slapd
cp .github/ldap/slapd.conf /var/tmp/slapd/slapd.conf
slapd -d 256 -d 128 -f /var/tmp/slapd/slapd.conf -h ldap://localhost:3389 &
sleep 3
ldapadd -h localhost:3389 -D "cn=admin,dc=example,dc=com" -w adminadmin -f .github/ldap/base.ldif
ldapadd -H ldap://localhost:3389 -D "cn=admin,dc=example,dc=com" -w adminadmin -f .github/ldap/base.ldif

View file

@ -28,9 +28,4 @@ fi
cd phpBB
php ../composer.phar install --dev --no-interaction
if [[ "$PHP_VERSION" =~ ^nightly$ || "$PHP_VERSION" =~ ^8 ]]
then
php ../composer.phar remove phpunit/dbunit --dev --update-with-dependencies \
&& php ../composer.phar require symfony/yaml:~4.4 misantron/dbunit:~5.0 phpunit/phpunit:^9.3 doctrine/instantiator:^1.4 --dev --update-with-all-dependencies --ignore-platform-reqs
fi
cd ..

View file

@ -17,12 +17,12 @@ on:
jobs:
# Basic checks, e.g. parse errors, commit messages, etc.
basic-checks:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
include:
- db: 'none'
php: '7.3'
php: '8.1'
NOTESTS: 1
name: PHP ${{ matrix.php }} - ${{ matrix.db }}
@ -42,19 +42,16 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache
env:
PHP_VERSION: ${{ matrix.php }}
run: |
cd phpBB
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
echo "version=${PHP_VERSION%.*}" >> $GITHUB_OUTPUT
cd ..
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ steps.composer-cache.outputs.version }}-${{ hashFiles('phpBB/composer.lock') }}
key: composer-${{ matrix.php }}-${{ hashFiles('phpBB/composer.lock') }}
- name: Setup environment for phpBB
env:
@ -100,44 +97,43 @@ jobs:
# Tests for MySQL and MariaDB
mysql-tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
type: ['unit', 'functional']
php: ['8.1', '8.2', '8.3']
db: [
'mariadb:10.2',
'mariadb:10.3',
'mariadb:10.4',
'mariadb:10.6',
'mariadb:10.9',
'mariadb:10.10',
'mariadb:10.11',
# 'mariadb:11.0' # currently disabled
'mysql:5.7',
'mysql:8.0',
'mysql:8.1'
]
include:
- php: '7.3'
db: "mariadb:10.1"
- php: '7.3'
db: "mariadb:10.2"
- php: '7.3'
db: "mariadb:10.3"
- php: '7.3'
db: "mariadb:10.4"
- php: '7.3'
db: "mariadb:10.5"
- php: '7.3'
db: "mysql:5.6"
db_alias: "MySQL Slow Tests"
SLOWTESTS: 1
- php: '7.3'
db: "mysql:5.6"
db_alias: "MyISAM Tests"
MYISAM: 1
- php: '7.3'
db: "mysql:5.6"
- php: '7.3'
db: "mysql:5.7"
- php: '7.4'
db: "mysql:5.7"
- php: '7.4'
db: "mysql:8.0"
- php: '8.0'
db: "mysql:5.7"
- php: '8.1'
db: 'mysql:5.7'
type: 'unit'
- php: '8.1'
db: 'mysql:5.7'
type: 'functional'
- php: '8.1'
db: "mysql:5.7"
- php: '8.2'
db_alias: "MySQL Slow Tests"
type: 'slow'
SLOWTESTS: 1
- php: '8.1'
db: "mysql:5.7"
db_alias: "MyISAM Tests"
type: 'MyISAM'
MYISAM: 1
name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }}
name: ${{ matrix.type }} - PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }}
services:
mysql:
@ -188,14 +184,13 @@ jobs:
run: |
cd phpBB
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
echo "version=${PHP_VERSION%.*}" >> $GITHUB_OUTPUT
cd ..
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ steps.composer-cache.outputs.version }}-${{ hashFiles('phpBB/composer.lock') }}
key: composer-${{ matrix.php }}-${{ hashFiles('phpBB/composer.lock') }}
- name: Setup environment for phpBB
env:
@ -228,9 +223,16 @@ jobs:
- name: Run unit tests
env:
DB: ${{steps.database-type.outputs.db}}
if: ${{ matrix.SLOWTESTS != 1 && matrix.NOTESTS != 1 }}
if: ${{ matrix.SLOWTESTS != 1 && matrix.NOTESTS != 1 && matrix.type == 'unit' }}
run: |
phpBB/vendor/bin/phpunit --configuration .github/phpunit-$DB-github.xml --verbose --stop-on-error
phpBB/vendor/bin/phpunit --configuration .github/phpunit-$DB-github.xml --verbose --stop-on-error --exclude-group functional,slow
- name: Run functional tests
env:
DB: ${{steps.database-type.outputs.db}}
if: ${{ matrix.SLOWTESTS != 1 && matrix.NOTESTS != 1 && matrix.type == 'functional' }}
run: |
phpBB/vendor/bin/phpunit --configuration .github/phpunit-$DB-github.xml --verbose --stop-on-error --group functional
- name: Slow tests
env:
@ -241,38 +243,42 @@ jobs:
# Tests for PostgreSQL
postgres-tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php: '7.3'
- php: '8.1'
db: "postgres:9.5"
- php: '7.3'
- php: '8.1'
db: "postgres:9.6"
- php: '7.3'
- php: '8.1'
db: "postgres:10"
- php: '7.3'
- php: '8.1'
db: "postgres:11"
- php: '7.3'
- php: '8.1'
db: "postgres:12"
- php: '7.3'
db: "postgres:13"
- php: '7.4'
db: "postgres:13"
- php: '8.0'
db: "postgres:12"
- php: '8.0'
- php: '8.1'
db: "postgres:13"
- php: '8.1'
db: "postgres:14"
- php: '8.1'
db: "postgres:15"
- php: '8.2'
db: "postgres:12"
- php: '8.2'
db: "postgres:13"
- php: '8.2'
db: "postgres:14"
- php: '8.2'
db: "postgres:15"
#- php: '8.3'
# db: "postgres:15"
name: PHP ${{ matrix.php }} - ${{ matrix.db }}
services:
postgres:
image: ${{ matrix.db != 'postgres:9.5' && matrix.db != 'postgres:9.6' && matrix.db != 'postgres:10' && matrix.db != 'postgres:11' && matrix.db != 'postgres:12' && matrix.db != 'postgres:13' && 'postgres:10' || matrix.db }}
image: ${{ matrix.db != 'postgres:9.5' && matrix.db != 'postgres:9.6' && matrix.db != 'postgres:10' && matrix.db != 'postgres:11' && matrix.db != 'postgres:12' && matrix.db != 'postgres:13' && matrix.db != 'postgres:14' && matrix.db != 'postgres:15' && 'postgres:10' || matrix.db }}
env:
POSTGRES_HOST: localhost
POSTGRES_USER: postgres
@ -321,14 +327,13 @@ jobs:
run: |
cd phpBB
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
echo "version=${PHP_VERSION%.*}" >> $GITHUB_OUTPUT
cd ..
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ steps.composer-cache.outputs.version }}-${{ hashFiles('phpBB/composer.lock') }}
key: composer-${{ matrix.php }}-${{ hashFiles('phpBB/composer.lock') }}
- name: Setup environment for phpBB
env:
@ -353,24 +358,27 @@ jobs:
# Other database types, namely sqlite3 and mssql
other-tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php: '7.3'
- php: '8.1'
db: "sqlite3"
- php: '7.3'
- php: '8.1'
db: "mcr.microsoft.com/mssql/server:2017-latest"
db_alias: 'MSSQL 2017'
- php: '7.3'
- php: '8.1'
db: "mcr.microsoft.com/mssql/server:2019-latest"
db_alias: 'MSSQL 2019'
- php: '8.1'
db: "mcr.microsoft.com/mssql/server:2022-latest"
db_alias: 'MSSQL 2022'
name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }}
services:
mssql:
image: ${{ matrix.db != 'mcr.microsoft.com/mssql/server:2017-latest' && matrix.db != 'mcr.microsoft.com/mssql/server:2019-latest' && 'mcr.microsoft.com/mssql/server:2017-latest' || matrix.db }}
image: ${{ matrix.db != 'mcr.microsoft.com/mssql/server:2017-latest' && matrix.db != 'mcr.microsoft.com/mssql/server:2019-latest' && matrix.db != 'mcr.microsoft.com/mssql/server:2022-latest' && 'mcr.microsoft.com/mssql/server:2017-latest' || matrix.db }}
env:
SA_PASSWORD: "Pssw0rd_12"
ACCEPT_EULA: "y"
@ -402,7 +410,7 @@ jobs:
env:
MATRIX_DB: ${{ matrix.db }}
run: |
if [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2017-latest' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2019-latest' ]
if [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2017-latest' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2019-latest' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2022-latest' ]
then
db='mssql'
else
@ -424,14 +432,13 @@ jobs:
run: |
cd phpBB
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
echo "version=${PHP_VERSION%.*}" >> $GITHUB_OUTPUT
cd ..
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ steps.composer-cache.outputs.version }}-${{ hashFiles('phpBB/composer.lock') }}
key: composer-${{ matrix.php }}-${{ hashFiles('phpBB/composer.lock') }}
- name: Setup environment for phpBB
env:
@ -459,33 +466,11 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
include:
- php: '7.4'
db: "postgres"
type: 'unit'
- php: '8.0'
db: "postgres"
type: 'unit'
- php: '8.1'
db: "postgres"
type: 'unit'
- php: '8.2'
db: "postgres"
type: 'unit'
- php: '7.4'
db: "postgres"
type: 'functional'
- php: '8.0'
db: "postgres"
type: 'functional'
- php: '8.1'
db: "postgres"
type: 'functional'
- php: '8.2'
db: "postgres"
type: 'functional'
type: ['unit', 'functional']
php: ['8.1', '8.2']
db: ['postgres']
name: Windows - PHP ${{ matrix.php }} - ${{ matrix.db }} - ${{ matrix.type }}
name: Windows - ${{ matrix.type }} - PHP ${{ matrix.php }} - ${{ matrix.db }}
steps:
- name: Prepare git for Windows
@ -508,15 +493,13 @@ jobs:
run: |
cd phpBB
echo "dir=$(composer config cache-files-dir)" >> $env:GITHUB_OUTPUT
$major_version="${{ matrix.php }}".substring(0,1)
echo "version=$major_version" >> $env:GITHUB_OUTPUT
cd ..
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ steps.composer-cache.outputs.version }}-${{ hashFiles('phpBB/composer.lock') }}
key: composer-${{ matrix.php }}-${{ hashFiles('phpBB/composer.lock') }}
- name: Setup environment for phpBB
env:
@ -559,8 +542,6 @@ jobs:
Set-ACL -Path "${env:TEMP_DIR}" -ACLObject $acl
cd ${env:GITHUB_WORKSPACE}\phpBB
php ..\composer.phar install
php ..\composer.phar remove phpunit/dbunit --dev --update-with-dependencies
php ..\composer.phar require symfony/yaml:~4.4 misantron/dbunit:~5.0 phpunit/phpunit:^9.3 doctrine/instantiator:^1.4 --dev --update-with-all-dependencies --ignore-platform-reqs
cd ..
- name: Setup database
run: |
@ -585,8 +566,8 @@ jobs:
- name: Run unit tests
if: ${{ matrix.type == 'unit' }}
run: |
phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --verbose --stop-on-error --exclude-group functional
- name: Run unit tests
phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --verbose --stop-on-error --exclude-group functional,slow
- name: Run functional tests
if: ${{ matrix.type == 'functional' }}
run: |
phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --verbose --stop-on-error --group functional

15
build/psalm/stubs/gd.php Normal file
View file

@ -0,0 +1,15 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
/** @link https://www.php.net/manual/en/image.constants.php */
define('IMG_COLOR_STYLED', -2);

View file

@ -0,0 +1,16 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
/** @link https://www.php.net/manual/en/ldap.constants.php */
define('LDAP_OPT_PROTOCOL_VERSION', 17);
define('LDAP_OPT_REFERRALS', 8);

View file

@ -0,0 +1,17 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
/** @link https://www.php.net/manual/en/sqlsrv.constants.php */
define('SQLSRV_ERR_ERRORS', 0);
define('SQLSRV_FETCH_ASSOC', 2);
define('SQLSRV_CURSOR_STATIC', 'static');

Binary file not shown.

View file

@ -90,6 +90,6 @@ $user->data['user_id'] = ANONYMOUS;
$user->ip = '127.0.0.1';
$application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $language, $config);
$application->setDispatcher($phpbb_container->get('dispatcher'));
$application->setDispatcher($phpbb_container->get('event_dispatcher'));
$application->register_container_commands($phpbb_container->get('console.command_collection'));
$application->run($input);

View file

@ -97,14 +97,7 @@ require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
// Registered before building the container so the development environment stay capable of intercepting
// the container builder exceptions.
if (PHPBB_ENVIRONMENT === 'development')
{
\phpbb\debug\debug::enable();
}
else
{
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
}
\phpbb\debug\debug::enable(null, PHPBB_ENVIRONMENT === 'development');
$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
$phpbb_class_loader_ext->register();

View file

@ -26,7 +26,7 @@
"phpbb/phpbb-core": "self.version"
},
"require": {
"php": "^7.3 || ^8.0",
"php": "^8.1",
"ext-json": "*",
"ext-mbstring": "*",
"ext-pdo": "*",
@ -35,53 +35,50 @@
"composer/composer": "^2.0",
"composer/installers": "^1.9",
"composer/package-versions-deprecated": "^1.11",
"doctrine/dbal": "^3.0",
"doctrine/dbal": "~3.3.6",
"google/recaptcha": "~1.1",
"guzzlehttp/guzzle": "~6.3",
"lusitanian/oauth": "^0.8.1",
"marc1706/fast-image-size": "^1.1",
"s9e/text-formatter": "^2.0",
"symfony/config": "^5.4",
"symfony/console": "^5.4",
"symfony/debug": "~4.4",
"symfony/dependency-injection": "^5.4",
"symfony/event-dispatcher": "^5.4",
"symfony/filesystem": "^5.4",
"symfony/finder": "^5.4",
"symfony/http-foundation": "^5.4",
"symfony/http-kernel": "^5.4",
"symfony/polyfill-intl-normalizer": "^1.23",
"symfony/polyfill-mbstring": "^1.23",
"symfony/polyfill-php72": "^1.23",
"symfony/mime": "^5.4",
"symfony/process": "^5.4",
"symfony/proxy-manager-bridge": "^5.4",
"symfony/routing": "^5.4",
"symfony/twig-bridge": "^5.4",
"symfony/yaml": "^5.4",
"symfony/config": "^6.3",
"symfony/console": "^6.3",
"symfony/dependency-injection": "^6.3",
"symfony/error-handler": "^6.3",
"symfony/event-dispatcher": "^6.3",
"symfony/filesystem": "^6.3",
"symfony/finder": "^6.3",
"symfony/http-foundation": "^6.3",
"symfony/http-kernel": "^6.3",
"symfony/mime": "^6.3",
"symfony/process": "^6.3",
"symfony/proxy-manager-bridge": "^6.3",
"symfony/routing": "^6.3",
"symfony/twig-bridge": "^6.3",
"symfony/yaml": "^6.3",
"twig/twig": "^3.0"
},
"require-dev": {
"fabpot/goutte": "~3.2",
"laravel/homestead": "~10.17",
"laravel/homestead": "~14.4",
"misantron/dbunit": "~5.0",
"phing/phing": "~2.4",
"phpunit/phpunit": "^9.0",
"squizlabs/php_codesniffer": "~3.4",
"symfony/browser-kit": "^5.4",
"symfony/css-selector": "^5.4",
"symfony/dom-crawler": "^5.4",
"symfony/browser-kit": "^6.3",
"symfony/css-selector": "^6.3",
"symfony/dom-crawler": "^6.3",
"symfony/http-client": "^6.3",
"vimeo/psalm": "^4.14",
"psalm/plugin-symfony": "^3.1"
},
"extra": {
"branch-alias": {
"dev-master": "3.3.x-dev"
"dev-master": "4.0.x-dev"
}
},
"config": {
"platform": {
"php": "7.3.0"
"php": "8.1.0"
},
"allow-plugins": {
"composer/installers": true

2257
phpBB/composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -46,7 +46,7 @@ services:
- '@cache.driver'
- '@config'
- '@dbal.conn'
- '@dispatcher'
- '@event_dispatcher'
- '%core.root_path%'
- '%core.php_ext%'
@ -97,7 +97,7 @@ services:
- '@config'
- '@cron.manager'
- '@dbal.conn'
- '@dispatcher'
- '@event_dispatcher'
- '@language'
- '@request'
- '@routing.helper'
@ -132,7 +132,7 @@ services:
- '@cache'
- '@config'
- '@language'
- '@dispatcher'
- '@event_dispatcher'
- '@path_helper'
- '@user'
@ -142,7 +142,7 @@ services:
- '@dbal.conn'
- '@user'
- '@auth'
- '@dispatcher'
- '@event_dispatcher'
- '%core.root_path%'
- '%core.adm_relative_path%'
- '%core.php_ext%'

View file

@ -5,7 +5,7 @@ services:
arguments:
- '@config'
- '@dbal.conn'
- '@dispatcher'
- '@event_dispatcher'
- '@attachment.resync'
- '@storage.attachment'
@ -32,7 +32,7 @@ services:
- '@config'
- '@files.upload'
- '@language'
- '@dispatcher'
- '@event_dispatcher'
- '@plupload'
- '@storage.attachment'
- '@filesystem.temp'

View file

@ -52,7 +52,7 @@ services:
- '@config'
- '@dbal.conn'
- '@auth.provider.db'
- '@dispatcher'
- '@event_dispatcher'
- '@language'
- '@request'
- '@auth.provider.oauth.service_collection'

View file

@ -3,14 +3,14 @@ services:
class: phpbb\avatar\manager
arguments:
- '@config'
- '@dispatcher'
- '@event_dispatcher'
- '@avatar.driver_collection'
avatar.helper:
class: phpbb\avatar\helper
arguments:
- '@config'
- '@dispatcher'
- '@event_dispatcher'
- '@language'
- '@avatar.manager'
- '@path_helper'
@ -61,7 +61,7 @@ services:
- '%core.php_ext%'
- '@storage.avatar'
- '@path_helper'
- '@dispatcher'
- '@event_dispatcher'
- '@files.factory'
- '@php_ini'
calls:

View file

@ -4,7 +4,7 @@ services:
arguments:
- '@auth'
- '@config'
- '@dispatcher'
- '@event_dispatcher'
- '@dbal.conn'
- '@user'
- '%core.root_path%'
@ -33,7 +33,7 @@ services:
- '@config_text'
- '@dbal.conn'
- '@user'
- '@dispatcher'
- '@event_dispatcher'
- '%core.root_path%'
- '%core.php_ext%'
@ -63,7 +63,7 @@ services:
- '@template'
- '@user'
- '@controller.helper'
- '@dispatcher'
- '@event_dispatcher'
viewonline_helper:
class: phpbb\viewonline_helper

View file

@ -1,5 +1,5 @@
services:
dispatcher:
event_dispatcher:
class: phpbb\event\dispatcher
arguments:
- '@service_container'

View file

@ -11,7 +11,7 @@ services:
- '@feed.helper'
- '@user'
- '@auth'
- '@dispatcher'
- '@event_dispatcher'
- '@language'
- '%core.php_ext%'
@ -36,7 +36,7 @@ services:
- '@user'
- '@auth'
- '@content.visibility'
- '@dispatcher'
- '@event_dispatcher'
- '%core.php_ext%'
feed.forums:
@ -50,7 +50,7 @@ services:
- '@user'
- '@auth'
- '@content.visibility'
- '@dispatcher'
- '@event_dispatcher'
- '%core.php_ext%'
feed.news:
@ -64,7 +64,7 @@ services:
- '@user'
- '@auth'
- '@content.visibility'
- '@dispatcher'
- '@event_dispatcher'
- '%core.php_ext%'
feed.overall:
@ -78,7 +78,7 @@ services:
- '@user'
- '@auth'
- '@content.visibility'
- '@dispatcher'
- '@event_dispatcher'
- '%core.php_ext%'
feed.quote_helper:
@ -96,7 +96,7 @@ services:
- '@user'
- '@auth'
- '@content.visibility'
- '@dispatcher'
- '@event_dispatcher'
- '%core.php_ext%'
feed.topics:
@ -110,7 +110,7 @@ services:
- '@user'
- '@auth'
- '@content.visibility'
- '@dispatcher'
- '@event_dispatcher'
- '%core.php_ext%'
feed.topics_active:
@ -124,5 +124,5 @@ services:
- '@user'
- '@auth'
- '@content.visibility'
- '@dispatcher'
- '@event_dispatcher'
- '%core.php_ext%'

View file

@ -2,7 +2,7 @@ services:
phpbb.help.manager:
class: phpbb\help\manager
arguments:
- '@dispatcher'
- '@event_dispatcher'
- '@language'
- '@template'

View file

@ -2,7 +2,7 @@ services:
http_kernel:
class: Symfony\Component\HttpKernel\HttpKernel
arguments:
- '@dispatcher'
- '@event_dispatcher'
- '@controller.resolver'
- '@request_stack'

View file

@ -6,7 +6,7 @@ services:
- '@notification.method_collection'
- '@service_container'
- '@user_loader'
- '@dispatcher'
- '@event_dispatcher'
- '@dbal.conn'
- '@cache'
- '@language'

View file

@ -6,7 +6,7 @@ services:
- '@config_text'
- '@dbal.conn'
- '@dbal.tools'
- '@dispatcher'
- '@event_dispatcher'
- '@language'
- '@log'
- '@template'

View file

@ -35,7 +35,7 @@ services:
shared: false
arguments:
- '@dbal.conn.driver'
- '@dispatcher'
- '@event_dispatcher'
- '@config'
- '@auth'
- '@user'
@ -46,7 +46,7 @@ services:
shared: false
arguments:
- '@dbal.conn.driver'
- '@dispatcher'
- '@event_dispatcher'
- '@config'
- '@auth'
- '@user'

View file

@ -12,7 +12,7 @@ services:
arguments:
- '@config'
- '@dbal.conn'
- '@dispatcher'
- '@event_dispatcher'
- '@language'
- '@user'
- '%tables.search_results%'
@ -26,7 +26,7 @@ services:
arguments:
- '@config'
- '@dbal.conn'
- '@dispatcher'
- '@event_dispatcher'
- '@language'
- '@user'
- '%tables.search_results%'
@ -42,7 +42,7 @@ services:
arguments:
- '@config'
- '@dbal.conn'
- '@dispatcher'
- '@event_dispatcher'
- '@language'
- '@user'
- '%tables.search_results%'
@ -58,7 +58,7 @@ services:
- '@config'
- '@dbal.conn'
- '@dbal.tools'
- '@dispatcher'
- '@event_dispatcher'
- '@language'
- '@log'
- '@user'

View file

@ -101,7 +101,7 @@ services:
- '@config'
- '@content.visibility'
- '@dbal.conn'
- '@dispatcher'
- '@event_dispatcher'
- '@language'
- '@request'
- '@storage.attachment'

View file

@ -41,7 +41,7 @@ services:
arguments:
- '@text_formatter.data_access'
- '@cache.driver'
- '@dispatcher'
- '@event_dispatcher'
- '@config'
- '@text_formatter.s9e.link_helper'
- '@log'
@ -67,7 +67,7 @@ services:
- '@cache.driver'
- '%text_formatter.cache.parser.key%'
- '@text_formatter.s9e.factory'
- '@dispatcher'
- '@event_dispatcher'
text_formatter.s9e.quote_helper:
class: phpbb\textformatter\s9e\quote_helper
@ -83,7 +83,7 @@ services:
- '%text_formatter.cache.dir%'
- '%text_formatter.cache.renderer.key%'
- '@text_formatter.s9e.factory'
- '@dispatcher'
- '@event_dispatcher'
calls:
- [configure_mention_helper, ['@text_formatter.s9e.mention_helper']]
- [configure_quote_helper, ['@text_formatter.s9e.quote_helper']]

View file

@ -11,7 +11,7 @@ services:
- '%core.template.cache_path%'
- '@ext.manager'
- '@template.twig.loader'
- '@dispatcher'
- '@event_dispatcher'
- []
calls:
- [setLexer, ['@template.twig.lexer']]

View file

@ -4,7 +4,7 @@ services:
arguments:
- '@config'
- '@dbal.conn'
- '@dispatcher'
- '@event_dispatcher'
- '@controller.helper'
- '@language'
- '@log'

View file

@ -2,7 +2,7 @@ services:
acl.permissions:
class: phpbb\permissions
arguments:
- '@dispatcher'
- '@event_dispatcher'
- '@user'
user:

View file

@ -147,7 +147,7 @@
<li>Oracle</li>
</ul>
</li>
<li><strong>PHP 7.3.0+</strong> up to and including <strong>PHP 8.2</strong> with support for the database you intend to use.</li>
<li><strong>PHP 8.1.0+</strong> up to and including <strong>PHP 8.2</strong> with support for the database you intend to use.</li>
<li>The following PHP modules are required:
<ul>
<li>json</li>

View file

@ -323,11 +323,11 @@
<div class="content">
<p>phpBB 3.3.x takes advantage of new features added in PHP 7.1. We recommend that you upgrade to the latest stable release of PHP to run phpBB. The minimum version required is PHP 7.1.3 and the maximum supported version is the latest stable version of PHP.</p>
<p>phpBB 4.0.x takes advantage of new features added in PHP 8.1. We recommend that you upgrade to the latest stable release of PHP to run phpBB. The minimum version required is PHP 8.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 MySQLi 4.1.3, 4.x, 5.x, MariaDB 5.x, PostgreSQL 8.x, Oracle 8 and SQLite 3. Versions of PHP used range from 7.1.3 to 7.2.x and 7.3.x without issues.</p>
<p>This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQLi 4.1.3, 4.x, 5.x, MariaDB 5.x, PostgreSQL 8.x, Oracle 8 and SQLite 3. Versions of PHP used range from 8.1.x to 8.2.x and 8.3.x.</p>
<a name="phpsec"></a><h3>7.i. Notice on PHP security issues</h3>

View file

@ -45,7 +45,7 @@ function register_compatibility_globals()
// Instantiate some basic classes
/* @var $phpbb_dispatcher \phpbb\event\dispatcher */
$phpbb_dispatcher = $phpbb_container->get('dispatcher');
$phpbb_dispatcher = $phpbb_container->get('event_dispatcher');
/* @var $request \phpbb\request\request_interface */
$request = $phpbb_container->get('request');

View file

@ -36,7 +36,7 @@ function gen_rand_string($num_chars = 8)
$output = '';
for ($i = 0; $i < $num_chars; $i++)
{
$rand = random_int(0, $size-1);
$rand = random_int(0, $size - 1);
$output .= $range[$rand];
}

View file

@ -1056,7 +1056,8 @@ class parse_message extends bbcode_firstpass
function __construct($message = '')
{
// Init BBCode UID
$this->bbcode_uid = substr(base_convert(unique_id(), 16, 36), 0, BBCODE_UID_LEN);
$unique_id = preg_replace('/[^0-9a-f]/', '', unique_id());
$this->bbcode_uid = substr(base_convert($unique_id, 16, 36), 0, BBCODE_UID_LEN);
$this->message = $message;
}

View file

@ -23,11 +23,11 @@ $level = E_ALL & ~E_NOTICE & ~E_DEPRECATED;
error_reporting($level);
/**
* Minimum Requirement: PHP 7.3.0
* Minimum Requirement: PHP 8.1.0
*/
if (version_compare(PHP_VERSION, '7.3.0', '<'))
if (version_compare(PHP_VERSION, '8.1.0', '<'))
{
die('You are running an unsupported PHP version (' . PHP_VERSION . '). Please upgrade to PHP 7.3.0 or higher before trying to install or update to phpBB 4.0');
die('You are running an unsupported PHP version (' . PHP_VERSION . '). Please upgrade to PHP 8.1.0 or higher before trying to install or update to phpBB 4.0');
}
// In PHP 5.3.0 the error level has been raised to E_WARNING which causes problems

View file

@ -1448,17 +1448,22 @@ function utf8_wordwrap($string, $width = 75, $break = "\n", $cut = false)
* @param string $filename The filename basename() should be applied to
* @return string The basenamed filename
*/
function utf8_basename($filename)
function utf8_basename($filename): string
{
if (!$filename)
{
return '';
}
// We always check for forward slash AND backward slash
// because they could be mixed or "sneaked" in. ;)
// You know, never trust user input...
if (strpos($filename, '/') !== false)
if (str_contains($filename, '/'))
{
$filename = utf8_substr($filename, utf8_strrpos($filename, '/') + 1);
}
if (strpos($filename, '\\') !== false)
if (str_contains($filename, '\\'))
{
$filename = utf8_substr($filename, utf8_strrpos($filename, '\\') + 1);
}

View file

@ -47,7 +47,7 @@ $template->set_custom_style(array(
), $paths);
/** @var $phpbb_dispatcher \phpbb\event\dispatcher */
$phpbb_dispatcher = $phpbb_installer_container->get('dispatcher');
$phpbb_dispatcher = $phpbb_installer_container->get('event_dispatcher');
/** @var \phpbb\language\language $language */
$language = $phpbb_installer_container->get('language');

View file

@ -50,6 +50,6 @@ $language = $phpbb_installer_container->get('language');
$language->add_lang(array('common', 'acp/common', 'acp/board', 'install', 'posting', 'cli'));
$application = new \phpbb\console\application('phpBB Installer', PHPBB_VERSION, $language, $config);
$application->setDispatcher($phpbb_installer_container->get('dispatcher'));
$application->setDispatcher($phpbb_installer_container->get('event_dispatcher'));
$application->register_container_commands($phpbb_installer_container->get('console.installer.command_collection'));
$application->run($input);

View file

@ -201,7 +201,7 @@ class ldap extends base
1
);
$ldap_result = @ldap_get_entries($ldap, $search);
$ldap_result = $search !== false ? @ldap_get_entries($ldap, $search) : [];
if (is_array($ldap_result) && count($ldap_result) > 1)
{

View file

@ -39,7 +39,7 @@ class config implements \ArrayAccess, \IteratorAggregate, \Countable
*
* @return \ArrayIterator An iterator over all config data
*/
public function getIterator()
public function getIterator(): \ArrayIterator
{
return new \ArrayIterator($this->config);
}
@ -99,7 +99,7 @@ class config implements \ArrayAccess, \IteratorAggregate, \Countable
*
* @return int Number of config options
*/
public function count()
public function count(): int
{
return count($this->config);
}

View file

@ -45,7 +45,7 @@ class application extends \Symfony\Component\Console\Application
/**
* {@inheritdoc}
*/
protected function getDefaultInputDefinition()
protected function getDefaultInputDefinition(): InputDefinition
{
$input_definition = parent::getDefaultInputDefinition();

View file

@ -21,6 +21,7 @@ use phpbb\language\language;
use phpbb\passwords\manager;
use phpbb\user;
use Symfony\Component\Console\Command\Command as symfony_command;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@ -184,6 +185,10 @@ class add extends command
protected function interact(InputInterface $input, OutputInterface $output)
{
$helper = $this->getHelper('question');
if (!$helper instanceof QuestionHelper)
{
return;
}
$this->data = array(
'username' => $input->getOption('username'),

View file

@ -19,6 +19,7 @@ use phpbb\log\log_interface;
use phpbb\user;
use phpbb\user_loader;
use Symfony\Component\Console\Command\Command as symfony_command;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
@ -151,6 +152,10 @@ class delete extends command
protected function interact(InputInterface $input, OutputInterface $output)
{
$helper = $this->getHelper('question');
if (!$helper instanceof QuestionHelper)
{
return;
}
$question = new ConfirmationQuestion(
$this->language->lang('CLI_USER_DELETE_CONFIRM', $input->getArgument('username')),

View file

@ -65,10 +65,10 @@ class resolver implements ControllerResolverInterface
* Load a controller callable
*
* @param Request $request Symfony Request object
* @return false|Callable Callable or false (fixme: method is returning an array)
* @return callable|false Callable or false
* @throws \phpbb\controller\exception
*/
public function getController(Request $request)
public function getController(Request $request): callable|false
{
$controller = $request->attributes->get('_controller');
@ -160,7 +160,7 @@ class resolver implements ControllerResolverInterface
$arguments[] = $attributes[$param->name];
}
}
else if ($param->getClass() && $param->getClass()->isInstance($request))
else if ($param->getType() && $param->getType() instanceof $request)
{
$arguments[] = $request;
}

View file

@ -387,7 +387,7 @@ abstract class driver implements driver_interface
/**
* {@inheritDoc}
*/
function sql_fetchfield($field, $rownum = false, $query_id = false)
function sql_fetchfield($field, $rownum = false, &$query_id = false)
{
global $cache;
@ -1330,7 +1330,7 @@ abstract class driver implements driver_interface
/**
* {@inheritDoc}
*/
public function clean_query_id($query_id)
public function clean_query_id(mixed $query_id): int|string|null
{
// Some DBMS functions accept/return objects and/or resources instead if identifiers
// Attempting to use objects/resources as array keys will throw error, hence correctly handle all cases

View file

@ -268,7 +268,7 @@ interface driver_interface
* @return mixed String value of the field in the selected row,
* false, if the row does not exist
*/
public function sql_fetchfield($field, $rownum = false, $query_id = false);
public function sql_fetchfield($field, $rownum = false, &$query_id = false);
/**
* Fetch current row
@ -499,9 +499,9 @@ interface driver_interface
/**
* Ensure query ID can be used by cache
*
* @param resource|int|string $query_id Mixed type query id
* @param mixed $query_id Mixed type query id
*
* @return int|string Query id in string or integer format
* @return int|string|null Query id in string or integer format
*/
public function clean_query_id($query_id);
public function clean_query_id(mixed $query_id): int|string|null;
}

View file

@ -294,7 +294,7 @@ class factory implements driver_interface
/**
* {@inheritdoc}
*/
public function sql_fetchfield($field, $rownum = false, $query_id = false)
public function sql_fetchfield($field, $rownum = false, &$query_id = false)
{
return $this->get_driver()->sql_fetchfield($field, $rownum, $query_id);
}
@ -478,7 +478,7 @@ class factory implements driver_interface
/**
* {@inheritDoc}
*/
public function clean_query_id($query_id)
public function clean_query_id(mixed $query_id): int|string|null
{
return $this->get_driver()->clean_query_id($query_id);
}

View file

@ -298,7 +298,7 @@ class postgres extends \phpbb\db\driver\driver
/**
* {@inheritDoc}
*/
function sql_fetchfield($field, $rownum = false, $query_id = false)
function sql_fetchfield($field, $rownum = false, &$query_id = false)
{
global $cache;
@ -431,12 +431,12 @@ class postgres extends \phpbb\db\driver\driver
*/
protected function _sql_close(): bool
{
// Released resources are already closed, return true in this case
if (!is_resource($this->db_connect_id))
// Skip if connection is already closed or not persistent
if (!$this->persistency || !$this->db_connect_id instanceof \PgSql\Connection)
{
return true;
}
return @pg_close($this->db_connect_id);
return pg_close($this->db_connect_id);
}
/**

View file

@ -91,9 +91,9 @@ class migrator
*
* 'effectively_installed' set and set to true if the migration was effectively_installed
*
* @var array|false
* @var array
*/
protected $last_run_migration = false;
protected $last_run_migration = [];
/**
* The output handler. A null handler is configured by default.
@ -193,9 +193,9 @@ class migrator
* The array contains 'name', 'class' and 'state'. 'effectively_installed' is set
* and set to true if the last migration was effectively_installed.
*
* @return array|false Last run migration information or false if no migration has been run yet
* @return array Last run migration information or false if no migration has been run yet
*/
public function get_last_run_migration()
public function get_last_run_migration(): array
{
return $this->last_run_migration;
}
@ -261,9 +261,9 @@ class migrator
*/
public function update()
{
$this->container->get('dispatcher')->disable();
$this->container->get('event_dispatcher')->disable();
$this->update_do();
$this->container->get('dispatcher')->enable();
$this->container->get('event_dispatcher')->enable();
}
/**
@ -509,9 +509,9 @@ class migrator
*/
public function revert($migration)
{
$this->container->get('dispatcher')->disable();
$this->container->get('event_dispatcher')->disable();
$this->revert_do($migration);
$this->container->get('dispatcher')->enable();
$this->container->get('event_dispatcher')->enable();
}
/**
@ -630,7 +630,7 @@ class migrator
WHERE migration_name = '" . $this->db->sql_escape($name) . "'";
$this->db->sql_query($sql);
$this->last_run_migration = false;
$this->last_run_migration = [];
unset($this->migration_state[$name]);
$this->output_handler->write(array('MIGRATION_REVERT_SCHEMA_DONE', $name, $total_time), migrator_output_handler_interface::VERBOSITY_NORMAL);

View file

@ -13,14 +13,13 @@
namespace phpbb\debug;
use Symfony\Component\Debug\BufferingLogger;
use Symfony\Component\Debug\DebugClassLoader;
use Symfony\Component\Debug\ExceptionHandler;
use Symfony\Component\ErrorHandler\BufferingLogger;
use Symfony\Component\ErrorHandler\DebugClassLoader;
/**
* Registers all the debug tools.
* @see Symfony\Component\Debug\Debug
* @see \Symfony\Component\ErrorHandler\Debug
*/
class debug
{
@ -34,10 +33,10 @@ class debug
* If the Symfony ClassLoader component is available, a special
* class loader is also registered.
*
* @param int $errorReportingLevel The level of error reporting you want
* @param bool $displayErrors Whether to display errors (for development) or just log them (for production)
* @param int|null $errorReportingLevel The level of error reporting you want
* @param bool $displayErrors Whether to display errors (for development) or just log them (for production)
*/
public static function enable($errorReportingLevel = null, $displayErrors = true)
public static function enable(int|null $errorReportingLevel = null, bool $displayErrors = true): void
{
if (static::$enabled)
{
@ -58,7 +57,6 @@ class debug
if ('cli' !== php_sapi_name())
{
ini_set('display_errors', 0);
ExceptionHandler::register();
}
else if ($displayErrors && (!ini_get('log_errors') || ini_get('error_log')))
{
@ -66,15 +64,8 @@ class debug
ini_set('display_errors', 1);
}
if ($displayErrors)
{
error_handler::register(new error_handler(new BufferingLogger()));
}
else
{
error_handler::register()->throwAt(0, true);
}
DebugClassLoader::enable();
error_handler::register(new error_handler(new BufferingLogger(), $displayErrors));
}
}

View file

@ -13,7 +13,8 @@
namespace phpbb\debug;
use Symfony\Component\Debug\ErrorHandler;
use Symfony\Component\ErrorHandler\BufferingLogger;
use Symfony\Component\ErrorHandler\ErrorHandler;
/**
* @psalm-suppress InvalidExtendClass
@ -23,13 +24,21 @@ class error_handler extends ErrorHandler
/**
* @psalm-suppress MethodSignatureMismatch
*/
public function handleError($type, $message, $file, $line)
public function __construct(BufferingLogger $bootstrappingLogger = null, private readonly bool $debug = false) // phpcs:ignore Generic.CodeAnalysis.UselessOverridingMethod.Found
{
if ($type === E_USER_WARNING || $type === E_USER_NOTICE)
parent::__construct($bootstrappingLogger, $debug);
}
/**
* @psalm-suppress MethodSignatureMismatch
*/
public function handleError(int $type, string $message, string $file, int $line): bool
{
if (!$this->debug || $type === E_USER_WARNING || $type === E_USER_NOTICE)
{
$handler = defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler';
$handler($type, $message, $file, $line);
return $handler($type, $message, $file, $line);
}
return parent::handleError($type, $message, $file, $line);

View file

@ -205,11 +205,11 @@ class container_builder
// Mark all services public
$this->container->addCompilerPass(new pass\markpublic_pass());
// Event listeners "phpBB style"
$this->container->addCompilerPass(new RegisterListenersPass('dispatcher', 'event.listener_listener', 'event.listener'));
// Convert old event dispatcher syntax
$this->container->addCompilerPass(new pass\convert_events());
// Event listeners "Symfony style"
$this->container->addCompilerPass(new RegisterListenersPass('dispatcher'));
// Event listeners
$this->container->addCompilerPass(new RegisterListenersPass());
if ($this->use_extensions)
{

View file

@ -60,7 +60,7 @@ class config extends Extension
*
* @return string The alias
*/
public function getAlias()
public function getAlias(): string
{
return 'config';
}
@ -73,7 +73,7 @@ class config extends Extension
*/
protected function convert_30_acm_type($acm_type)
{
if (preg_match('#^[a-z]+$#', $acm_type))
if (preg_match('#^[a-z]+$#', $acm_type ?? ''))
{
return 'phpbb\\cache\\driver\\' . $acm_type;
}

View file

@ -62,7 +62,7 @@ class core extends Extension
if ($config['require_dev_dependencies'])
{
if (!class_exists('Goutte\Client', true))
if (!class_exists('Symfony\Component\BrowserKit\HttpBrowser'))
{
trigger_error(
'Composer development dependencies have not been set up for the ' . $container->getParameter('core.environment') . ' environment yet, run ' .
@ -144,7 +144,7 @@ class core extends Extension
*
* @return string The alias
*/
public function getAlias()
public function getAlias(): string
{
return 'core';
}

View file

@ -52,7 +52,7 @@ class tables extends Extension
*
* @return string The alias
*/
public function getAlias()
public function getAlias(): string
{
return 'tables';
}

View file

@ -46,7 +46,7 @@ class ordered_service_collection extends service_collection
/**
* {@inheritdoc}
*/
public function getIterator()
public function getIterator(): \Iterator
{
if (!$this->is_ordered)
{
@ -59,27 +59,27 @@ class ordered_service_collection extends service_collection
/**
* {@inheritdoc}
*/
public function offsetExists($index)
public function offsetExists($key): bool
{
if (!$this->is_ordered)
{
$this->sort_services();
}
return parent::offsetExists($index);
return parent::offsetExists($key);
}
/**
* {@inheritdoc}
*/
public function offsetGet($index)
public function offsetGet($key): mixed
{
if (!$this->is_ordered)
{
$this->sort_services();
}
return parent::offsetGet($index);
return parent::offsetGet($key);
}
/**

View file

@ -0,0 +1,51 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\di\pass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
/**
* Converts event types to Symfony ones
*/
class convert_events implements CompilerPassInterface
{
/** @var string[] Map for conversions of types */
private static array $conversions = [
'event.listener_listener' => 'kernel.event_listener',
'event.listener' => 'kernel.event_subscriber',
];
/**
* Modify the container before it is passed to the rest of the code
* Add Symfony event tags to previously used phpBB ones
*
* @param ContainerBuilder $container ContainerBuilder object
* @return void
*/
public function process(ContainerBuilder $container): void
{
// Add alias for event dispatcher
$container->addAliases(['dispatcher' => 'event_dispatcher']);
foreach (self::$conversions as $from => $to)
{
foreach ($container->findTaggedServiceIds($from, true) as $id => $tags)
{
$definition = $container->getDefinition($id);
$definition->addTag($to);
}
}
}
}

View file

@ -46,7 +46,7 @@ class service_collection extends \ArrayObject
/**
* {@inheritdoc}
*/
public function getIterator()
public function getIterator(): \Iterator
{
return new service_collection_iterator($this);
}
@ -54,9 +54,9 @@ class service_collection extends \ArrayObject
/**
* {@inheritdoc}
*/
public function offsetGet($index)
public function offsetGet($key): mixed
{
return $this->container->get($index);
return $this->container->get($key);
}
/**

View file

@ -39,7 +39,7 @@ class service_collection_iterator extends \ArrayIterator
/**
* {@inheritdoc}
*/
public function current()
public function current(): mixed
{
return $this->collection->offsetGet($this->key());
}

View file

@ -39,7 +39,7 @@ class recursive_event_filter_iterator extends \RecursiveFilterIterator
*
* @return recursive_event_filter_iterator
*/
public function getChildren()
public function getChildren(): ?\RecursiveFilterIterator
{
$inner_iterator = $this->getInnerIterator();
assert($inner_iterator instanceof \RecursiveIterator);
@ -49,7 +49,7 @@ class recursive_event_filter_iterator extends \RecursiveFilterIterator
/**
* {@inheritDoc}
*/
public function accept()
public function accept(): bool
{
$relative_path = str_replace(DIRECTORY_SEPARATOR, '/', $this->current());
$filename = $this->current()->getFilename();

View file

@ -25,14 +25,14 @@ class http_exception extends runtime_exception implements HttpExceptionInterface
*
* @var integer
*/
private $status_code;
private int $status_code;
/**
* Additional headers to set in the response.
*
* @var array
*/
private $headers;
private array $headers;
/**
* Constructor
@ -55,7 +55,7 @@ class http_exception extends runtime_exception implements HttpExceptionInterface
/**
* {@inheritdoc}
*/
public function getStatusCode()
public function getStatusCode(): int
{
return $this->status_code;
}
@ -63,7 +63,7 @@ class http_exception extends runtime_exception implements HttpExceptionInterface
/**
* {@inheritdoc}
*/
public function getHeaders()
public function getHeaders(): array
{
return $this->headers;
}

View file

@ -132,7 +132,7 @@ class extension_base extends Extension
*
* @return string The alias
*/
public function getAlias()
public function getAlias(): string
{
return str_replace('/', '_', $this->extension_name);
}

View file

@ -137,7 +137,7 @@ class filespec
$this->mimetype = $upload_ary['type'];
// Opera adds the name to the mime type
$this->mimetype = (strpos($this->mimetype, '; name') !== false) ? str_replace(strstr($this->mimetype, '; name'), '', $this->mimetype) : $this->mimetype;
$this->mimetype = ($this->mimetype && str_contains($this->mimetype, '; name')) ? str_replace(strstr($this->mimetype, '; name'), '', $this->mimetype) : $this->mimetype;
if (!$this->mimetype)
{

View file

@ -117,7 +117,7 @@ class filespec_storage
$this->mimetype = $upload_ary['type'];
// Opera adds the name to the mime type
$this->mimetype = (strpos($this->mimetype, '; name') !== false) ? str_replace(strstr($this->mimetype, '; name'), '', $this->mimetype) : $this->mimetype;
$this->mimetype = ($this->mimetype && str_contains($this->mimetype, '; name')) ? str_replace(strstr($this->mimetype, '; name'), '', $this->mimetype) : $this->mimetype;
if (!$this->mimetype)
{

View file

@ -606,7 +606,7 @@ class filesystem implements filesystem_interface
protected function phpbb_own_realpath($path)
{
// Replace all directory separators with '/'
$path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
$path = str_replace(DIRECTORY_SEPARATOR, '/', $path ?: '');
$is_absolute_path = false;
$path_prefix = '';

View file

@ -77,7 +77,7 @@ class finder
);
$this->extensions = array();
$this->cached_queries = ($this->cache) ? $this->cache->get($this->cache_name) : false;
$this->cached_queries = $this->cache ? ($this->cache->get($this->cache_name) ?: []) : [];
}
/**

View file

@ -120,7 +120,7 @@ class create_search_index extends database_task
$this->db = $container->get('dbal.conn');
$this->iohandler = $iohandler;
$this->installer_config = $config;
$this->phpbb_dispatcher = $container->get('dispatcher');
$this->phpbb_dispatcher = $container->get('event_dispatcher');
$this->user = $container->get('user');
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;

View file

@ -118,7 +118,7 @@ abstract class base implements \phpbb\notification\type\type_interface
{
// The row from the database (unless this is a new notification we're going to add)
$this->data = $data;
$this->data['notification_data'] = (isset($this->data['notification_data'])) ? unserialize($this->data['notification_data']) : array();
$this->data['notification_data'] = !empty($this->data['notification_data']) ? unserialize($this->data['notification_data']) : [];
}
/**

View file

@ -150,7 +150,7 @@ class type_date extends type_base
*/
public function validate_profile_field(&$field_value, $field_data)
{
$field_validate = explode('-', $field_value);
$field_validate = explode('-', $field_value ?: '');
$day = (isset($field_validate[0])) ? (int) $field_validate[0] : 0;
$month = (isset($field_validate[1])) ? (int) $field_validate[1] : 0;
@ -184,7 +184,7 @@ class type_date extends type_base
*/
public function get_profile_value($field_value, $field_data)
{
$date = explode('-', $field_value);
$date = explode('-', $field_value ?: '');
$day = (isset($date[0])) ? (int) $date[0] : 0;
$month = (isset($date[1])) ? (int) $date[1] : 0;
$year = (isset($date[2])) ? (int) $date[2] : 0;

View file

@ -120,7 +120,7 @@ class type_int extends type_base
*/
public function validate_profile_field(&$field_value, $field_data)
{
if (trim($field_value) === '' && !$field_data['field_required'])
if (trim($field_value ?: '') === '' && !$field_data['field_required'])
{
return false;
}

View file

@ -63,13 +63,9 @@ abstract class type_string_common extends type_base
*/
public function validate_string_profile_field($field_type, &$field_value, $field_data)
{
if (trim($field_value) === '' && !$field_data['field_required'])
if (trim($field_value ?? '') === '')
{
return false;
}
else if (trim($field_value) === '' && $field_data['field_required'])
{
return $this->user->lang('FIELD_REQUIRED', $this->get_field_name($field_data['lang_name']));
return $field_data['field_required'] ? $this->user->lang('FIELD_REQUIRED', $this->get_field_name($field_data['lang_name'])) : false;
}
if ($field_data['field_minlen'] && utf8_strlen($field_value) < $field_data['field_minlen'])

View file

@ -74,7 +74,7 @@ class deactivated_super_global implements \ArrayAccess, \Countable, \IteratorAgg
*
* @return bool Whether the key on the super global exists.
*/
public function offsetExists($offset)
public function offsetExists($offset): bool
{
return $this->request->is_set($offset, $this->super_global);
}
@ -82,17 +82,17 @@ class deactivated_super_global implements \ArrayAccess, \Countable, \IteratorAgg
/**#@+
* Part of the \ArrayAccess implementation, will always result in a FATAL error.
*/
public function offsetGet($offset)
public function offsetGet($offset): mixed
{
$this->error();
}
public function offsetSet($offset, $value)
public function offsetSet($offset, $value): void
{
$this->error();
}
public function offsetUnset($offset)
public function offsetUnset($offset): void
{
$this->error();
}
@ -101,9 +101,8 @@ class deactivated_super_global implements \ArrayAccess, \Countable, \IteratorAgg
/**
* Part of the \Countable implementation, will always result in a FATAL error
* @return void
* @psalm-suppress InvalidReturnType
*/
public function count()
#[\ReturnTypeWillChange] public function count(): void
{
$this->error();
}
@ -111,9 +110,8 @@ class deactivated_super_global implements \ArrayAccess, \Countable, \IteratorAgg
/**
* Part of the Traversable/IteratorAggregate implementation, will always result in a FATAL error
* @return void
* @psalm-suppress InvalidReturnType
*/
public function getIterator()
#[\ReturnTypeWillChange] public function getIterator(): void
{
$this->error();
}

View file

@ -33,7 +33,7 @@ class loader_resolver implements LoaderResolverInterface
/**
* {@inheritdoc}
*/
public function resolve($resource, $type = null)
public function resolve($resource, $type = null): false|\Symfony\Component\Config\Loader\LoaderInterface
{
/** @var \Symfony\Component\Config\Loader\LoaderInterface $loader */
foreach ($this->loaders as $loader)

View file

@ -171,7 +171,7 @@ class router implements RouterInterface
/**
* {@inheritdoc}
*/
public function getContext()
public function getContext(): RequestContext
{
return $this->context;
}
@ -179,7 +179,7 @@ class router implements RouterInterface
/**
* {@inheritdoc}
*/
public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH)
public function generate(string $name, array $parameters = [], int $referenceType = self::ABSOLUTE_PATH): string
{
return $this->get_generator()->generate($name, $parameters, $referenceType);
}
@ -187,7 +187,7 @@ class router implements RouterInterface
/**
* {@inheritdoc}
*/
public function match($pathinfo)
public function match(string $pathinfo): array
{
return $this->get_matcher()->match($pathinfo);
}

View file

@ -47,7 +47,7 @@ class session
// First of all, get the request uri...
$script_name = $request->escape($symfony_request->getScriptName(), true);
$args = $request->escape(explode('&', $symfony_request->getQueryString()), true);
$args = $request->escape(explode('&', $symfony_request->getQueryString() ?? ''), true);
// If we are unable to get the script name we use REQUEST_URI as a failover and note it within the page array for easier support...
if (!$script_name)

View file

@ -1,8 +1,7 @@
<?xml version="1.0"?>
<psalm
errorLevel="5"
phpVersion="7.3"
resolveFromConfigFile="true"
phpVersion="8.1"
autoloader="build/psalm_bootstrap.php"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
@ -22,11 +21,14 @@
</issueHandlers>
<stubs>
<file name="build/psalm/stubs/apcu/apcu.php"/>
<file name="build/psalm/stubs/memcached/memcached.php"/>
<file name="build/psalm/stubs/oci8/oci8.php"/>
<file name="build/psalm/stubs/pgsql/pgsql.php"/>
<file name="build/psalm/stubs/redis/redis.php"/>
<file name="build/psalm/stubs/sqlite3/sqlite3.php"/>
<file name="build/psalm/stubs/apcu.php"/>
<file name="build/psalm/stubs/gd.php"/>
<file name="build/psalm/stubs/ldap.php"/>
<file name="build/psalm/stubs/memcached.php"/>
<file name="build/psalm/stubs/oci8.php"/>
<file name="build/psalm/stubs/pgsql.php"/>
<file name="build/psalm/stubs/redis.php"/>
<file name="build/psalm/stubs/sqlite3.php"/>
<file name="build/psalm/stubs/sqlsrv.php"/>
</stubs>
</psalm>

View file

@ -69,6 +69,9 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case
/** @var \phpbb\request\request */
protected $request;
/** @var string */
protected $phpbb_root_path;
public function getDataSet()
{
return $this->createXMLDataSet(__DIR__ . '/fixtures/resync.xml');

View file

@ -97,7 +97,8 @@ class phpbb_console_command_cron_list_test extends phpbb_test_case
);
$mock_container = new phpbb_mock_container_builder();
$mock_container->set('cron.task_collection', []);
$task_collection = new \phpbb\di\service_collection($mock_container);
$mock_container->set('cron.task_collection', $task_collection);
$this->cron_manager = new \phpbb\cron\manager($mock_container, $routing_helper, $phpbb_root_path, $pathEx, null);
$this->cron_manager->load_tasks($tasks);

View file

@ -74,7 +74,8 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case
);
$mock_container = new phpbb_mock_container_builder();
$mock_container->set('cron.task_collection', []);
$task_collection = new \phpbb\di\service_collection($mock_container);
$mock_container->set('cron.task_collection', $task_collection);
$this->cron_manager = new \phpbb\cron\manager($mock_container, $routing_helper, $phpbb_root_path, $phpEx, null);
$this->cron_manager->load_tasks($tasks);
@ -152,7 +153,8 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case
);
$mock_container = new phpbb_mock_container_builder();
$mock_container->set('cron.task_collection', []);
$task_collection = new \phpbb\di\service_collection($mock_container);
$mock_container->set('cron.task_collection', $task_collection);
$this->cron_manager = new \phpbb\cron\manager($mock_container, $routing_helper, $phpbb_root_path, $phpEx, null);
$this->cron_manager->load_tasks($tasks);
@ -199,7 +201,8 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case
);
$mock_container = new phpbb_mock_container_builder();
$mock_container->set('cron.task_collection', []);
$task_collection = new \phpbb\di\service_collection($mock_container);
$mock_container->set('cron.task_collection', $task_collection);
$this->cron_manager = new \phpbb\cron\manager($mock_container, $routing_helper, $phpbb_root_path, $phpEx, null);
$this->cron_manager->load_tasks($tasks);

View file

@ -21,6 +21,9 @@ use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
class phpbb_controller_controller_test extends phpbb_test_case
{
/** @var phpbb_mock_extension_manager */
protected $extension_manager;
protected function setUp(): void
{
$this->extension_manager = new phpbb_mock_extension_manager(

View file

@ -105,7 +105,8 @@ class phpbb_cron_manager_test extends \phpbb_test_case
);
$mock_container = new phpbb_mock_container_builder();
$mock_container->set('cron.task_collection', []);
$task_collection = new \phpbb\di\service_collection($mock_container);
$mock_container->set('cron.task_collection', $task_collection);
$cron_manager = new \phpbb\cron\manager($mock_container, $routing_helper, $phpbb_root_path, $phpEx, null);
$cron_manager->load_tasks($tasks);

View file

@ -42,6 +42,9 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
/** @var \phpbb\config\config */
protected $config;
/** @var \phpbb\extension\manager */
protected $extension_manager;
public function getDataSet()
{
return $this->createXMLDataSet(__DIR__.'/fixtures/migrator.xml');
@ -80,7 +83,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
new \phpbb\db\migration\helper()
);
$container->set('migrator', $this->migrator);
$container->set('dispatcher', new phpbb_mock_event_dispatcher());
$container->set('event_dispatcher', new phpbb_mock_event_dispatcher());
$this->extension_manager = new \phpbb\extension\manager(
$container,
@ -98,6 +101,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
$this->migrator->set_migrations(array('phpbb_dbal_migration_dummy'));
// schema
$start_time = time();
$this->migrator->update();
$this->assertFalse($this->migrator->finished());
@ -106,12 +110,13 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
"SELECT 1 as success
FROM phpbb_migrations
WHERE migration_name = 'phpbb_dbal_migration_dummy'
AND migration_start_time >= " . (time() - 1) . "
AND migration_start_time >= " . ($start_time - 1) . "
AND migration_start_time <= " . (time() + 1),
'Start time set correctly'
);
// data
$start_time = time();
$this->migrator->update();
$this->assertTrue($this->migrator->finished());
@ -127,7 +132,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
FROM phpbb_migrations
WHERE migration_name = 'phpbb_dbal_migration_dummy'
AND migration_start_time <= migration_end_time
AND migration_end_time >= " . (time() - 1) . "
AND migration_end_time >= " . ($start_time - 1) . "
AND migration_end_time <= " . (time() + 1),
'End time set correctly'
);

View file

@ -13,6 +13,12 @@
class phpbb_dbal_migrator_tool_config_test extends phpbb_test_case
{
/** @var \phpbb\config\config */
protected $config;
/** @var \phpbb\db\migration\tool\tool_interface */
protected $tool;
protected function setUp(): void
{
$this->config = new \phpbb\config\config(array());

View file

@ -53,15 +53,14 @@ class phpbb_error_collector_test extends phpbb_test_case
// Division by zero was promoted to fatal error and throws DivisionByZeroError exception in PHP 8+
version_compare(PHP_VERSION, '8', '>=') ? '1b'['0xFF'] : 1/0; $line = __LINE__;
// Cause a "Notice: unserialize(): Error at offset 0 of 27 bytes in ..."
// "Undefined array index" used earlier was promoted to warning in PHP 8.0,
// see https://github.com/php/php-src/commit/c48b745f0090c944e77c1fbcfb6c4df3b54356ad
unserialize("obvious non-serialized data"); $line2 = __LINE__;
// Cause a "Notice: date_default_timezone_set(): Timezone ID 'ThisTimeZoneDoesNotExist' is invalid"
// https://github.com/php/php-src/blob/880faa39e8c648bdc3aad7aeca170755c6557831/ext/date/php_date.c#L5205
date_default_timezone_set('ThisTimeZoneDoesNotExist'); $line2 = __LINE__;
$collector->uninstall();
// The notice should not be collected
$this->assertFalse(isset($collector->errors[1]));
$this->assertFalse(isset($collector->errors[1]), 'Notice should not be added to errors');
$this->assertEquals(count($collector->errors), 1);
list($errno, $msg_text, $errfile, $errline) = $collector->errors[0];

View file

@ -30,7 +30,6 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
{
parent::setUp();
$this->db = null;
$this->extension_manager = $this->create_extension_manager();
}

View file

@ -38,6 +38,6 @@ class phpbb_functional_acp_smilies_test extends phpbb_functional_test_case
$crawler = self::submit($form);
$html = $crawler->filter('#preview')->html();
$this->assertRegexp('(<img [^>]+ alt="&gt;:D" title="&gt;:D"[^>]*>)', $html);
$this->assertMatchesRegularExpression('(<img [^>]+ alt=">:D" title=">:D"[^>]*>)', $html);
}
}

View file

@ -105,7 +105,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
{
$crawler = self::request('GET', 'app.php/foo/baz', array(), false);
$this->assert_response_html(500);
$this->assertStringContainsString('Controller "foo\bar\controller\controller::baz()" requires that you provide a value for the "$test" argument', $crawler->filter('body')->text());
$this->assertStringContainsString('Controller "foo\bar\controller\controller::baz" requires that you provide a value for the "$test" argument', $crawler->filter('body')->text());
}
/**

View file

@ -30,9 +30,9 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
{
parent::__construct($name, $data, $dataName);
$this->excludeBackupStaticAttributes([
$this->backupStaticAttributesExcludeList += [
'phpbb_functional_feed_test' => ['init_values'],
]);
];
$this->purge_cache();
}

View file

@ -78,7 +78,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
$crawler = self::request('GET', "posting.php?mode=quote&p={$post['post_id']}&sid={$this->sid}");
$this->assertRegexp($expected, $crawler->filter('textarea#message')->text());
$this->assertMatchesRegularExpression($expected, $crawler->filter('textarea#message')->text());
}
/**
@ -122,7 +122,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
{
$this->set_quote_depth($quote_depth);
$crawler = self::request('GET', $quote_url);
$this->assertRegexp(
$this->assertMatchesRegularExpression(
"(\[quote=admin[^\]]*\]\s?" . preg_quote($expected_text) . "\s?\[\/quote\])",
$crawler->filter('textarea#message')->text()
);

View file

@ -79,7 +79,7 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case
$crawler = self::request('GET', 'ucp.php?i=pm&mode=compose&action=quotepost&p=' . $post['post_id'] . '&sid=' . $this->sid);
$this->assertRegexp($expected, $crawler->filter('textarea#message')->text());
$this->assertMatchesRegularExpression($expected, $crawler->filter('textarea#message')->text());
}
public function test_quote_pm()
@ -92,7 +92,7 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case
$crawler = self::request('GET', 'ucp.php?i=pm&mode=compose&action=quote&p=' . $message_id . '&sid=' . $this->sid);
$this->assertRegexp($expected, $crawler->filter('textarea#message')->text());
$this->assertMatchesRegularExpression($expected, $crawler->filter('textarea#message')->text());
}
public function test_quote_forward()
@ -105,6 +105,6 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case
$crawler = self::request('GET', 'ucp.php?i=pm&mode=compose&action=forward&f=0&p=' . $message_id . '&sid=' . $this->sid);
$this->assertRegexp($expected, $crawler->filter('textarea#message')->text());
$this->assertMatchesRegularExpression($expected, $crawler->filter('textarea#message')->text());
}
}

View file

@ -22,9 +22,9 @@ class phpbb_functional_ucp_allow_pm_test extends phpbb_functional_test_case
{
parent::__construct();
$this->excludeBackupStaticAttributes([
$this->backupStaticAttributesExcludeList += [
'phpbb_functional_ucp_allow_pm_test' => ['data'],
]);
];
}
// user A sends a PM to user B where B accepts PM

View file

@ -134,7 +134,7 @@ class phpbb_functional_ucp_attachments_test extends phpbb_functional_test_case
$attachment_filename = $crawler->filter('.attachment-filename');
$this->assertEquals('valid.jpg', $attachment_filename->attr('title'));
$this->assertStringContainsString('app.php/download/attachment/' . $attach_id . '/valid.jpg', $attachment_filename->attr('href'));
$this->assertEquals('', $crawler->filter('[name="attachment[' . $attach_id . ']"]')->attr('disabled'));
$this->assertFalse($crawler->filter('[name="attachment[' . $attach_id . ']"]')->getNode(0)->hasAttribute('disabled'));
}
public function test_ucp_delete_expired_attachment()
@ -219,7 +219,7 @@ class phpbb_functional_ucp_attachments_test extends phpbb_functional_test_case
$this->assertEquals('valid.jpg', $attachment_node->attr('title'));
$this->assertStringContainsString('download/attachment/' . $attach_id . '/valid.jpg', $attachment_node->attr('href'));
$this->assertEquals('disabled', $crawler->filter('[name="attachment[' . $attach_id . ']"]')->attr('disabled'));
$this->assertTrue($crawler->filter('[name="attachment[' . $attach_id . ']"]')->getNode(0)->hasAttribute('disabled'));
// It should not be possible to delete the attachment
$crawler = self::request('POST', 'ucp.php?i=ucp_attachments&mode=attachments&sid=' . $this->sid, [
@ -238,7 +238,7 @@ class phpbb_functional_ucp_attachments_test extends phpbb_functional_test_case
});
$this->assertEquals('valid.jpg', $attachment_node->attr('title'));
$this->assertStringContainsString('download/attachment/' . $attach_id . '/valid.jpg', $attachment_node->attr('href'));
$this->assertEquals('disabled', $crawler->filter('[name="attachment[' . $attach_id . ']"]')->attr('disabled'));
$this->assertTrue($crawler->filter('[name="attachment[' . $attach_id . ']"]')->getNode(0)->hasAttribute('disabled'));
$this->logout();
@ -327,7 +327,7 @@ class phpbb_functional_ucp_attachments_test extends phpbb_functional_test_case
$this->assertEquals('valid.jpg', $attachment_node->attr('title'));
$this->assertStringContainsString('download/attachment/' . $attach_id . '/valid.jpg', $attachment_node->attr('href'));
$this->assertEquals('', $crawler->filter('[name="attachment[' . $attach_id . ']"]')->attr('disabled'));
$this->assertFalse($crawler->filter('[name="attachment[' . $attach_id . ']"]')->getNode(0)->hasAttribute('disabled'));
// Update message time to 60 minutes later
$sql = 'UPDATE ' . PRIVMSGS_TABLE . '
@ -347,7 +347,7 @@ class phpbb_functional_ucp_attachments_test extends phpbb_functional_test_case
$this->assertEquals('valid.jpg', $attachment_node->attr('title'));
$this->assertStringContainsString('download/attachment/' . $attach_id . '/valid.jpg', $attachment_node->attr('href'));
$this->assertEquals('disabled', $crawler->filter('[name="attachment[' . $attach_id . ']"]')->attr('disabled'));
$this->assertTrue($crawler->filter('[name="attachment[' . $attach_id . ']"]')->getNode(0)->hasAttribute('disabled'));
$this->set_flood_interval(15);

View file

@ -162,7 +162,7 @@ class phpbb_functions_obtain_online_test extends phpbb_database_test_case
global $config, $user, $auth, $phpbb_dispatcher;
$config['load_online_guests'] = $display_guests;
$user = new phpbb_mock_lang();
$user = new phpbb_mock_user();
$user->data['user_id'] = 100;
$user->lang = $this->load_language();
$auth = $this->createMock('\phpbb\auth\auth');

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