From db56017d5724e540aae879e86e61678f2627010c Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 4 Jan 2024 20:35:56 +0100 Subject: [PATCH] [ticket/17283] Remove remaining parts using iconify PHPBB3-17283 --- gulpfile.js | 18 -- .../default/container/services_assets.yml | 9 - phpBB/config/installer/container/services.yml | 9 - phpBB/phpbb/assets/iconify_bundler.php | 262 ------------------ phpBB/phpbb/template/assets_bag.php | 55 ---- phpBB/phpbb/template/twig/environment.php | 2 - phpBB/phpbb/template/twig/extension/icon.php | 10 +- .../all/template/macros/icons/iconify.twig | 4 - tests/assets/iconify_bundler_test.php | 143 ---------- tests/controller/common_helper_route.php | 3 +- tests/email/email_parsing_test.php | 3 +- tests/extension/metadata_manager_test.php | 3 +- tests/template/extension_test.php | 3 +- tests/template/template_allfolder_test.php | 3 +- tests/template/template_events_test.php | 3 +- tests/template/template_includecss_test.php | 3 +- tests/template/template_test_case.php | 3 +- .../template/template_test_case_with_tree.php | 3 +- tests/template/twig_test.php | 3 +- 19 files changed, 11 insertions(+), 531 deletions(-) delete mode 100644 phpBB/phpbb/assets/iconify_bundler.php delete mode 100644 phpBB/styles/all/template/macros/icons/iconify.twig delete mode 100644 tests/assets/iconify_bundler_test.php diff --git a/gulpfile.js b/gulpfile.js index c2240aac49..330af7f768 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -67,26 +67,8 @@ function watch() { gulp.watch(paths.styles.src, styles); } -function copyIconifyIcons() { - return gulp.src([ - 'node_modules/@iconify/json/json/fa.json', - 'node_modules/@iconify/json/json/ic.json', - 'node_modules/@iconify/json/json/mdi.json', - ]) - .pipe(gulp.dest('phpBB/assets/iconify')); -} - -function copyIconifyJs() { - return gulp.src([ - 'node_modules/@iconify/iconify/dist/iconify.without-api.min.js', - ]) - .pipe(rename('iconify.min.js')) - .pipe(gulp.dest('phpBB/assets/iconify')); -} - exports.style = styles; exports.minify = minify; exports.watch = watch; -exports.copyIconify = gulp.parallel(copyIconifyJs, copyIconifyIcons); exports.default = gulp.series(styles, minify, watch); diff --git a/phpBB/config/default/container/services_assets.yml b/phpBB/config/default/container/services_assets.yml index efc66cec49..255076495e 100644 --- a/phpBB/config/default/container/services_assets.yml +++ b/phpBB/config/default/container/services_assets.yml @@ -2,12 +2,3 @@ services: assets.bag: class: phpbb\template\assets_bag shared: false - arguments: - - '@assets.iconify_bundler' - - assets.iconify_bundler: - class: phpbb\assets\iconify_bundler - shared: false - arguments: - - '@log' - - '%core.root_path%' diff --git a/phpBB/config/installer/container/services.yml b/phpBB/config/installer/container/services.yml index 73ad83a0c0..b4e731306d 100644 --- a/phpBB/config/installer/container/services.yml +++ b/phpBB/config/installer/container/services.yml @@ -12,15 +12,6 @@ services: assets.bag: class: phpbb\template\assets_bag shared: false - arguments: - - '@assets.iconify_bundler' - - assets.iconify_bundler: - class: phpbb\assets\iconify_bundler - shared: false - arguments: - - ~ - - '%core.root_path%' cache.driver: class: '%cache.driver.class%' diff --git a/phpBB/phpbb/assets/iconify_bundler.php b/phpBB/phpbb/assets/iconify_bundler.php deleted file mode 100644 index 2f4deff340..0000000000 --- a/phpBB/phpbb/assets/iconify_bundler.php +++ /dev/null @@ -1,262 +0,0 @@ - - * @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\assets; - -use Iconify\JSONTools\Collection; -use phpbb\log\log_interface; - -class iconify_bundler -{ - /** @var string Icons path */ - protected string $icons_path; - - /** @var string[] Icons list */ - protected $icons_list = []; - - /** - * Constructor for iconify bundler - * - * @param log_interface|null $log Logger - * @param string $root_path phpBB root path - */ - public function __construct(protected ?log_interface $log, string $root_path) - { - $this->icons_path = $root_path . 'assets/iconify/'; - } - - /** - * Run iconify bundler - * - * @return string Iconify bundle - */ - public function run() - { - // Sort icons first - sort($this->icons_list, SORT_NATURAL); - - $organized_icons = $this->organize_icons_list(); - - $output = $this->load_icons_data($organized_icons); - if (!$output) - { - return ''; - } - - $output = '(function() { - function add(data) { - try { - if (typeof self.Iconify === \'object\' && self.Iconify.addCollection) { - self.Iconify.addCollection(data); - return; - } - if (typeof self.IconifyPreload === \'undefined\') { - self.IconifyPreload = []; - } - self.IconifyPreload.push(data); - } catch (err) { - } - } - ' . $output . ' -})();' . "\n"; - - return $output; - } - - /** - * Add icon to icons list - * - * @param string $icon_name - * @return void - */ - protected function add_icon(string $icon_name): void - { - if (!in_array($icon_name, $this->icons_list)) - { - $this->icons_list[] = $icon_name; - } - } - - /** - * Add multiple icons to icons list - * - * @param array $icons - * @return void - */ - public function add_icons(array $icons): void - { - foreach ($icons as $icon) - { - $this->add_icon($icon); - } - } - - /** - * Organize icons list by prefix - * - * Result is an object, where key is prefix, value is array of icon names - * - * @return array Organized icons list - */ - protected function organize_icons_list(): array - { - $results = []; - - foreach ($this->icons_list as $icon_name) - { - // Split icon to prefix and name - $icon = $this->name_to_icon($icon_name); - if ($icon === null) - { - // Invalid name or icon name does not have provider - if ($this->log) - { - $this->log->add('critical', ANONYMOUS, '', 'LOG_ICON_INVALID', false, [$icon_name]); - } - continue; - } - - $prefix = $icon['prefix']; - $name = $icon['name']; - - // Add icon to results - if (!isset($results[$prefix])) - { - $results[$prefix] = [$name]; - continue; - } - if (!in_array($name, $results[$prefix])) - { - $results[$prefix][] = $name; - } - } - - return $results; - } - - /** - * Convert icon name from string to object. - * - * Object properties: - * - provider (ignored in this example) - * - prefix - * - name - * - * This function was converted to PHP from @iconify/utils/src/icon/name.ts - * See https://github.com/iconify/iconify/blob/master/packages/utils/src/icon/name.ts - * - * @param string $icon_name Icon name - * @return array|null Icon data or null if icon is invalid - */ - protected function name_to_icon(string $icon_name): ?array - { - $provider = ''; - $colonSeparated = explode(':', $icon_name); - - // Check for provider with correct '@' at start - if (substr($icon_name, 0, 1) === '@') - { - // First part is provider - if (count($colonSeparated) < 2 || count($colonSeparated) > 3) - { - return null; - } - $provider = substr(array_shift($colonSeparated), 1); - } - - // Check split by colon: "prefix:name", "provider:prefix:name" - if (!$colonSeparated || count($colonSeparated) > 3) - { - return null; - } - - if (count($colonSeparated) > 1) - { - // "prefix:name" - $name = array_pop($colonSeparated); - $prefix = array_pop($colonSeparated); - return [ - // Allow provider without '@': "provider:prefix:name" - 'provider' => count($colonSeparated) > 0 ? $colonSeparated[0] : $provider, - 'prefix' => $prefix, - 'name' => $name, - ]; - } - - // Attempt to split by dash: "prefix-name" - $dashSeparated = explode('-', $colonSeparated[0]); - if (count($dashSeparated) > 1) - { - return [ - 'provider' => $provider, - 'prefix' => array_shift($dashSeparated), - 'name' => implode('-', $dashSeparated), - ]; - } - - return null; - } - - /** - * Get collection path for prefix - * - * @param string $prefix Icon collection prefix - * @return string Icon collection path - */ - protected function get_collection_path(string $prefix): string - { - return $this->icons_path . $prefix . '.json'; - } - - /** - * Load icons date for supplied icons array - * - * @param array $icons - * @return string - */ - protected function load_icons_data(array $icons): string - { - // Load icons data - $output = ''; - foreach ($icons as $prefix => $iconsList) - { - // Load icon set - $collection = new Collection($prefix); - $collection_file = $this->get_collection_path($prefix); - if (!file_exists($collection_file) || !$collection->loadFromFile($collection_file)) - { - $this->log?->add('critical', ANONYMOUS, '', 'LOG_ICON_COLLECTION_INVALID', false, [$prefix]); - continue; - } - - // Make sure all icons exist - foreach ($iconsList as $key => $name) - { - if (!$collection->iconExists($name)) - { - $this->log?->add('critical', ANONYMOUS, '', 'LOG_ICON_INVALID', false, [$prefix . ':' . $name]); - unset($iconsList[$key]); - } - } - - // Get data for all icons as string - $output .= $collection->scriptify([ - 'icons' => $iconsList, - 'callback' => 'add', - 'optimize' => true, - ]); - } - - return $output; - } -} diff --git a/phpBB/phpbb/template/assets_bag.php b/phpBB/phpbb/template/assets_bag.php index e5bfec9db8..012e8bbcbe 100644 --- a/phpBB/phpbb/template/assets_bag.php +++ b/phpBB/phpbb/template/assets_bag.php @@ -13,8 +13,6 @@ namespace phpbb\template; -use phpbb\assets\iconify_bundler; - class assets_bag { /** @var asset[] */ @@ -23,17 +21,6 @@ class assets_bag /** @var asset[] */ protected $scripts = []; - /** @var string[] */ - protected $iconify_icons = []; - - /** - * Constructor for assets bag - * - * @param iconify_bundler $iconify_bundler - */ - public function __construct(protected iconify_bundler $iconify_bundler) - {} - /** * Add a css asset to the bag * @@ -54,30 +41,6 @@ class assets_bag $this->scripts[] = $asset; } - public function add_iconify_icon(string $icon): void - { - $this->iconify_icons[] = $icon; - } - - /** - * Inject iconify icons into template - * - * @param string $output Output before injection - * @param string $variable_name Variable name for injection - * @param bool $use_cdn Flag whether to use CDN or local data - * - * @return string Output after injection - */ - public function inject_iconify_icons(string $output, string $variable_name, bool $use_cdn): string - { - if (str_contains($output, $variable_name)) - { - $output = str_replace($variable_name, $use_cdn ? '' : $this->get_iconify_content(), $output); - } - - return $output; - } - /** * Returns all css assets * @@ -129,22 +92,4 @@ class assets_bag return $output; } - - /** - * Gets the HTML code to include all iconify icons - * - * @return string HTML code for iconify bundle - */ - public function get_iconify_content(): string - { - $output = ''; - if (count($this->iconify_icons)) - { - $output .= ''; - } - return $output; - } } diff --git a/phpBB/phpbb/template/twig/environment.php b/phpBB/phpbb/template/twig/environment.php index a46d4982f1..68d3e9ad89 100644 --- a/phpBB/phpbb/template/twig/environment.php +++ b/phpBB/phpbb/template/twig/environment.php @@ -211,7 +211,6 @@ class environment extends \Twig\Environment { $context['definition']->set('SCRIPTS', '__SCRIPTS_' . $placeholder_salt . '__'); $context['definition']->set('STYLESHEETS', '__STYLESHEETS_' . $placeholder_salt . '__'); - $context['definition']->set('ICONIFY_ICONS', '__ICONIFY_ICONS_' . $placeholder_salt . '__'); } /** @@ -259,7 +258,6 @@ class environment extends \Twig\Environment { $output = str_replace('__STYLESHEETS_' . $placeholder_salt . '__', $this->assets_bag->get_stylesheets_content(), $output); $output = str_replace('__SCRIPTS_' . $placeholder_salt . '__', $this->assets_bag->get_scripts_content(), $output); - $output = $this->assets_bag->inject_iconify_icons($output, '__ICONIFY_ICONS_' . $placeholder_salt . '__', $this->phpbb_config['allow_cdn']); return $output; } diff --git a/phpBB/phpbb/template/twig/extension/icon.php b/phpBB/phpbb/template/twig/extension/icon.php index 72aa710fbc..f0748432a6 100644 --- a/phpBB/phpbb/template/twig/extension/icon.php +++ b/phpBB/phpbb/template/twig/extension/icon.php @@ -57,7 +57,7 @@ class icon extends AbstractExtension * Generate icon HTML for use in the template, depending on the mode. * * @param environment $environment Twig environment object - * @param string $type Icon type (font|iconify|png|svg) + * @param string $type Icon type (font|png|svg) * @param array|string $icon Icon name (eg. "bold") * @param string $title Icon title * @param bool $hidden Hide the icon title from view @@ -86,13 +86,6 @@ class icon extends AbstractExtension // Nothing to do here.. break; - case 'iconify': - $source = explode(':', $icon); - $source = $source[0]; - $environment->get_assets_bag()->add_iconify_icon($icon); - - break; - case 'png': $filesystem = $environment->get_filesystem(); $root_path = $environment->get_web_root_path(); @@ -137,7 +130,6 @@ class icon extends AbstractExtension default: return ''; - break; } // If no PNG or SVG icon was found, display a default 404 SVG icon. diff --git a/phpBB/styles/all/template/macros/icons/iconify.twig b/phpBB/styles/all/template/macros/icons/iconify.twig deleted file mode 100644 index 9287bbaf8e..0000000000 --- a/phpBB/styles/all/template/macros/icons/iconify.twig +++ /dev/null @@ -1,4 +0,0 @@ -{% apply spaceless %} - -{% if TITLE %}{{ TITLE }}{% endif %} -{% endapply %} diff --git a/tests/assets/iconify_bundler_test.php b/tests/assets/iconify_bundler_test.php deleted file mode 100644 index 6248fdce41..0000000000 --- a/tests/assets/iconify_bundler_test.php +++ /dev/null @@ -1,143 +0,0 @@ - - * @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\tests\unit\assets; - -class iconify_bundler_test extends \phpbb_test_case -{ - /** @var array Log content */ - protected $log_content = []; - - /** @var \phpbb\assets\iconify_bundler */ - protected $bundler; - - public function setUp(): void - { - global $phpbb_root_path; - - $log = $this->getMockBuilder('\phpbb\log\dummy') - ->onlyMethods(['add']) - ->getMock(); - $log->method('add') - ->willReturnCallback(function ($mode, $user_id, $log_ip, $log_operation, $log_time = false, $additional_data = array()) { - $this->log_content[] = $log_operation; - }); - - $this->bundler = new \phpbb\assets\iconify_bundler($log, $phpbb_root_path); - } - - public function data_test_generate_bundle() - { - return [ - [ - ['fa:address-card-o'], - ['"prefix":"fa"', '"address-card-o"'], - ], - [ - ['fa:address-card-o', 'ic:baseline-credit-card'], - ['"prefix":"fa"', '"address-card-o"', '"prefix":"ic"', '"baseline-credit-card"'], - ], - [ - ['fa:address-card-o', 'fa:foo-bar'], - ['"prefix":"fa"', '"address-card-o"'], - ['LOG_ICON_INVALID'], - ], - [ - ['fa:address-card-o', 'ic:baseline-credit-card', 'ic:baseline-credit-card'], - ['"prefix":"fa"', '"address-card-o"', '"prefix":"ic"', '"baseline-credit-card"'], - ], - [ - ['fa:address-card-o', 'ic:baseline-credit-card', 'ic:baseline-add-ic-call'], - ['"prefix":"fa"', '"address-card-o"', '"prefix":"ic"', '"baseline-credit-card"', '"baseline-add-ic-call"'], - ], - [ - ['fa:address-card-o', 'fa:bell', 'ic:baseline-credit-card', 'ic:baseline-add-ic-call'], - ['"prefix":"fa"', '"address-card-o"', '"bell"', '"prefix":"ic"', '"baseline-credit-card"', '"baseline-add-ic-call"'], - ], - [ - ['@test'], - [], - ['LOG_ICON_INVALID'], - ], - [ - ['fa:address-foo-o'], - ['"prefix":"fa"', '"icons":[]'], - ['LOG_ICON_INVALID'], - ], - [ - ['foo:bar'], - [], - ['LOG_ICON_COLLECTION_INVALID'] - ], - [ - ['@iconify:fa:address-card-o'], - ['"prefix":"fa"', '"address-card-o"'], - ], - [ - ['@iconify:someother:fa:address-card-o'], - [], - ['LOG_ICON_INVALID'], - ], - [ - ['iconify:fa:address-card-o'], - ['"prefix":"fa"', '"address-card-o"'], - ], - [ - ['iconify:fa:fa:address-card-o'], - [], - ['LOG_ICON_INVALID'], - ], - [ - ['test'], - [], - ['LOG_ICON_INVALID'], - ], - [ - [''], - [], - ['LOG_ICON_INVALID'], - ], - [ - ['fa-address-card-o'], - ['"prefix":"fa"', '"address-card-o"'], - ], - ]; - } - - /** - * @dataProvider data_test_generate_bundle - */ - public function test_generate_bundle($icons, $expected, $log_content = []) - { - $this->bundler->add_icons($icons); - $bundle = $this->bundler->run(); - foreach ($expected as $expected_part) - { - $this->assertStringContainsString($expected_part, $bundle, 'Failed asserting that generated bundle contains ' . $expected_part); - } - - if (!count($expected)) - { - $this->assertEquals($bundle, '', 'Failed asserting that generated bundle is empty'); - } - - if (count($log_content)) - { - $this->assertEquals($this->log_content, $log_content, 'Failed asserting that log content is correct'); - } - else - { - $this->assertEmpty($this->log_content, 'Failed asserting that log content is empty'); - } - } -} diff --git a/tests/controller/common_helper_route.php b/tests/controller/common_helper_route.php index cfa172165e..51b352a846 100644 --- a/tests/controller/common_helper_route.php +++ b/tests/controller/common_helper_route.php @@ -117,8 +117,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_ $container->setParameter('core.environment', PHPBB_ENVIRONMENT); $cache_path = $phpbb_root_path . 'cache/twig'; $log = new \phpbb\log\dummy(); - $iconify_bundler = new \phpbb\assets\iconify_bundler($log, $phpbb_root_path); - $assets_bag = new \phpbb\template\assets_bag($iconify_bundler); + $assets_bag = new \phpbb\template\assets_bag(); $context = new \phpbb\template\context(); $loader = new \phpbb\template\twig\loader(''); $twig = new \phpbb\template\twig\environment( diff --git a/tests/email/email_parsing_test.php b/tests/email/email_parsing_test.php index 86a1423412..46f8e2309b 100644 --- a/tests/email/email_parsing_test.php +++ b/tests/email/email_parsing_test.php @@ -67,8 +67,7 @@ class phpbb_email_parsing_test extends phpbb_test_case $phpbb_container->set('ext.manager', $extension_manager); $log = new \phpbb\log\dummy(); - $iconify_bundler = new \phpbb\assets\iconify_bundler($log, $phpbb_root_path); - $assets_bag = new \phpbb\template\assets_bag($iconify_bundler); + $assets_bag = new \phpbb\template\assets_bag(); $phpbb_container->set('assets.bag', $assets_bag); $context = new \phpbb\template\context(); diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php index 5a6185219c..095efd3a69 100644 --- a/tests/extension/metadata_manager_test.php +++ b/tests/extension/metadata_manager_test.php @@ -67,8 +67,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case $this->phpEx ); $log = new \phpbb\log\dummy(); - $iconify_bundler = new \phpbb\assets\iconify_bundler($log, $this->phpbb_root_path); - $assets_bag = new \phpbb\template\assets_bag($iconify_bundler); + $assets_bag = new \phpbb\template\assets_bag(); $twig = new \phpbb\template\twig\environment( $assets_bag, $this->config, diff --git a/tests/template/extension_test.php b/tests/template/extension_test.php index cfc2867509..0d5ccaecfd 100644 --- a/tests/template/extension_test.php +++ b/tests/template/extension_test.php @@ -96,8 +96,7 @@ class phpbb_template_extension_test extends phpbb_template_template_test_case $context = new \phpbb\template\context(); $loader = new \phpbb\template\twig\loader([]); $log = new \phpbb\log\dummy(); - $iconify_bundler = new \phpbb\assets\iconify_bundler($log, $phpbb_root_path); - $assets_bag = new \phpbb\template\assets_bag($iconify_bundler); + $assets_bag = new \phpbb\template\assets_bag(); $twig = new \phpbb\template\twig\environment( $assets_bag, $config, diff --git a/tests/template/template_allfolder_test.php b/tests/template/template_allfolder_test.php index de24aaf5fc..a495f8aff8 100644 --- a/tests/template/template_allfolder_test.php +++ b/tests/template/template_allfolder_test.php @@ -59,8 +59,7 @@ class phpbb_template_allfolder_test extends phpbb_template_template_test_case $context = new \phpbb\template\context(); $loader = new \phpbb\template\twig\loader(''); $log = new \phpbb\log\dummy(); - $iconify_bundler = new \phpbb\assets\iconify_bundler($log, $phpbb_root_path); - $assets_bag = new \phpbb\template\assets_bag($iconify_bundler); + $assets_bag = new \phpbb\template\assets_bag(); $twig = new \phpbb\template\twig\environment( $assets_bag, $config, diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php index eeff39dfaf..a9b1d39451 100644 --- a/tests/template/template_events_test.php +++ b/tests/template/template_events_test.php @@ -153,8 +153,7 @@ Zeta test event in all', $context = new \phpbb\template\context(); $loader = new \phpbb\template\twig\loader(''); $log = new \phpbb\log\dummy(); - $iconify_bundler = new \phpbb\assets\iconify_bundler($log, $phpbb_root_path); - $assets_bag = new \phpbb\template\assets_bag($iconify_bundler); + $assets_bag = new \phpbb\template\assets_bag(); $twig = new \phpbb\template\twig\environment( $assets_bag, $config, diff --git a/tests/template/template_includecss_test.php b/tests/template/template_includecss_test.php index f2476164ed..a11f627c6f 100644 --- a/tests/template/template_includecss_test.php +++ b/tests/template/template_includecss_test.php @@ -45,8 +45,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te $context = new \phpbb\template\context(); $loader = new \phpbb\template\twig\loader(''); $log = new \phpbb\log\dummy(); - $iconify_bundler = new \phpbb\assets\iconify_bundler($log, $phpbb_root_path); - $assets_bag = new \phpbb\template\assets_bag($iconify_bundler); + $assets_bag = new \phpbb\template\assets_bag(); $twig = new \phpbb\template\twig\environment( $assets_bag, $config, diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php index f5ba3b8a22..5224e24b71 100644 --- a/tests/template/template_test_case.php +++ b/tests/template/template_test_case.php @@ -96,8 +96,7 @@ class phpbb_template_template_test_case extends phpbb_test_case $context = new \phpbb\template\context(); $loader = new \phpbb\template\twig\loader(''); $log = new \phpbb\log\dummy(); - $iconify_bundler = new \phpbb\assets\iconify_bundler($log, $phpbb_root_path); - $assets_bag = new \phpbb\template\assets_bag($iconify_bundler); + $assets_bag = new \phpbb\template\assets_bag(); $twig = new \phpbb\template\twig\environment( $assets_bag, $config, diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php index 59fa45d57f..214d3503c8 100644 --- a/tests/template/template_test_case_with_tree.php +++ b/tests/template/template_test_case_with_tree.php @@ -46,8 +46,7 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat $context = new \phpbb\template\context(); $loader = new \phpbb\template\twig\loader(''); $log = new \phpbb\log\dummy(); - $iconify_bundler = new \phpbb\assets\iconify_bundler($log, $phpbb_root_path); - $assets_bag = new \phpbb\template\assets_bag($iconify_bundler); + $assets_bag = new \phpbb\template\assets_bag(); $twig = new \phpbb\template\twig\environment( $assets_bag, $config, diff --git a/tests/template/twig_test.php b/tests/template/twig_test.php index e22f3c00ba..69280caa15 100644 --- a/tests/template/twig_test.php +++ b/tests/template/twig_test.php @@ -64,8 +64,7 @@ class twig_test extends \phpbb_test_case $context = new \phpbb\template\context(); $loader = new \phpbb\template\twig\loader(''); $log = new \phpbb\log\dummy(); - $iconify_bundler = new \phpbb\assets\iconify_bundler($log, $phpbb_root_path); - $assets_bag = new \phpbb\template\assets_bag($iconify_bundler); + $assets_bag = new \phpbb\template\assets_bag(); $twig = new \phpbb\template\twig\environment( $assets_bag, $config,