Plugin Directory

Changeset 3208262


Ignore:
Timestamp:
12/15/2024 08:22:01 PM (16 months ago)
Author:
pputzer
Message:

Committing 5.10.0-alpha.2 to trunk

Location:
wp-typography/trunk
Files:
10 added
4 deleted
121 edited

Legend:

Unmodified
Added
Removed
  • wp-typography/trunk/CHANGELOG.md

    r2852622 r3208262  
    11# Changes
     2
     3## 5.10.0 - December 15, 2024
     4*   _Bugfix_: Default styles were always loaded, even when `Include styling for CSS hooks` was unchecked.
     5*   _Bugfix_: No more `Function _load_textdomain_just_in_time was called incorrectly.` (present since WordPress 6.7).
     6*   _Bugfix_: Block Editor blocks and the sidebar extension have been split into separate assets to prevent issues
     7              with the widget editor (and customizer preview).
     8*   _Bugfix_: Passing a `null` value to `WP_Typography::process` will no longer result in a `TypeError` when processing
     9              has been disabled for the post.
     10*   _Change_: WordPress minimum version increased to 6.6.
    211
    312## 5.9.1 - January 22, 2023
  • wp-typography/trunk/admin/block-editor/src/blocks/typography/edit.js

    r2310237 r3208262  
    44 * This file is part of wp-Typography.
    55 *
    6  * Copyright 2020 Peter Putzer.
     6 * Copyright 2020-2024 Peter Putzer.
    77 *
    88 * This program is free software; you can redistribute it and/or
     
    2525 * @author   Peter Putzer <github@mundschenk.at>
    2626 * @since    5.7.0
    27  * @requires Gutenberg 4.3
    2827 */
    2928
     
    4039 *
    4140 * @param {Object} props {
    42  *     attributes    - The block attributes.
    43  *     setAttributes - The attribute setter function.
    44  * }
     41 *                       attributes    - The block attributes.
     42 *                       setAttributes - The attribute setter function.
     43 *                       }
    4544 *
    4645 * @return {Object} ECMAScript JSX Markup for the editor
  • wp-typography/trunk/admin/block-editor/src/blocks/typography/index.js

    r2310237 r3208262  
    44 * This file is part of wp-Typography.
    55 *
    6  * Copyright 2020 Peter Putzer.
     6 * Copyright 2020-2024 Peter Putzer.
    77 *
    88 * This program is free software; you can redistribute it and/or
     
    2525 * @author   Peter Putzer <github@mundschenk.at>
    2626 * @since    5.7.0
    27  * @requires Gutenberg 4.3
    2827 */
    2928
     
    3231 */
    3332import { __ } from '@wordpress/i18n';
     33
     34/**
     35 * Type checking dependencies
     36 */
     37import PropTypes from 'prop-types';
    3438
    3539/**
     
    5256    },
    5357
     58    propTypes: {
     59        className: PropTypes.string.isRequired,
     60    },
     61
    5462    edit,
    5563    save,
  • wp-typography/trunk/admin/block-editor/src/blocks/typography/save.js

    r2310237 r3208262  
    44 * This file is part of wp-Typography.
    55 *
    6  * Copyright 2020 Peter Putzer.
     6 * Copyright 2020-2024 Peter Putzer.
    77 *
    88 * This program is free software; you can redistribute it and/or
     
    2525 * @author   Peter Putzer <github@mundschenk.at>
    2626 * @since    5.7.0
    27  * @requires Gutenberg 4.3
    2827 */
    2928
  • wp-typography/trunk/admin/block-editor/src/plugins/sidebar-post-toggle/index.js

    r2330235 r3208262  
    44 * This file is part of wp-Typography.
    55 *
    6  * Copyright 2020 Peter Putzer.
     6 * Copyright 2020-2024 Peter Putzer.
    77 *
    88 * This program is free software; you can redistribute it and/or
     
    2525 * @author  Peter Putzer <github@mundschenk.at>
    2626 * @since   5.7.0
    27  * @requires Gutenberg 4.3
    2827 */
    2928
     
    3130 * WordPress dependencies
    3231 */
    33 import { PluginDocumentSettingPanel } from '@wordpress/edit-post';
     32import { PluginDocumentSettingPanel } from '@wordpress/editor';
    3433import { select } from '@wordpress/data';
     34
     35/**
     36 * Type checking dependencies
     37 */
     38import PropTypes from 'prop-types';
    3539
    3640/**
     
    4448export const name = 'wp-typography-sidebar';
    4549const icon = 'format-quote';
     50
     51/**
     52 * Type checking.
     53 */
     54const propTypes = {
     55    className: PropTypes.string.isRequired,
     56    typographyEnabled: PropTypes.bool.isRequired,
     57    setTypographyEnabled: PropTypes.func.isRequired,
     58};
    4659
    4760/**
     
    7184
    7285// Export settings.
    73 export const settings = { icon, render };
     86export const settings = { icon, render, propTypes };
  • wp-typography/trunk/admin/block-editor/src/plugins/sidebar-post-toggle/toggle-control.js

    r2310246 r3208262  
    22
    33/**
    4  * wp-Typography
     4 * This file is part of wp-Typography.
    55 *
    6  * A toggle switch for disabling wp-Typography for specific posts.
     6 * Copyright 2020-2024 Peter Putzer.
    77 *
    8  * @requires Gutenberg 4.3
     8 * This program is free software; you can redistribute it and/or
     9 * modify it under the terms of the GNU General Public License
     10 * as published by the Free Software Foundation; either version 2
     11 * of the License, or (at your option) any later version.
     12 *
     13 * This program is distributed in the hope that it will be useful,
     14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16 * GNU General Public License for more details.
     17 *
     18 * You should have received a copy of the GNU General Public License
     19 * along with this program; if not, write to the Free Software
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
     21 *
     22 * ***
     23 *
     24 * @file    A toggle switch for disabling wp-Typography for specific posts.
     25 * @author  Peter Putzer <github@mundschenk.at>
     26 * @since   5.7.0
    927 */
    1028
     
    3452    withSelect( ( select ) => {
    3553        return {
    36             typographyEnabled: ! select( 'core/editor' ).getEditedPostAttribute(
    37                 'meta'
    38             ).wp_typography_post_enhancements_disabled,
     54            typographyEnabled:
     55                ! select( 'core/editor' ).getEditedPostAttribute( 'meta' )
     56                    .wp_typography_post_enhancements_disabled,
    3957        };
    4058    } ),
  • wp-typography/trunk/admin/partials/settings/settings-page.php

    r1941764 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2014-2018 Peter Putzer.
     5 *  Copyright 2014-2023 Peter Putzer.
    66 *  Copyright 2009-2011 KINGdesk, LLC.
    77 *
     
    2626 */
    2727
    28 use WP_Typography\Data_Storage\Options;
     28namespace WP_Typography\Partials\Admin;
     29
     30/**
     31 * Required template variables:
     32 *
     33 * @var string $plugin_name             The plugin name.
     34 * @var string $active_tab              The active tab.
     35 * @var string $option_group            The active option group name.
     36 * @var array  $admin_form_tabs         The admin form tabs.
     37 * @var string $restore_defaults_button The `name` attribute of the Restore Defaults submit button.
     38 * @var string $clear_cache_button      The `name` attribute of the Clear Cache submit button.
     39 *
     40 * @phpstan-var array<string, array{heading:string, description:string}> $admin_form_tabs
     41 */
    2942
    3043?><div class='wrap'>
    31     <h1><?php echo \esc_html( \sprintf( /* translators: settings page headline, %s is the plugin name */ \__( '%s Settings', 'wp-typography' ), $this->plugin_name ) ); ?></h1>
    32     <?php
    33         // Check active tab.
    34         $active_tab = $this->get_active_settings_tab();
    35     ?>
     44    <h1><?php echo \esc_html( \sprintf( /* translators: settings page headline, %s is the plugin name */ \__( '%s Settings', 'wp-typography' ), $plugin_name ) ); ?></h1>
    3645    <h2 class="nav-tab-wrapper">
    37     <?php foreach ( $this->admin_form_tabs as $tab_id => $settings_tab ) : ?>
     46    <?php foreach ( $admin_form_tabs as $tab_id => $settings_tab ) : ?>
    3847        <?php
    39             $query_string = '?page=' . \strtolower( $this->plugin_name ) . '&tab=' . $tab_id;
     48            $query_string = '?page=' . \strtolower( $plugin_name ) . '&tab=' . $tab_id;
    4049            $classes      = 'nav-tab' . ( $tab_id === $active_tab ? ' nav-tab-active' : '' );
    4150        ?>
     
    4554
    4655    <form method="post" action="options.php">
    47         <?php \settings_fields( self::OPTION_GROUP . $active_tab ); ?>
    48         <?php \do_settings_sections( self::OPTION_GROUP . $active_tab ); ?>
     56        <?php \settings_fields( $option_group ); ?>
     57        <?php \do_settings_sections( $option_group ); ?>
    4958
    5059        <p class="submit">
    5160            <?php \submit_button( \__( 'Save Changes', 'wp-typography' ), 'primary', 'save_changes', false, [ 'tabindex' => 1 ] ); ?>
    5261            <span class="aux-buttons">
    53                 <?php \submit_button( \__( 'Restore Defaults', 'wp-typography' ), 'delete', $this->options->get_name( Options::RESTORE_DEFAULTS ), false, [ 'tabindex' => 2 ] ); ?>
     62                <?php \submit_button( \__( 'Restore Defaults', 'wp-typography' ), 'delete', $restore_defaults_button, false, [ 'tabindex' => 2 ] ); ?>
    5463                <?php // The whitespace is necessary. ?>
    55                 <?php \submit_button( \__( 'Clear Cache', 'wp-typography' ), 'secondary', $this->options->get_name( Options::CLEAR_CACHE ), false, [ 'tabindex' => 3 ] ); ?>
     64                <?php \submit_button( \__( 'Clear Cache', 'wp-typography' ), 'secondary', $clear_cache_button, false, [ 'tabindex' => 3 ] ); ?>
    5665            </span>
    5766        </p><!-- .submit -->
  • wp-typography/trunk/includes/class-wp-typography.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2014-2022 Peter Putzer.
     5 *  Copyright 2014-2024 Peter Putzer.
    66 *  Copyright 2009-2011 KINGdesk, LLC.
    77 *
     
    2626 */
    2727
    28 use WP_Typography\Data_Storage\Cache;
    29 use WP_Typography\Data_Storage\Options;
    30 use WP_Typography\Data_Storage\Transients;
    31 
    32 use WP_Typography\Settings\Plugin_Configuration as Config;
    33 
    34 use PHP_Typography\PHP_Typography;
    3528use PHP_Typography\Settings;
    36 use PHP_Typography\Hyphenator\Cache as Hyphenator_Cache;
    3729
    3830/**
     
    4941 * @method void clear_cache() Retrieves the plugin's default option values.
    5042 *
    51  * @method array get_config() Retrieves the plugin configuration.
    52  * @method array get_default_options() Retrieves the plugin's default option values.
     43 * @method array<string,string|int|bool> get_config() Retrieves the plugin configuration.
     44 * @method array<string,string|int|bool> get_default_options() Retrieves the plugin's default option values.
    5345 * @method void set_default_options($force_defaults = false) Initializes the options with default values.
    5446 *
     
    5749 * @method string process_feed_title($text, Settings $settings = null) Processes a heading text fragment as part of an RSS feed.
    5850 * @method string process_feed($text, $is_title = false, Settings $settings = null) Processes a content text fragment as part of an RSS feed.
    59  * @method array process_title_parts($title_parts, Settings $settings = null) Processes title parts and strips &shy; and zero-width space.
    60  *
    61  * @method array get_hyphenation_languages() Retrieves and caches the list of valid hyphenation languages.
    62  * @method array get_diacritic_languages() Retrieves and caches the list of valid diacritic replacement languages.
     51 * @method string[] process_title_parts($title_parts, Settings $settings = null) Processes title parts and strips &shy; and zero-width space.
     52 *
     53 * @method array<string,string> get_hyphenation_languages( $translate = true ) Retrieves and caches the list of valid hyphenation languages.
     54 * @method array<string,string> get_diacritic_languages( $translate = true ) Retrieves and caches the list of valid diacritic replacement languages.
    6355 */
    6456abstract class WP_Typography {
     
    8274     * @throws BadMethodCallException Thrown when WP_Typography::set_instance after plugin initialization.
    8375     */
    84     public static function set_instance( WP_Typography $instance ) : void {
     76    public static function set_instance( WP_Typography $instance ): void {
    8577        if ( null === self::$instance ) {
    8678            self::$instance = $instance;
     
    10092     * @return WP_Typography
    10193     */
    102     public static function get_instance() {
     94    public static function get_instance(): WP_Typography {
    10395        if ( null === self::$instance ) {
    10496            throw new BadMethodCallException( 'WP_Typography::get_instance called without prior plugin intialization.' );
     
    119111     * @return mixed
    120112     */
    121     public static function __callStatic( $name, array $arguments ) {
     113    public static function __callStatic( string $name, array $arguments ) {
    122114        if ( \method_exists( self::$instance, $name ) ) {
    123115            return self::$instance->$name( ...$arguments );
    124116        } else {
    125             throw new BadMethodCallException( "Static method WP_Typography::$name does not exist." );
     117            throw new BadMethodCallException( 'Static method WP_Typography::' . \esc_html( $name ) . ' does not exist.' );
    126118        }
    127119    }
     
    134126     * @return Settings
    135127     */
    136     public static function get_user_settings() {
     128    public static function get_user_settings(): Settings {
    137129        return clone self::get_instance()->get_settings();
    138130    }
     
    150142     * @return string The processed $text.
    151143     */
    152     public static function filter( $text, Settings $settings = null ) {
     144    public static function filter( string $text, ?Settings $settings = null ): string {
    153145        return self::get_instance()->process( $text, false, false, $settings );
    154146    }
     
    166158     * @return string The processed $text.
    167159     */
    168     public static function filter_title( $text, Settings $settings = null ) {
     160    public static function filter_title( string $text, ?Settings $settings = null ): string {
    169161        return self::get_instance()->process_title( $text, $settings );
    170162    }
     
    182174     * @return string[]
    183175     */
    184     public static function filter_title_parts( array $title_parts, Settings $settings = null ) : array {
     176    public static function filter_title_parts( array $title_parts, ?Settings $settings = null ): array {
    185177        return self::get_instance()->process_title_parts( $title_parts, $settings );
    186178    }
     
    198190     * @return string The processed $text.
    199191     */
    200     public static function filter_feed( $text, Settings $settings = null ) {
     192    public static function filter_feed( string $text, ?Settings $settings = null ): string {
    201193        return self::get_instance()->process_feed( $text, false, $settings );
    202194    }
     
    214206     * @return string The processed $text.
    215207     */
    216     public static function filter_feed_title( $text, Settings $settings = null ) {
     208    public static function filter_feed_title( string $text, ?Settings $settings = null ): string {
    217209        return self::get_instance()->process_feed_title( $text, $settings );
    218210    }
     
    235227     * @return string The hashed version (containing as few bytes as possible);
    236228     */
    237     private static function hash_version_string( $version ) {
     229    private static function hash_version_string( $version ): string {
    238230        $hash = '';
    239231
     
    252244     * @return string
    253245     */
    254     public function get_version_hash() {
     246    public function get_version_hash(): string {
    255247        return self::hash_version_string( self::get_instance()->get_version() );
    256248    }
  • wp-typography/trunk/includes/wp-typography/class-factory.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2017-2022 Peter Putzer.
     5 *  Copyright 2017-2024 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    3333use WP_Typography\Data_Storage\Transients;
    3434
     35use WP_Typography\UI\Template;
     36
    3537use WP_Typography\Integration\Container as Integrations;
    3638use WP_Typography\Settings\Basic_Locale_Settings;
    37 use WP_Typography\Settings\Locale_Settings;
    3839
    3940use WP_Typography\Exceptions\Object_Factory_Exception;
     
    6263     * @var Factory
    6364     */
    64     private static $factory;
     65    private static Factory $factory;
    6566
    6667    /**
     
    8485     *                                  be created.
    8586     */
    86     public static function get() : self {
    87         if ( ! self::$factory instanceof static ) {
     87    public static function get(): self {
     88        if ( ! isset( self::$factory ) ) {
    8889
    8990            // Create factory.
     
    108109     * @return mixed[]
    109110     */
    110     protected function get_rules() : array {
     111    protected function get_rules(): array {
    111112        return [
    112113            // Shared helpers.
     
    114115            Transients::class                      => self::SHARED,
    115116            Options::class                         => self::SHARED,
     117            Template::class                        => [
     118                'shared'          => true,
     119                'constructParams' => [ \WP_TYPOGRAPHY_PLUGIN_PATH ],
     120            ],
    116121
    117122            // API implementation.
     
    241246     * @return string
    242247     */
    243     protected function get_plugin_version( $plugin_file ) : string {
     248    protected function get_plugin_version( $plugin_file ): string {
    244249        // Load version from plugin data.
    245250        if ( ! \function_exists( 'get_plugin_data' ) ) {
    246             require_once \ABSPATH . 'wp-admin/includes/plugin.php';
     251            require_once \ABSPATH . 'wp-admin/includes/plugin.php'; // @phpstan-ignore requireOnce.fileNotFound
    247252        }
    248253
     
    266271     * @phpstan-return array<array<self::INSTANCE,class-string<Components\Plugin_Component>>>
    267272     */
    268     protected function get_components() : array {
     273    protected function get_components(): array {
    269274        return [
    270275            [ self::INSTANCE => Components\Setup::class ],
     
    293298     * @phpstan-return array<array<self::INSTANCE,class-string<Integration\Plugin_Integration>>>
    294299     */
    295     protected function get_plugin_integrations() : array {
     300    protected function get_plugin_integrations(): array {
    296301        return [
    297302            [ self::INSTANCE => Integration\ACF_Integration::class ],
     
    313318     * }
    314319     *
    315      * @phpstan-return array<array<self::INSTANCE,string>>>
    316      */
    317     protected function get_supported_locales() : array {
     320     * @phpstan-return array<array<self::INSTANCE,string>>
     321     */
     322    protected function get_supported_locales(): array {
    318323        return [
    319324            [ self::INSTANCE => '$LocaleSwitzerland' ],
  • wp-typography/trunk/includes/wp-typography/class-implementation.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2014-2022 Peter Putzer.
     5 *  Copyright 2014-2024 Peter Putzer.
    66 *  Copyright 2009-2011 KINGdesk, LLC.
    77 *
     
    156156     *
    157157     * @since 4.0.0
    158      * @since 5.0.0 Language names are translated.
    159      * @since 5.3.0 The method can be called both statically and dynamically.
     158     * @since 5.0.0  Language names are translated.
     159     * @since 5.3.0  The method can be called both statically and dynamically.
     160     * @since 5.10.0 Optional parameter `$translate` added.
     161     *
     162     * @param  bool $translate Optional. Determines whether language names will be translated. Default true.
    160163     *
    161164     * @return string[] An array in the form of ( $language_code => $language ).
    162165     */
    163     public function get_hyphenation_languages() : array {
    164         return $this->load_languages( 'hyphenate_languages', [ PHP_Typography::class, 'get_hyphenation_languages' ], 'hyphenate' );
     166    public function get_hyphenation_languages( bool $translate = true ): array {
     167        return $this->load_languages( 'hyphenate_languages', [ PHP_Typography::class, 'get_hyphenation_languages' ], 'hyphenate', $translate );
    165168    }
    166169
     
    169172     *
    170173     * @since 4.0.0
    171      * @since 5.0.0 Language names are translated.
    172      * @since 5.3.0 The method can be called both statically and dynamically.
     174     * @since 5.0.0  Language names are translated.
     175     * @since 5.3.0  The method can be called both statically and dynamically.
     176     * @since 5.10.0 Optional parameter `$translate` added.
     177     *
     178     * @param  bool $translate Optional. Determines whether language names will be translated. Default true.
    173179     *
    174180     * @return string[] An array in the form of ( $language_code => $language ).
    175181     */
    176     public function get_diacritic_languages() : array {
    177         return $this->load_languages( 'diacritic_languages', [ PHP_Typography::class, 'get_diacritic_languages' ], 'diacritic' );
     182    public function get_diacritic_languages( bool $translate = true ): array {
     183        return $this->load_languages( 'diacritic_languages', [ PHP_Typography::class, 'get_diacritic_languages' ], 'diacritic', $translate );
    178184    }
    179185
    180186    /**
    181187     * Load and cache given language list.
     188     *
     189     * @since 5.10.0 Optional parameter `$translate` added.
    182190     *
    183191     * @param  string   $cache_key         A cache key.
    184192     * @param  callable $get_language_list Retrieval function for the language list.
    185193     * @param  string   $type              Either 'diacritic' or 'hyphenate'.
     194     * @param  bool     $translate         Optional. Determines whether language names need to be translated. Default true.
    186195     *
    187196     * @return string[]
    188197     */
    189     protected function load_languages( $cache_key, callable $get_language_list, $type ) : array {
    190         // Try to load hyphenation language list from cache.
    191         $languages = $this->cache->get( $cache_key, $found );
     198    protected function load_languages( string $cache_key, callable $get_language_list, string $type, bool $translate = true ): array {
     199        if ( $translate ) {
     200            // Try to load hyphenation language list from cache.
     201            $languages = $this->cache->get( $cache_key, $found );
     202
     203            // Dynamically generate the list of hyphenation language patterns.
     204            if ( false === $found || ! \is_array( $languages ) ) {
     205                $languages = $this->translate_languages( $this->maybe_load_untranslated_languages_from_disk( $cache_key, $get_language_list, $type ) );
     206
     207                /**
     208                 * Filters the caching duration for the language plugin lists.
     209                 *
     210                 * @since 3.2.0
     211                 * @since 5.9.0 Type of parameter `$duration` corrected to `int`.
     212                 *
     213                 * @param int    $duration The duration in seconds. Defaults to 1 week.
     214                 * @param string $list     The name language plugin list.
     215                 */
     216                $duration = \apply_filters( 'typo_language_list_caching_duration', WEEK_IN_SECONDS, "{$type}_languages" );
     217
     218                // Cache translated hyphenation languages.
     219                $this->cache->set( $cache_key, $languages, $duration );
     220            }
     221        } else {
     222            $languages = $this->maybe_load_untranslated_languages_from_disk( $cache_key, $get_language_list, $type );
     223        }
     224
     225        return $languages;
     226    }
     227
     228    /**
     229     * Load given language list from disk without translating the language names.
     230     *
     231     * @since 5.10.0
     232     *
     233     * @param  string   $cache_key         A cache key.
     234     * @param  callable $get_language_list Retrieval function for the language list.
     235     * @param  string   $type              Either 'diacritic' or 'hyphenate'.
     236     *
     237     * @return string[]
     238     */
     239    protected function maybe_load_untranslated_languages_from_disk( string $cache_key, callable $get_language_list, string $type ): array {
     240        // Try to load language list from cache.
     241        $cache_key_raw = "{$cache_key}_raw";
     242        $languages     = $this->cache->get( $cache_key_raw, $found );
    192243
    193244        // Dynamically generate the list of hyphenation language patterns.
    194245        if ( false === $found || ! \is_array( $languages ) ) {
    195             $languages = self::translate_languages( $get_language_list() );
    196 
    197             /**
    198              * Filters the caching duration for the language plugin lists.
    199              *
    200              * @since 3.2.0
    201              * @since 5.9.0 Type of parameter `$duration` corrected to `int`.
    202              *
    203              * @param int    $duration The duration in seconds. Defaults to 1 week.
    204              * @param string $list     The name language plugin list.
    205              */
    206             $duration = \apply_filters( 'typo_language_list_caching_duration', WEEK_IN_SECONDS, "{$type}_languages" );
     246            /** This filter is documented in wp-typography/components/class-multilingual-support.php */
     247            $duration = \apply_filters( 'typo_language_list_caching_duration', WEEK_IN_SECONDS, "raw_{$type}_languages" );
     248
     249            $languages = $get_language_list();
    207250
    208251            // Cache translated hyphenation languages.
    209             $this->cache->set( $cache_key, $languages, $duration );
     252            $this->cache->set( $cache_key_raw, $languages, $duration );
    210253        }
    211254
     
    216259     * Translate language list.
    217260     *
     261     * @since 5.10.0 Changed into a protected method for easier unit testing.
     262     *
    218263     * @param string[] $languages An array in the form [ LANGUAGE_CODE => LANGUAGE ].
    219264     *
    220265     * @return string[] The same array with the language name translated.
    221266     */
    222     private static function translate_languages( array $languages ) : array {
     267    protected function translate_languages( array $languages ): array {
    223268        \array_walk(
    224269            $languages,
    225             function( &$lang, $code ) {
     270            function ( &$lang ) {
    226271                // The language names are made visible to GlotPress via the
    227272                // autogenerated source file `_language_names.php` (which is not
     
    242287     * @return array<string,string|int|bool>
    243288     */
    244     public function get_config() : array {
     289    public function get_config(): array {
    245290        if ( ! isset( $this->configuration ) ) {
    246291            $config = $this->options->get( Options::CONFIGURATION );
     
    281326     * @return Settings
    282327     */
    283     public function get_settings() : Settings {
     328    public function get_settings(): Settings {
    284329
    285330        // Initialize Settings instance.
     
    322367     * @return string                 The processed `$text`.
    323368     */
    324     public function process_title( $text, Settings $settings = null ) : string {
     369    public function process_title( $text, ?Settings $settings = null ): string {
    325370        return $this->process( $text, true, false, $settings );
    326371    }
     
    338383     * @return string                 The processed `$text`.
    339384     */
    340     public function process_feed_title( $text, Settings $settings = null ) : string {
     385    public function process_feed_title( $text, ?Settings $settings = null ): string {
    341386        return $this->process_feed( $text, true, $settings );
    342387    }
     
    357402     * @return string                 The processed `$text`.
    358403     */
    359     public function process_feed( $text, $is_title = false, Settings $settings = null ) : string {
     404    public function process_feed( $text, $is_title = false, ?Settings $settings = null ): string {
    360405        return $this->process( $text, $is_title, true, $settings );
    361406    }
     
    373418     * @return string[]
    374419     */
    375     public function process_title_parts( array $title_parts, Settings $settings = null ) : array {
     420    public function process_title_parts( array $title_parts, ?Settings $settings = null ): array {
    376421        foreach ( $title_parts as $index => $part ) {
    377422            // Remove "&shy;" and "&#8203;" after processing title part.
    378423            $title_parts[ $index ] = \wp_strip_all_tags(
    379                 \str_replace( [ \PHP_Typography\U::SOFT_HYPHEN, \PHP_Typography\U::ZERO_WIDTH_SPACE ], '', $this->process( $part, true, true, $settings ) )
     424                \str_replace( [ U::SOFT_HYPHEN, U::ZERO_WIDTH_SPACE ], '', $this->process( $part, true, true, $settings ) )
    380425            );
    381426        }
     
    398443     * @return string                   The processed `$text`.
    399444     */
    400     public function process( $text, $is_title = false, $force_feed = false, Settings $settings = null ) : string {
     445    public function process( $text, $is_title = false, $force_feed = false, ?Settings $settings = null ): string {
    401446        // Check if processing is disabled for this post.
    402447        $post_id = \get_the_ID();
     
    418463        // Return original HTML fragment if processing has been disabled.
    419464        if ( $disable ) {
    420             return $text;
     465            return (string) $text;
    421466        }
    422467
     
    451496     * @return string            The processed `$text`.
    452497     */
    453     protected function maybe_process_fragment( $text, $is_title, $is_feed, Settings $settings ) : string {
     498    protected function maybe_process_fragment( $text, $is_title, $is_feed, Settings $settings ): string {
    454499        // Construct cache key.
    455500        $key = 'frag_' . \md5( $text ) . '_' . $settings->get_hash( 32, false ) . '_' . ( $is_feed ? 'f' : '' ) . ( $is_title ? 't' : 's' );
     
    487532     * @return string[]
    488533     */
    489     public function filter_body_class( array $classes ) : array {
     534    public function filter_body_class( array $classes ): array {
    490535        $this->body_classes = $classes;
    491536
     
    500545     * @return PHP_Typography
    501546     */
    502     protected function get_typography_instance() : PHP_Typography {
     547    protected function get_typography_instance(): PHP_Typography {
    503548
    504549        // Retrieve options.
     
    544589     * Save hyphenator cache for the next request.
    545590     */
    546     public function save_hyphenator_cache_on_shutdown() : void {
     591    public function save_hyphenator_cache_on_shutdown(): void {
    547592        if ( isset( $this->hyphenator_cache ) && $this->hyphenator_cache->has_changed() ) {
    548593            $this->transients->cache_object( 'php_hyphenator_cache', $this->hyphenator_cache, 'hyphenator_cache' );
     
    556601     * @param mixed[]  $config The array of configuration entries.
    557602     */
    558     protected function init_settings_from_options( Settings $s, array $config ) : void {
     603    protected function init_settings_from_options( Settings $s, array $config ): void {
    559604        // Necessary for full Settings initialization.
    560605        $s->set_smart_dashes_style( $config[ Config::SMART_DASHES_STYLE ] );
     
    691736     *                                   key and sorted by descending key length.
    692737     */
    693     protected function prepare_smart_quotes_exceptions( $custom_exceptions ) : array {
     738    protected function prepare_smart_quotes_exceptions( $custom_exceptions ): array {
    694739        global $wp_cockneyreplace;
    695740
     
    729774            );
    730775
    731             $exceptions = \array_combine( $patterns, $replacements ) ?: []; // phpcs:ignore WordPress.PHP.DisallowShortTernary -- ensure array type.
     776            $exceptions = \array_combine( $patterns, $replacements ) ?: []; // phpcs:ignore Universal.Operators.DisallowShortTernary -- ensure array type.
    732777        }
    733778
     
    741786        \uksort(
    742787            $exceptions,
    743             function( $a, $b ) {
    744                 return ( \strlen( $b ) - \strlen( $a ) ) ?: \strcmp( $a, $b ); // phpcs:ignore WordPress.PHP.DisallowShortTernary
     788            function ( $a, $b ) {
     789                return ( \strlen( $b ) - \strlen( $a ) ) ?: \strcmp( $a, $b ); // phpcs:ignore Universal.Operators.DisallowShortTernary
    745790            }
    746791        );
     
    754799     * @param bool $force_defaults Optional. Default false.
    755800     */
    756     public function set_default_options( $force_defaults = false ) : void {
     801    public function set_default_options( $force_defaults = false ): void {
    757802        $update = $force_defaults;
    758803
     
    783828     * @return array<string,string|int|bool>
    784829     */
    785     public function get_default_options() : array {
     830    public function get_default_options(): array {
    786831        if ( empty( $this->default_settings ) ) {
    787832            /**
     
    801846     * Clears all transients set by the plugin.
    802847     */
    803     public function clear_cache() : void {
     848    public function clear_cache(): void {
    804849        $this->transients->invalidate();
    805850        $this->cache->invalidate();
     
    815860     * @return string[]         The filtered array.
    816861     */
    817     public function parser_errors_handler( $errors ) : array {
     862    public function parser_errors_handler( $errors ): array {
    818863        /**
    819864         * Filters the HTML parser errors (if there are any).
  • wp-typography/trunk/includes/wp-typography/class-plugin-controller.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2018-2022 Peter Putzer.
     5 *  Copyright 2018-2023 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    2727namespace WP_Typography;
    2828
    29 use WP_Typography\Implementation;
    3029use WP_Typography\Components\Plugin_Component;
    3130
     
    4140     * The plugin API implementation.
    4241     *
    43      * @var \WP_Typography\Implementation
     42     * @var \WP_Typography
    4443     */
    45     private $api;
     44    private \WP_Typography $api;
    4645
    4746    /**
     
    5049     * @var Plugin_Component[]
    5150     */
    52     private $plugin_components = [];
     51    private array $plugin_components = [];
    5352
    5453    /**
     
    6867     * Starts the plugin for real.
    6968     */
    70     public function run() : void {
     69    public function run(): void {
    7170        // Set plugin singleton.
    7271        \WP_Typography::set_instance( $this->api );
  • wp-typography/trunk/includes/wp-typography/class-requirements.php

    r2848497 r3208262  
    33 * This file is part of wp-Typography.
    44 *
    5  * Copyright 2020-2022 Peter Putzer.
     5 * Copyright 2020-2024 Peter Putzer.
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    4040
    4141    const REQUIREMENTS = [
    42         'php'              => '7.2.0',
     42        'php'              => '7.4.0',
    4343        'multibyte'        => true,
    4444        'utf-8'            => true,
     
    7070     * }>
    7171     */
    72     protected function get_requirements() : array {
     72    protected function get_requirements(): array {
    7373        $requirements   = parent::get_requirements();
    7474        $requirements[] = [
     
    8686     * @return bool
    8787     */
    88     protected function check_dom_support() : bool {
     88    protected function check_dom_support(): bool {
    8989        return \class_exists( 'DOMDocument' );
    9090    }
     
    9393     * Prints 'DOM extension missing' admin notice
    9494     */
    95     public function admin_notices_dom_disabled() : void {
     95    public function admin_notices_dom_disabled(): void {
    9696        $this->display_error_notice(
    9797            /* translators: 1: plugin name 2: GD documentation URL */
  • wp-typography/trunk/includes/wp-typography/components/class-admin-interface.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2014-2022 Peter Putzer.
     5 *  Copyright 2014-2024 Peter Putzer.
    66 *  Copyright 2012-2013 Marie Hogebrandt.
    77 *  Copyright 2009-2011 KINGdesk, LLC.
     
    7272     * @var Options
    7373     */
    74     private $options;
     74    private Options $options;
     75
     76    /**
     77     * The template helper.
     78     *
     79     * @var UI\Template
     80     */
     81    private UI\Template $template;
    7582
    7683    /**
    7784     * The user-visible name of the plugin.
    7885     *
    79      * @todo Maybe we should translate the name?
    8086     * @var string $plugin_name
    8187     */
    82     private $plugin_name = 'wp-Typography';
     88    private string $plugin_name = 'wp-Typography';
    8389
    8490    /**
     
    8793     * @var string
    8894     */
    89     private $plugin_basename;
     95    private string $plugin_basename;
    9096
    9197    /**
     
    94100     * @var array<string,string> $admin_resource_links An array in the form of 'anchor text' => 'URL'.
    95101     */
    96     private $admin_resource_links;
     102    private array $admin_resource_links;
    97103
    98104    /**
     
    142148     * @var string
    143149     */
    144     private $active_tab;
     150    private string $active_tab;
    145151
    146152    /**
     
    161167     * Create a new instace of admin backend.
    162168     *
    163      * @since 5.6.0 Parameters $basename and $plugin_path removed.
    164      * @since 5.7.0 Parameter $api added.
    165      *
    166      * @param Implementation $api     The core API.
    167      * @param Options        $options The Options API handler.
    168      */
    169     public function __construct( Implementation $api, Options $options ) {
    170         $this->api     = $api;
    171         $this->options = $options;
    172 
     169     * @since 5.6.0  Parameters $basename and $plugin_path removed.
     170     * @since 5.7.0  Parameter $api added.
     171     * @since 5.10.0 Parameter $template added.
     172     *
     173     * @param Implementation $api      The core API.
     174     * @param Options        $options  The Options API handler.
     175     * @param UI\Template    $template The template helper.
     176     */
     177    public function __construct( Implementation $api, Options $options, UI\Template $template ) {
     178        $this->api      = $api;
     179        $this->options  = $options;
     180        $this->template = $template;
    173181    }
    174182
     
    178186     * @since 5.7.0 Parameter $plugin removed.
    179187     */
    180     public function run() : void {
     188    public function run(): void {
    181189        if ( \is_admin() ) {
    182 
    183190            // Cache the plugin basename.
    184191            $this->plugin_basename = \plugin_basename( \WP_TYPOGRAPHY_PLUGIN_FILE );
    185192
    186             // Set up default options.
    187             $this->defaults = Plugin_Configuration::get_defaults();
    188 
    189             // Initialize admin form.
    190             $this->admin_resource_links = $this->initialize_resource_links();
    191             $this->admin_help_pages     = $this->initialize_help_pages();
    192             $this->admin_form_tabs      = UI\Tabs::get_tabs();
    193             $this->admin_form_sections  = UI\Sections::get_sections();
    194             $this->admin_form_controls  = Control_Factory::initialize( $this->defaults, $this->options, Options::CONFIGURATION );
    195 
    196193            // Add action hooks.
     194            \add_action( 'init', [ $this, 'initialize_translated_properties' ] );
    197195            \add_action( 'admin_menu', [ $this, 'add_options_page' ] );
    198196            \add_action( 'admin_init', [ $this, 'register_the_settings' ] );
     
    205203
    206204    /**
     205     * Initializes all properties containign translated strings, as the
     206     * WordPress i18n functions cannot be called before `init`.
     207     *
     208     * @since 5.10.0
     209     */
     210    public function initialize_translated_properties(): void {
     211        // Set up default options.
     212        $this->defaults = Plugin_Configuration::get_defaults();
     213
     214        // Initialize admin form.
     215        $this->admin_resource_links = $this->initialize_resource_links();
     216        $this->admin_help_pages     = $this->initialize_help_pages();
     217        $this->admin_form_tabs      = UI\Tabs::get_tabs();
     218        $this->admin_form_sections  = UI\Sections::get_sections();
     219        $this->admin_form_controls  = Control_Factory::initialize( $this->defaults, $this->options, Options::CONFIGURATION );
     220    }
     221
     222    /**
    207223     * Initialize displayable strings for the plugin settings page.
    208224     *
    209225     * @return array<string,string> The array keys consist of the translated anchor text, their values of the linked URL.
    210226     */
    211     private function initialize_resource_links() : array {
     227    private function initialize_resource_links(): array {
    212228        return [
    213229            \__( 'Plugin Home', 'wp-typography' ) => 'https://code.mundschenk.at/wp-typography/',
     
    230246     * @phpstan-return Help_Page[]
    231247     */
    232     private function initialize_help_pages() : array {
     248    private function initialize_help_pages(): array {
    233249        return [
    234250            'help-intro' => [
     
    247263     * Register admin settings.
    248264     */
    249     public function register_the_settings() : void {
     265    public function register_the_settings(): void {
    250266        $configuration_name    = $this->options->get_name( Options::CONFIGURATION );
    251267        $restore_defaults_name = $this->options->get_name( Options::RESTORE_DEFAULTS );
     
    299315     * @return string
    300316     */
    301     protected function get_active_settings_tab() : string {
     317    protected function get_active_settings_tab(): string {
    302318        if ( empty( $this->active_tab ) ) {
    303319            // Check active tab.
     
    321337     * @return bool
    322338     */
    323     public function sanitize_restore_defaults( $input ) {
     339    public function sanitize_restore_defaults( $input ): bool {
    324340        return $this->trigger_admin_notice( Options::RESTORE_DEFAULTS, 'defaults-restored', \__( 'Settings reset to default values.', 'wp-typography' ), 'updated', $input );
    325341    }
     
    332348     * @return bool
    333349     */
    334     public function sanitize_clear_cache( $input ) : bool {
     350    public function sanitize_clear_cache( $input ): bool {
    335351        return $this->trigger_admin_notice( Options::CLEAR_CACHE, 'cache-cleared', \__( 'Cached post content cleared.', 'wp-typography' ), 'notice-info', $input );
    336352    }
     
    343359     * @return array<string,string|int|bool>         The sanitized plugin settings.
    344360     */
    345     public function sanitize_settings( $input ) : array {
     361    public function sanitize_settings( $input ): array {
    346362        $current_tab = $this->get_active_settings_tab();
    347363
     
    366382     * @return bool The $input parameter cast to a boolean value.
    367383     */
    368     protected function trigger_admin_notice( $setting_name, $notice_id, $message, $notice_level, $input ) : bool {
     384    protected function trigger_admin_notice( $setting_name, $notice_id, $message, $notice_level, $input ): bool {
    369385        if (
    370386             // phpcs:ignore WordPress.Security.NonceVerification.Missing -- we are only checking that the button was clicked.
     
    384400     * Add an options page for the plugin settings.
    385401     */
    386     public function add_options_page() : void {
     402    public function add_options_page(): void {
    387403        $page = \add_options_page( $this->plugin_name, $this->plugin_name, 'manage_options', \strtolower( $this->plugin_name ), [ $this, 'get_admin_page_content' ] );
    388404
     
    412428     * Add context-sensitive help to the settings page.
    413429     */
    414     public function add_context_help() : void {
     430    public function add_context_help(): void {
    415431        $screen = \get_current_screen();
    416432        if ( empty( $screen ) ) {
     
    446462     * @phpstan-param array{id : string, title? : string, callback? : callable} $section
    447463     */
    448     public function print_settings_section( array $section ) : void {
     464    public function print_settings_section( array $section ): void {
    449465        $section_id = ! empty( $section['id'] ) ? $section['id'] : '';
     466        $args       = [];
    450467
    451468        if ( ! empty( $this->admin_form_tabs[ $section_id ]['description'] ) ) {
    452             $description = $this->admin_form_tabs[ $section_id ]['description'];
     469            $args['description'] = $this->admin_form_tabs[ $section_id ]['description'];
    453470        } elseif ( ! empty( $this->admin_form_sections[ $section_id ]['description'] ) ) {
    454             $description = $this->admin_form_sections[ $section_id ]['description'];
     471            $args['description'] = $this->admin_form_sections[ $section_id ]['description'];
    455472        }
    456473
    457474        // Load the settings page HTML.
    458         require \WP_TYPOGRAPHY_PLUGIN_PATH . '/admin/partials/settings/section.php';
     475        $this->template->print_partial( '/admin/partials/settings/section.php', $args );
    459476    }
    460477
     
    462479     * Enqueue stylesheet for options page.
    463480     */
    464     public function print_admin_styles() : void {
     481    public function print_admin_styles(): void {
    465482        \wp_enqueue_style( 'wp-typography-settings', \plugins_url( 'admin/css/settings.css', $this->plugin_basename ), [], $this->api->get_version(), 'all' );
    466483    }
     
    473490     * @return string[]        An array of HTML link tags.
    474491     */
    475     public function plugin_action_links( array $links ) : array {
     492    public function plugin_action_links( array $links ): array {
    476493        $adminurl = \trailingslashit( \admin_url() );
    477494
     
    486503     * Display the plugin options page.
    487504     */
    488     public function get_admin_page_content() : void {
     505    public function get_admin_page_content(): void {
    489506        $this->load_language_options( $this->admin_form_controls[ Plugin_Configuration::HYPHENATE_LANGUAGES ], $this->api->get_hyphenation_languages() );
    490507        $this->load_language_options( $this->admin_form_controls[ Plugin_Configuration::DIACRITIC_LANGUAGES ], $this->api->get_diacritic_languages() );
    491508
     509        $active_tab = $this->get_active_settings_tab();
     510        $args       = [
     511            'plugin_name'             => $this->plugin_name,
     512            'active_tab'              => $active_tab,
     513            'option_group'            => self::OPTION_GROUP . $active_tab,
     514            'admin_form_tabs'         => $this->admin_form_tabs,
     515            'restore_defaults_button' => $this->options->get_name( Options::RESTORE_DEFAULTS ),
     516            'clear_cache_button'      => $this->options->get_name( Options::CLEAR_CACHE ),
     517        ];
     518
    492519        // Load the settings page HTML.
    493         require \WP_TYPOGRAPHY_PLUGIN_PATH . '/admin/partials/settings/settings-page.php';
     520        $this->template->print_partial( '/admin/partials/settings/settings-page.php', $args );
    494521    }
    495522
     
    498525     *
    499526     * @since 5.9.0
     527     * @since 5.10.0 Visibility changed to `protected`.
    500528     *
    501529     * @param Control              $control   The UI control (needs to be a Select element).
     
    504532     * @return bool                           Returns `true` on success.
    505533     */
    506     private function load_language_options( Control $control, array $languages ) : bool {
     534    protected function load_language_options( Control $control, array $languages ): bool {
    507535        if ( $control instanceof Select ) {
    508536            $control->set_option_values( $languages );
     
    519547     * @since 5.4.0
    520548     */
    521     public function maybe_add_privacy_notice_content() : void {
     549    public function maybe_add_privacy_notice_content(): void {
    522550        // Don't crash on older versions of WordPress.
    523551        if ( ! \function_exists( 'wp_add_privacy_policy_content' ) ) {
  • wp-typography/trunk/includes/wp-typography/components/class-block-editor.php

    r2848497 r3208262  
    33 * This file is part of wp-Typography.
    44 *
    5  * Copyright 2020-2022 Peter Putzer.
     5 * Copyright 2020-2024 Peter Putzer.
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    5858     * Set up the various hooks for the block editor.
    5959     */
    60     public function run() : void {
     60    public function run(): void {
    6161        if ( ! \function_exists( 'register_block_type' ) ) {
    6262            // Block editor not installed.
     
    6666        // Register and enqueue sidebar.
    6767        \add_action( 'init', [ $this, 'register_sidebar_and_blocks' ] );
     68        \add_action( 'enqueue_block_editor_assets', [ $this, 'enqueue_blocks' ] );
    6869        \add_action( 'enqueue_block_editor_assets', [ $this, 'enqueue_sidebar' ] );
    6970    }
    7071
    7172    /**
    72      * Registers the Gutenberg sidebar.
     73     * Registers the Gutenberg sidebar and blocks.
    7374     */
    74     public function register_sidebar_and_blocks() : void {
     75    public function register_sidebar_and_blocks(): void {
    7576        $suffix     = ( \defined( 'SCRIPT_DEBUG' ) && \SCRIPT_DEBUG ) ? '' : '.min';
    7677        $plugin_url = \plugins_url( '', \WP_TYPOGRAPHY_PLUGIN_FILE );
    7778
    7879        // Register the script containing all our block types (and the sidebar plugin).
    79         $blocks = 'admin/block-editor/js/index';
    80         $asset  = include \WP_TYPOGRAPHY_PLUGIN_PATH . "/{$blocks}.asset.php";
    81         \wp_register_script( 'wp-typography-gutenberg', "{$plugin_url}/{$blocks}.js", $asset['dependencies'], $asset['version'], false );
     80        $blocks        = 'admin/block-editor/js/blocks';
     81        $sidebar       = 'admin/block-editor/js/plugins';
     82        $blocks_asset  = include \WP_TYPOGRAPHY_PLUGIN_PATH . "/{$blocks}.asset.php"; // @phpstan-ignore include.fileNotFound
     83        $sidebar_asset = include \WP_TYPOGRAPHY_PLUGIN_PATH . "/{$sidebar}.asset.php"; // @phpstan-ignore include.fileNotFound
     84        \wp_register_script( 'wp-typography-gutenberg-blocks', "{$plugin_url}/{$blocks}.js", $blocks_asset['dependencies'], $blocks_asset['version'], false );
     85        \wp_register_script( 'wp-typography-gutenberg-sidebar', "{$plugin_url}/{$sidebar}.js", $sidebar_asset['dependencies'], $sidebar_asset['version'], false );
    8286        \wp_register_style( 'wp-typography-gutenberg-style', "{$plugin_url}/admin/css/blocks{$suffix}.css", [], $this->api->get_version() );
    8387
     
    8791            'wp-typography/typography',
    8892            [
    89                 'editor_script'   => 'wp-typography-gutenberg',
     93                'editor_script'   => 'wp-typography-gutenberg-blocks',
    9094                'editor_style'    => 'wp-typography-gutenberg-style',
    9195                'render_callback' => [ $this, 'render_typography_block' ],
     
    9599
    96100        // Enable i18n.
    97         \wp_set_script_translations( 'wp-typography-gutenberg', 'wp-typography' );
     101        \wp_set_script_translations( 'wp-typography-gutenberg-blocks', 'wp-typography' );
     102        \wp_set_script_translations( 'wp-typography-gutenberg-sidebar', 'wp-typography' );
    98103    }
    99104
     
    101106     * Enqueues the block editor sidebar script.
    102107     */
    103     public function enqueue_sidebar() : void {
    104         \wp_enqueue_script( 'wp-typography-gutenberg' );
     108    public function enqueue_sidebar(): void {
     109        global $pagenow;
     110
     111        // Return early when viewing the customizer or widgets screen.
     112        if ( \is_customize_preview() || 'widgets.php' === $pagenow ) {
     113            return;
     114        }
     115
     116        \wp_enqueue_script( 'wp-typography-gutenberg-sidebar' );
     117    }
     118
     119    /**
     120     * Enqueues the block editor blocks script.
     121     *
     122     * @since 5.10.0
     123     */
     124    public function enqueue_blocks(): void {
     125        \wp_enqueue_script( 'wp-typography-gutenberg-blocks' );
    105126    }
    106127
     
    113134     * @return string
    114135     */
    115     public function render_typography_block( array $attributes, $content ) : string {
     136    public function render_typography_block( array $attributes, $content ): string {
    116137        // Ensure that the inner blocks are processed.
    117138        \add_filter( 'typo_disable_processing_for_post', '__return_false', 999, 0 );
  • wp-typography/trunk/includes/wp-typography/components/class-common.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2017-2022 Peter Putzer.
     5 *  Copyright 2017-2024 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    3030use WP_Typography\Implementation;
    3131use WP_Typography\Integration\Container as Integrations;
    32 use WP_Typography\Settings\Plugin_Configuration as Config;
    3332
    3433/**
     
    4645     *
    4746     * @since 5.7.0 Renamed to $api.
     47     * @since 5.10.0 Type changed to \WP_Typography like other Plugin_Components.
    4848     *
    49      * @var Implementation
     49     * @var \WP_Typography
    5050     */
    51     private $api;
     51    private \WP_Typography $api;
    5252
    5353    /**
     
    5656     * @var Options
    5757     */
    58     private $options;
     58    private Options $options;
    5959
    6060    /**
     
    6363     * @var Integrations
    6464     */
    65     private $integrations;
     65    private Integrations $integrations;
    6666
    6767    /**
     
    8585     * @since 5.7.0 Parameter $plugin removed.
    8686     */
    87     public function run() : void {
     87    public function run(): void {
    8888        // Load settings.
    8989        \add_action( 'init', [ $this, 'init' ] );
     
    9797     * Restore default options or clear cache if requested.
    9898     */
    99     public function init() : void {
     99    public function init(): void {
    100100
    101101        // Restore defaults if necessary.
  • wp-typography/trunk/includes/wp-typography/components/class-multilingual-support.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2017-2022 Peter Putzer.
     5 *  Copyright 2017-2024 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    2828
    2929use WP_Typography\Implementation;
    30 use WP_Typography\Settings\Basic_Locale_Settings;
    3130use WP_Typography\Settings\Locale_Settings;
    3231use WP_Typography\Settings\Plugin_Configuration as Config;
     
    7372     * @var Locale_Settings[]
    7473     */
    75     protected $locales = [];
     74    protected array $locales = [];
    7675
    7776    /**
     
    8079     * @var string[]
    8180     */
    82     protected $hyphenation_languages;
     81    protected array $hyphenation_languages;
    8382
    8483    /**
     
    8786     * @var string[]
    8887     */
    89     protected $diacritic_languages;
     88    protected array $diacritic_languages;
    9089
    9190    /**
     
    9695     * @var \WP_Typography
    9796     */
    98     protected $api;
     97    protected \WP_Typography $api;
    9998
    10099    /**
     
    120119     * @since 5.7.0 Parameter $plugin removed.
    121120     */
    122     public function run() : void {
     121    public function run(): void {
    123122        // Enable multilingual support.
    124123        \add_action( 'plugins_loaded', [ $this, 'add_plugin_defaults_filter' ] );
     
    129128     * Adds a filter for the plugin defaults.
    130129     */
    131     public function add_plugin_defaults_filter() : void {
     130    public function add_plugin_defaults_filter(): void {
    132131        // Translation of language names is irrelevant here.
    133         $this->hyphenation_languages = $this->api->get_hyphenation_languages();
    134         $this->diacritic_languages   = $this->api->get_diacritic_languages();
     132        $this->hyphenation_languages = $this->api->get_hyphenation_languages( false );
     133        $this->diacritic_languages   = $this->api->get_diacritic_languages( false );
    135134
    136135        // Filter the defaults.
     
    141140     * Enable multilingual settings.
    142141     */
    143     public function enable_automatic_language_settings() : void {
     142    public function enable_automatic_language_settings(): void {
    144143        if ( $this->api->get_config()[ Config::ENABLE_MULTILINGUAL_SUPPORT ] ) {
    145144            \add_filter( 'typo_settings', [ $this, 'automatic_language_settings' ] );
     
    157156     *                         first operand is greater, 1 if the second one is greater.
    158157     */
    159     protected function locale_settings_sort( Locale_Settings $s1, Locale_Settings $s2 ) : int {
     158    protected function locale_settings_sort( Locale_Settings $s1, Locale_Settings $s2 ): int {
    160159        $prio1 = $s1->priority();
    161160        $prio2 = $s2->priority();
     
    178177     * @return Settings
    179178     */
    180     public function automatic_language_settings( Settings $settings ) : Settings {
     179    public function automatic_language_settings( Settings $settings ): Settings {
    181180
    182181        // Ensure that default settings stay unmodified.
     
    221220     * @return array<string,string|int|bool>
    222221     */
    223     public function filter_defaults( array $defaults ) : array {
     222    public function filter_defaults( array $defaults ): array {
    224223        [ 'language' => $language, 'country' => $country, 'modifier' => $modifier ] = $this->get_current_locale();
    225224
     
    255254     * @param  Locale_Settings|null $adjustment Locale-specific settings.
    256255     */
    257     protected function adjust_french_punctuation_spacing( Settings $settings, $locale, Locale_Settings $adjustment = null ) : void {
     256    protected function adjust_french_punctuation_spacing( Settings $settings, $locale, ?Locale_Settings $adjustment = null ): void {
    258257
    259258        if ( null === $adjustment ) {
     
    279278     * @param  Locale_Settings|null $adjustment Locale-specific settings.
    280279     */
    281     protected function adjust_dash_style( Settings $settings, $locale, Locale_Settings $adjustment = null ) : void {
     280    protected function adjust_dash_style( Settings $settings, $locale, ?Locale_Settings $adjustment = null ): void {
    282281
    283282        if ( null === $adjustment ) {
     
    307306     * @param  Locale_Settings|null $adjustment Locale-specific settings.
    308307     */
    309     protected function adjust_quote_styles( Settings $settings, $locale, Locale_Settings $adjustment = null ) : void {
     308    protected function adjust_quote_styles( Settings $settings, $locale, ?Locale_Settings $adjustment = null ): void {
    310309
    311310        if ( null === $adjustment ) {
     
    353352     * @return Locale_Settings|null
    354353     */
    355     protected function match_locale( $language, $country, $modifier = '' ) : ?Locale_Settings {
     354    protected function match_locale( $language, $country, $modifier = '' ): ?Locale_Settings {
    356355
    357356        foreach ( $this->locales as $locale_settings ) {
     
    380379     * @phpstan-return Locale
    381380     */
    382     protected function get_current_locale() : array {
     381    protected function get_current_locale(): array {
    383382        /**
    384383         * Filters the current locale for wp-Typography.
     
    429428     * @param  string               $type      Either "hyphenation" or "diacritic".
    430429     *
    431      * @return String                          An index in the languages array (or '' if not match was possible).
    432      */
    433     protected function match_language( array $languages, $locale, $language, $type ) : string {
     430     * @return string                          An index in the languages array (or '' if not match was possible).
     431     */
     432    protected function match_language( array $languages, $locale, $language, $type ): string {
    434433        /**
    435434         * Filters the matched language.
     
    462461        }
    463462
    464         // Try some heuristics..
    465         $matches     = \preg_grep( "/^{$language}-/", array_keys( $languages ) ) ?: []; // phpcs:ignore WordPress.PHP.DisallowShortTernary -- ensure array type.
     463        // Try some heuristics.
     464        return $this->match_language_using_heuristics( \array_keys( $languages ), $language, $locale );
     465    }
     466
     467    /**
     468     * Tries to heuristically match a language code, looking first for variants of the language
     469     * and then narrowing it down using the whole locale.
     470     *
     471     * @since  5.10.0
     472     *
     473     * @param string[] $language_codes An array of language/locale codes.
     474     * @param string   $language       The current two-letter language code (e.g. 'en').
     475     * @param string   $locale         The current locale, separated with a dash (e.g. 'en-US').
     476     *
     477     * @return string           A language code (or '' if not match was possible).
     478     */
     479    protected function match_language_using_heuristics( array $language_codes, string $language, string $locale ): string {
     480        $matches     = \preg_grep( "/^{$language}-/", $language_codes ) ?: []; // phpcs:ignore Universal.Operators.DisallowShortTernary -- ensure array type.
    466481        $match_count = \count( $matches );
    467482
    468483        if ( 1 === $match_count ) {
    469             $result = \array_pop( $matches );
     484            return \array_pop( $matches );
    470485        } elseif ( $match_count > 1 ) {
    471486            // Narrow the search further.
    472             $matches     = \preg_grep( "/^{$locale}/", $matches ) ?: []; // phpcs:ignore WordPress.PHP.DisallowShortTernary -- ensure array type.
     487            $matches     = \preg_grep( "/^{$locale}/", $matches ) ?: []; // phpcs:ignore Universal.Operators.DisallowShortTernary -- ensure array type.
    473488            $match_count = \count( $matches );
    474489
    475490            if ( 1 === $match_count ) {
    476                 $result = \array_pop( $matches );
     491                return \array_pop( $matches );
    477492            }
    478493        }
    479494
    480         return $result;
     495        return '';
    481496    }
    482497
     
    489504     * @return string
    490505     */
    491     protected static function normalize( $key, array $aliases ) : string {
     506    protected static function normalize( $key, array $aliases ): string {
    492507        return isset( $aliases[ $key ] ) ? $aliases[ $key ] : $key;
    493508    }
  • wp-typography/trunk/includes/wp-typography/components/class-plugin-component.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2017-2022 Peter Putzer.
     5 *  Copyright 2017-2023 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    4444     * @return void
    4545     */
    46     public function run() : void;
     46    public function run(): void;
    4747}
  • wp-typography/trunk/includes/wp-typography/components/class-public-interface.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2014-2022 Peter Putzer.
     5 *  Copyright 2014-2024 Peter Putzer.
    66 *  Copyright 2009-2011 KINGdesk, LLC.
    77 *
     
    2828namespace WP_Typography\Components;
    2929
    30 use WP_Typography\Data_Storage\Options;
    3130use WP_Typography\Implementation;
    32 use WP_Typography\UI;
    3331use WP_Typography\Settings\Plugin_Configuration as Config;
    34 
    35 use PHP_Typography\PHP_Typography;
    36 use PHP_Typography\Settings\Dash_Style;
    37 use PHP_Typography\Settings\Quote_Style;
    3832
    3933/**
     
    6357     * @var int
    6458     */
    65     private $filter_priority = 9999;
     59    private int $filter_priority = 9999;
    6660
    6761    /**
     
    112106     * @since 5.7.0 Parameter $plugin removed.
    113107     */
    114     public function run() : void {
     108    public function run(): void {
    115109        // Do not run our filters on the admin side or during a WP-CLI command.
    116110        if ( ! \is_admin() && ! \defined( 'WP_CLI' ) ) {
     
    122116     * Sets up filters and actions.
    123117     */
    124     public function init() : void {
     118    public function init(): void {
    125119        $this->config = $this->api->get_config();
    126120
     
    157151     * Adds content filter handlers.
    158152     */
    159     public function add_content_filters() : void {
     153    public function add_content_filters(): void {
    160154
    161155        // Define the default filters.
     
    211205     * @param int $priority Filter priority.
    212206     */
    213     private function enable_content_filters( $priority ) : void {
     207    private function enable_content_filters( $priority ): void {
    214208        \add_filter( 'comment_author',    [ $this->api, 'process' ], $priority );
    215209        \add_filter( 'comment_text',      [ $this->api, 'process' ], $priority );
     
    238232     * @param int $priority Filter priority.
    239233     */
    240     private function enable_heading_filters( $priority ) : void {
     234    private function enable_heading_filters( $priority ): void {
    241235        \add_filter( 'the_title',    [ $this->api, 'process_title' ], $priority );
    242236        \add_filter( 'widget_title', [ $this->api, 'process_title' ], $priority );
     
    248242     * @since 5.5.3
    249243     */
    250     public function enqueue_styles() : void {
     244    public function enqueue_styles(): void {
    251245        // Custom styles set via the CSS Hooks settings page.
    252         $custom_styles = \trim( (string) $this->config[ Config::STYLE_CSS ] );
    253         if ( ! empty( $custom_styles ) ) {
    254             // Register and enqueue dummy stylesheet.
    255             \wp_register_style( 'wp-typography-custom', '' ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion -- only inline.
    256             \wp_enqueue_style( 'wp-typography-custom' );
    257 
    258             // Print the inline styles.
    259             \wp_add_inline_style( 'wp-typography-custom', $this->clean_styles( $custom_styles ) );
     246        if ( $this->config[ Config::STYLE_CSS_INCLUDE ] ) {
     247            $custom_styles = \trim( (string) $this->config[ Config::STYLE_CSS ] );
     248            if ( ! empty( $custom_styles ) ) {
     249                // Register and enqueue dummy stylesheet.
     250                \wp_register_style( 'wp-typography-custom', '' ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion -- only inline.
     251                \wp_enqueue_style( 'wp-typography-custom' );
     252
     253                // Print the inline styles.
     254                \wp_add_inline_style( 'wp-typography-custom', $this->clean_styles( $custom_styles ) );
     255            }
    260256        }
    261257
     
    274270     * Enqueues frontend JavaScript files.
    275271     */
    276     public function enqueue_scripts() : void {
     272    public function enqueue_scripts(): void {
    277273        if ( $this->config[ Config::HYPHENATE_CLEAN_CLIPBOARD ] ) {
    278274            // Set up file suffix and plugin version.
     
    295291     * @return string      Filtered string of CSS styles.
    296292     */
    297     protected function clean_styles( $css ) : string {
     293    protected function clean_styles( $css ): string {
    298294        $cleaned = (string) \preg_replace( self::CLEAN_CSS_PATTERNS, self::CLEAN_CSS_REPLACEMENTS, $css );
    299295        $css     = '';
  • wp-typography/trunk/includes/wp-typography/components/class-rest-api.php

    r2848497 r3208262  
    33 * This file is part of wp-Typography.
    44 *
    5  * Copyright 2020-2022 Peter Putzer.
     5 * Copyright 2020-2023 Peter Putzer.
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    4747     * Set up the various hooks for the REST API.
    4848     */
    49     public function run() : void {
     49    public function run(): void {
    5050        // Register and enqueue sidebar.
    5151        \add_action( 'init', [ $this, 'register_meta_fields' ] );
     
    5555     * Registers necessary meta fields the the REST API.
    5656     */
    57     public function register_meta_fields() : void {
     57    public function register_meta_fields(): void {
    5858        \register_post_meta(
    5959            '', // Enable field for all post types.
  • wp-typography/trunk/includes/wp-typography/components/class-setup.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2014-2022 Peter Putzer.
     5 *  Copyright 2014-2024 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    2929use WP_Typography\Implementation;
    3030use WP_Typography\Data_Storage\Options;
    31 use WP_Typography\Settings\Plugin_Configuration as Config;
    3231
    3332/**
     
    6665     * @var \WP_Typography
    6766     */
    68     private $api;
     67    private \WP_Typography $api;
    6968
    7069    /**
     
    7574     * @var Options
    7675     */
    77     private $options;
     76    private Options $options;
    7877
    7978    /**
     
    9695     * @since 5.7.0 Parameter $plugin removed.
    9796     */
    98     public function run() : void {
     97    public function run(): void {
    9998        // Register various hooks.
    10099        \register_activation_hook( \WP_TYPOGRAPHY_PLUGIN_FILE,   [ $this,     'activate' ] );
     
    111110     * @since 3.1.0
    112111     */
    113     public function activate() : void {
     112    public function activate(): void {
    114113        // Load default values for any new options.
    115114        $this->api->get_config();
     
    124123     * @since 5.1.0
    125124     */
    126     public function plugin_update_check() : void {
     125    public function plugin_update_check(): void {
    127126        // We can ignore errors here, just carry on as if for a new installation.
    128127        $installed_version = (string) $this->options->get( Options::INSTALLED_VERSION, '' );
     
    138137     * @param string $previous_version The version we are upgrading from.
    139138     */
    140     protected function plugin_updated( $previous_version ) : void {
     139    protected function plugin_updated( $previous_version ): void {
    141140        // Upgrade from version 3.0.0 or lower.
    142141        if ( \version_compare( $previous_version, '3.1.0-beta.2', '<' ) ) {
     
    170169     * @since 5.1.0
    171170     */
    172     protected function upgrade_options_3_1() : void {
     171    protected function upgrade_options_3_1(): void {
    173172        foreach ( $this->api->get_default_options() as $option_name => $option ) {
    174173            $old_option = $this->get_old_option_name( self::LEGACY_OPTIONS_PREFIX . "_{$option_name}" );
     
    188187     * @since 5.1.0
    189188     */
    190     protected function upgrade_options_3_2() : void {
     189    protected function upgrade_options_3_2(): void {
    191190        $this->options->delete( 'typo_disable_caching', true );
    192191    }
     
    197196     * @since 5.1.0
    198197     */
    199     protected function upgrade_options_3_3() : void {
     198    protected function upgrade_options_3_3(): void {
    200199        $this->options->delete( 'typo_remove_ie6', true );
    201200    }
     
    206205     * @since 5.1.0
    207206     */
    208     protected function upgrade_options_3_5() : void {
     207    protected function upgrade_options_3_5(): void {
    209208        $this->options->delete( 'typo_enable_caching', true );
    210209        $this->options->delete( 'typo_caching_limit', true );
     
    216215     * @since 5.1.0
    217216     */
    218     protected function upgrade_options_5_1() : void {
     217    protected function upgrade_options_5_1(): void {
    219218        $this->options->delete( 'typo_transient_keys', true );
    220219        $this->options->delete( 'typo_cache_keys', true );
     
    228227     * @since 5.1.0
    229228     */
    230     protected function upgrade_options_to_array() : void {
     229    protected function upgrade_options_to_array(): void {
    231230        $config = $this->api->get_default_options();
    232231
     
    249248     * @since 5.1.0
    250249     */
    251     protected function set_installed_version() : void {
     250    protected function set_installed_version(): void {
    252251        $this->options->set( Options::INSTALLED_VERSION, $this->api->get_version() );
    253252    }
     
    261260     * @return string        An old-style option name, e.g. 'MyOldOption'.
    262261     */
    263     protected function get_old_option_name( $option ) : string {
     262    protected function get_old_option_name( $option ): string {
    264263        $parts   = \explode( '_', $option );
    265264        $oldname = \array_shift( $parts );
     
    289288     * @since 3.1.0
    290289     */
    291     public function deactivate() : void {
     290    public function deactivate(): void {
    292291    }
    293292
     
    297296     * @since 3.1.0
    298297     */
    299     public static function uninstall() : void {
     298    public static function uninstall(): void {
    300299
    301300        // Delete all our transients.
  • wp-typography/trunk/includes/wp-typography/data-storage/class-transients.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2017-2022 Peter Putzer.
     5 *  Copyright 2017-2024 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    4949     * Cache the given object under the transient name.
    5050     *
    51      * @param  string $transient Required.
    52      * @param  mixed  $object    Required.
    53      * @param  string $handle    Optional. A name passed to the filters.
     51     * @since  5.10.0 Parameter `$object` renamed to `$large_object` to prevent
     52     *                conflict with reserved keywords.
     53     *
     54     * @param  string $transient    The transient key.
     55     * @param  mixed  $large_object The object to store.
     56     * @param  string $handle       Optional. A name passed to the filters.
    5457     */
    55     public function cache_object( $transient, $object, $handle = '' ) : void {
     58    public function cache_object( $transient, $large_object, $handle = '' ): void {
    5659        /**
    5760         * Filters whether the PHP_Typography engine state should be cached.
     
    7578            $duration = \apply_filters( 'typo_php_typography_caching_duration', 0, $handle );
    7679
    77             $this->set_large_object( $transient, $object, $duration );
     80            $this->set_large_object( $transient, $large_object, $duration );
    7881        }
    7982    }
  • wp-typography/trunk/includes/wp-typography/integration/class-acf-integration.php

    r2852622 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2017-2023 Peter Putzer.
     5 *  Copyright 2017-2024 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    8484     * @var \WP_Typography
    8585     */
    86     private $api;
     86    private \WP_Typography $api;
    8787
    8888    /**
     
    9191     * @var int
    9292     */
    93     private $api_version;
     93    private int $api_version;
    9494
    9595    /**
     
    109109     * @return bool
    110110     */
    111     public function check() : bool {
     111    public function check(): bool {
    112112        return \class_exists( 'acf' );
    113113    }
     
    118118     * @since 5.7.0 Parameter $plugin removed.
    119119     */
    120     public function run() : void {
     120    public function run(): void {
    121121        $this->api_version = $this->get_acf_version();
    122122
     
    131131     * @return string
    132132     */
    133     public function get_filter_tag() : string {
     133    public function get_filter_tag(): string {
    134134        return 'acf';
    135135    }
     
    138138     * Initializes the "Typography" field setting for all available field types.
    139139     */
    140     public function initialize_field_settings() : void {
     140    public function initialize_field_settings(): void {
    141141        /**
    142142         * Retrieve the used field types.
     
    156156     * @param int $priority The filter priority.
    157157     */
    158     public function enable_content_filters( $priority ) : void {
     158    public function enable_content_filters( int $priority ): void {
    159159        if ( $this->api_version >= 5 ) {
    160160            // Advanced Custom Fields (version 5 and above).
     
    173173     * @param mixed[] $field The field settings.
    174174     */
    175     public function add_field_setting( array $field ) : void {
     175    public function add_field_setting( array $field ): void {
    176176        $default = self::DO_NOT_FILTER;
    177177
     
    220220     * @return int
    221221     */
    222     protected function get_acf_version() : int {
     222    protected function get_acf_version(): int {
    223223        // We assume version 4 by default.
    224224        $acf_version = 4;
     
    249249            $supported_subfields = self::SUPPORTED_ARRAY_TYPES[ $field['type'] ] ?? [];
    250250
    251             if ( ! \is_array( $supported_subfields ) && '*' === $supported_subfields ) {
     251            if ( ! \is_array( $supported_subfields ) && '*' === $supported_subfields ) { // @phpstan-ignore identical.alwaysTrue
    252252                $supported_subfields = \array_keys( $content );
    253253            }
     
    277277     * @return string
    278278     */
    279     protected function process_acf_content( string $content, array $field ) : string {
     279    protected function process_acf_content( string $content, array $field ): string {
    280280
    281281        switch ( isset( $field[ self::FILTER_SETTING ] ) ? $field[ self::FILTER_SETTING ] : '' ) {
  • wp-typography/trunk/includes/wp-typography/integration/class-container.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2018-2022 Peter Putzer.
     5 *  Copyright 2018-2023 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    6464     * Activate all applicable plugin integrations.
    6565     */
    66     public function activate() : void {
     66    public function activate(): void {
    6767        foreach ( $this->integrations as $integration ) {
    6868            if ( $integration->check() ) {
     
    8383     * @return array<string,callable>
    8484     */
    85     public function get_content_filters( array $filters ) : array {
     85    public function get_content_filters( array $filters ): array {
    8686        foreach ( $this->active_integrations as $integration ) {
    8787            $filters[ $integration->get_filter_tag() ] = [ $integration, 'enable_content_filters' ];
  • wp-typography/trunk/includes/wp-typography/integration/class-plugin-integration.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2018-2022 Peter Putzer.
     5 *  Copyright 2018-2024 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    4242     * @return bool
    4343     */
    44     public function check() : bool;
     44    public function check(): bool;
    4545
    4646    /**
     
    4949     * @since 5.7.0 Parameter $plugin removed.
    5050     */
    51     public function run() : void;
     51    public function run(): void;
    5252
    5353    /**
     
    5656     * @return string
    5757     */
    58     public function get_filter_tag() : string;
     58    public function get_filter_tag(): string;
    5959
    6060    /**
     
    6363     * @param int $priority The filter priority.
    6464     */
    65     public function enable_content_filters( $priority ) : void;
     65    public function enable_content_filters( int $priority ): void;
    6666}
  • wp-typography/trunk/includes/wp-typography/integration/class-woocommerce-integration.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2017-2022 Peter Putzer.
     5 *  Copyright 2017-2024 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    4646     * @var \WP_Typography
    4747     */
    48     private $api;
     48    private \WP_Typography $api;
    4949
    5050    /**
     
    6464     * @return bool
    6565     */
    66     public function check() : bool {
     66    public function check(): bool {
    6767        return \class_exists( 'WooCommerce' );
    6868    }
     
    7373     * @since 5.7.0 Parameter $plugin removed.
    7474     */
    75     public function run() : void {
     75    public function run(): void {
    7676        // Nothing to do.
    7777    }
     
    8282     * @return string
    8383     */
    84     public function get_filter_tag() : string {
     84    public function get_filter_tag(): string {
    8585        return 'woocommerce';
    8686    }
     
    9191     * @param int $priority The filter priority.
    9292     */
    93     public function enable_content_filters( $priority ) : void {
     93    public function enable_content_filters( int $priority ): void {
    9494
    9595        // Page descriptions.
  • wp-typography/trunk/includes/wp-typography/settings/class-abstract-locale-settings.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2017-2022 Peter Putzer.
     5 *  Copyright 2017-2024 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    2828
    2929use WP_Typography\Settings\Plugin_Configuration as Config;
    30 
    31 use PHP_Typography\Settings;
    3230
    3331/**
     
    8482     * @param bool   $french_punctuation True if French punctuation spacing should be enabled.
    8583     */
    86     protected function __construct( $priority, $dash, $primary_quote, $secondary_quote, $french_punctuation ) {
     84    protected function __construct( int $priority, string $dash, string $primary_quote, string $secondary_quote, bool $french_punctuation ) {
    8785        $this->priority              = $priority;
    8886        $this->dash_style            = $dash;
     
    10199     * @return bool             True if the default is applicable to this locale, false otherwise.
    102100     */
    103     abstract public function match( $language, $country, $modifier = '' ) : bool;
     101    abstract public function match( string $language, string $country, string $modifier = '' ): bool;
    104102
    105103    /**
     
    108106     * @return int
    109107     */
    110     public function priority() : int {
     108    public function priority(): int {
    111109        return $this->priority;
    112110    }
     
    119117     * @return array<string,string|int|bool>
    120118     */
    121     public function adjust_defaults( array $defaults ) : array {
     119    public function adjust_defaults( array $defaults ): array {
    122120        $defaults[ Config::SMART_DASHES_STYLE ]         = $this->dash_style;
    123121        $defaults[ Config::SMART_QUOTES_PRIMARY ]       = $this->primary_quote_style;
     
    133131     * @return string A Quote_Style constant.
    134132     */
    135     public function primary_quote_style() : string {
     133    public function primary_quote_style(): string {
    136134        return $this->primary_quote_style;
    137135    }
     
    142140     * @return string A Quote_Style constant.
    143141     */
    144     public function secondary_quote_style() : string {
     142    public function secondary_quote_style(): string {
    145143        return $this->secondary_quote_style;
    146144    }
     
    151149     * @return string A Dash_Style constant.
    152150     */
    153     public function dash_style() : string {
     151    public function dash_style(): string {
    154152        return $this->dash_style;
    155153    }
     
    160158     * @return bool
    161159     */
    162     public function use_french_punctuation_spacing() : bool {
     160    public function use_french_punctuation_spacing(): bool {
    163161        return $this->french_punctuation;
    164162    }
  • wp-typography/trunk/includes/wp-typography/settings/class-basic-locale-settings.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2017-2022 Peter Putzer.
     5 *  Copyright 2017-2024 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    2626
    2727namespace WP_Typography\Settings;
    28 
    29 use PHP_Typography\Settings;
    3028
    3129/**
     
    7573     * @param bool     $french_punctuation True if French punctuation spacing should be enabled.
    7674     */
    77     public function __construct( array $languages, array $countries, array $modifiers, $dash, $primary_quote, $secondary_quote, $french_punctuation ) {
     75    public function __construct( array $languages, array $countries, array $modifiers, string $dash, string $primary_quote, string $secondary_quote, bool $french_punctuation ) {
    7876        parent::__construct(
    7977            self::LANGUAGE_PRIORITY * \count( $languages ) + self::COUNTRY_PRIORITY * \count( $countries ) + self::MODIFIER_PRIORITY * \count( $modifiers ),
     
    9896     * @return bool             True if the default is applicable to this locale, false otherwise.
    9997     */
    100     public function match( $language, $country, $modifier = '' ) : bool {
     98    public function match( string $language, string $country, string $modifier = '' ): bool {
    10199        return ( empty( $this->valid_languages ) || isset( $this->valid_languages[ $language ] ) )
    102100            && ( empty( $this->valid_countries ) || isset( $this->valid_countries[ $country ] ) )
  • wp-typography/trunk/includes/wp-typography/settings/class-locale-settings.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2017-2022 Peter Putzer.
     5 *  Copyright 2017-2024 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    4646     * @return bool             True if the default is applicable to this locale, false otherwise.
    4747     */
    48     public function match( $language, $country, $modifier = '' ) : bool;
     48    public function match( string $language, string $country, string $modifier = '' ): bool;
    4949
    5050    /**
     
    5353     * @return int
    5454     */
    55     public function priority() : int;
     55    public function priority(): int;
    5656
    5757    /**
     
    6262     * @return array<string,string|int|bool>
    6363     */
    64     public function adjust_defaults( array $defaults ) : array;
     64    public function adjust_defaults( array $defaults ): array;
    6565
    6666    /**
     
    6969     * @return string A Quote_Style constant.
    7070     */
    71     public function primary_quote_style() : string;
     71    public function primary_quote_style(): string;
    7272
    7373    /**
     
    7676     * @return string A Quote_Style constant.
    7777     */
    78     public function secondary_quote_style() : string;
     78    public function secondary_quote_style(): string;
    7979
    8080    /**
     
    8383     * @return string A Dash_Style constant.
    8484     */
    85     public function dash_style() : string;
     85    public function dash_style(): string;
    8686
    8787    /**
     
    9090     * @return bool
    9191     */
    92     public function use_french_punctuation_spacing() : bool;
     92    public function use_french_punctuation_spacing(): bool;
    9393}
  • wp-typography/trunk/includes/wp-typography/settings/class-plugin-configuration.php

    r2852338 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2017-2023 Peter Putzer.
     5 *  Copyright 2017-2024 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    2727namespace WP_Typography\Settings;
    2828
    29 use WP_Typography;
    3029use WP_Typography\UI\Sections;
    3130use WP_Typography\UI\Tabs;
     
    133132     * @return array<string,Config>
    134133     */
    135     public static function get_defaults() : array {
     134    public static function get_defaults(): array {
    136135        if ( empty( self::$defaults ) ) {
    137136            self::$defaults = [ // @codeCoverageIgnore
     
    689688     * @return array<int,int>
    690689     */
    691     private static function get_numeric_option_values( array $values ) : array {
     690    private static function get_numeric_option_values( array $values ): array {
    692691        return \array_combine( $values, $values );
    693692    }
     
    698697     * @return array<string,string>
    699698     */
    700     private static function get_quote_style_option_values() : array {
     699    private static function get_quote_style_option_values(): array {
    701700        return [
    702701            Quote_Style::DOUBLE_CURLED              => '&ldquo;foo&rdquo;',
  • wp-typography/trunk/includes/wp-typography/settings/class-tools.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2019-2022 Peter Putzer.
     5 *  Copyright 2019-2024 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    4646     * quotes (prime marks) are treated as apostrophes.
    4747     *
    48      * @param  string $string A string formatted `word1, word2, ...`.
     48     * @since  5.10.0 Parameter `$strings` renamed to `$exceptions` to prevent
     49     *                conflicts with reserved keywords.
    4950     *
    50      * @return string[]       An array of replacements, indexed by the key.
     51     * @param  string $exceptions A string formatted `word1, word2, ...`.
     52     *
     53     * @return string[]           An array of replacements, indexed by the key.
    5154     */
    52     public static function parse_smart_quote_exceptions_string( $string ) : array {
     55    public static function parse_smart_quote_exceptions_string( string $exceptions ): array {
    5356        return \array_reduce(
    54             \preg_split( '/,/', $string, -1, \PREG_SPLIT_NO_EMPTY ) ?: [], // phpcs:ignore WordPress.PHP.DisallowShortTernary -- ensure array type.
    55             function( $result, $replacement ) {
     57            \preg_split( '/,/', $exceptions, -1, \PREG_SPLIT_NO_EMPTY ) ?: [], // phpcs:ignore Universal.Operators.DisallowShortTernary -- ensure array type.
     58            function ( $result, $replacement ) {
    5659                $key         = \trim( \strip_tags( $replacement ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.strip_tags_strip_tags -- no need for WordPress' version here.
    5760                $replacement = \str_replace( "'", U::APOSTROPHE, $key );
     
    7578     * @deprecated 5.8.0
    7679     *
     80     * @since 5.9.0 Parameter `$array` renamed to `$arr` to prevent conflict with reserved keywords.
     81     *
    7782     * @template T
    7883     *
    7984     * @param  callable $callback A callback function that needs to return [ $key => $value ] pairs.
    80      * @param  array<T> $array    The array.
     85     * @param  array<T> $arr      The array.
    8186     *
    8287     * @return array<T>
    8388     */
    84     public static function array_map_assoc( callable $callback, array $array ) : array {
     89    public static function array_map_assoc( callable $callback, array $arr ): array {
    8590        \_deprecated_function( __FUNCTION__, '5.8.0' );
    8691
    8792        $new = [];
    8893
    89         foreach ( $array as $k => $v ) {
     94        foreach ( $arr as $k => $v ) {
    9095            $u = $callback( $k, $v );
    9196
  • wp-typography/trunk/includes/wp-typography/typography/class-custom-node-fix.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2018-2022 Peter Putzer.
     5 *  Copyright 2018-2024 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    4545     * @var string
    4646     */
    47     private $group;
     47    private string $group;
    4848
    4949    /**
     
    6868     * @return void
    6969     */
    70     public function apply( \DOMText $textnode, Settings $settings, $is_title = false ) : void {
     70    public function apply( \DOMText $textnode, Settings $settings, $is_title = false ): void {
    7171        /**
    7272         * Filters the text node content for the given group.
  • wp-typography/trunk/includes/wp-typography/typography/class-custom-registry.php

    r1938183 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2018 Peter Putzer.
     5 *  Copyright 2018-2024 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    2828
    2929use PHP_Typography\Fixes\Default_Registry;
    30 use PHP_Typography\Hyphenator\Cache;
    3130
    3231/**
  • wp-typography/trunk/includes/wp-typography/typography/class-custom-token-fix.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2018-2022 Peter Putzer.
     5 *  Copyright 2018-2024 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    2828
    2929use PHP_Typography\Settings;
    30 
    3130use PHP_Typography\Text_Parser\Token;
    32 
    3331use PHP_Typography\Fixes\Token_Fixes\Abstract_Token_Fix;
    3432
     
    5755     * @throws \InvalidArgumentException The exception is thrown if `$type` is any other string.
    5856     */
    59     public function __construct( $type ) {
     57    public function __construct( string $type ) {
    6058        $valid_types = [
    6159            'mixed_words'    => self::MIXED_WORDS,
     
    6664
    6765        if ( ! isset( $valid_types[ $type ] ) ) {
    68             throw new \InvalidArgumentException( "$type is not a valid word type." );
     66            throw new \InvalidArgumentException( \esc_html( $type ) . ' is not a valid word type.' );
    6967        }
    7068
     
    8583     * @return Token[] An array of tokens.
    8684     */
    87     public function apply( array $tokens, Settings $settings, $is_title = false, \DOMText $textnode = null ) : array {
     85    public function apply( array $tokens, Settings $settings, $is_title = false, ?\DOMText $textnode = null ): array {
    8886
    8987        /**
  • wp-typography/trunk/includes/wp-typography/ui/class-sections.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2017-2022 Peter Putzer.
     5 *  Copyright 2017-2023 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    7070     * @phpstan-return Section[]
    7171     */
    72     public static function get_sections() : array {
     72    public static function get_sections(): array {
    7373        if ( empty( self::$sections ) ) {
    7474            self::$sections = [ // @codeCoverageIgnore
  • wp-typography/trunk/includes/wp-typography/ui/class-tabs.php

    r2848497 r3208262  
    33 *  This file is part of wp-Typography.
    44 *
    5  *  Copyright 2017-2022 Peter Putzer.
     5 *  Copyright 2017-2023 Peter Putzer.
    66 *
    77 *  This program is free software; you can redistribute it and/or
     
    7070     * @phpstan-return Tab[]
    7171     */
    72     public static function get_tabs() : array {
     72    public static function get_tabs(): array {
    7373        if ( empty( self::$tabs ) ) {
    7474            self::$tabs = [ // @codeCoverageIgnore
  • wp-typography/trunk/js/clean-clipboard.js

    r2819294 r3208262  
    22 * This file is part of wp-Typography.
    33 *
    4  * Copyright 2016-2021 Peter Putzer.
     4 * Copyright 2016-2024 Peter Putzer.
    55 *
    66 * This program is free software; you can redistribute it and/or
  • wp-typography/trunk/js/clean-clipboard.min.js

    r2852645 r3208262  
    1 /*! wp-typography clean-clipboard.js 2023-01-22 10:23:33 PM */
    2 !function(){"use strict";window.getSelection&&document.addEventListener("copy",function(){var n=window.getSelection();if(!n.isCollapsed){for(var t=n.rangeCount,o=[],e=0;e<t;e++)o[e]=n.getRangeAt(e);var i=document.createElement("div");i.appendChild(n.getRangeAt(0).cloneContents()),i.style.position="absolute",i.style.left="-99999px",i.innerHTML=i.innerHTML.replace(/\u00AD/gi,"").replace(/\u200B/gi,""),document.body.appendChild(i),n.selectAllChildren(i),window.setTimeout(function(){i.remove(),n.removeAllRanges();for(var e=0;e<t;e++)n.addRange(o[e])},0)}})}();
     1/*! wp-typography clean-clipboard.js 2024-12-15 9:19:59 PM */
     2window.getSelection&&document.addEventListener("copy",function(){var n=window.getSelection();if(!n.isCollapsed){for(var t=n.rangeCount,o=[],e=0;e<t;e++)o[e]=n.getRangeAt(e);var i=document.createElement("div");i.appendChild(n.getRangeAt(0).cloneContents()),i.style.position="absolute",i.style.left="-99999px",i.innerHTML=i.innerHTML.replace(/\u00AD/gi,"").replace(/\u200B/gi,""),document.body.appendChild(i),n.selectAllChildren(i),window.setTimeout(function(){i.remove(),n.removeAllRanges();for(var e=0;e<t;e++)n.addRange(o[e])},0)}});
  • wp-typography/trunk/js/src/clean-clipboard.js

    r2664026 r3208262  
    22 * This file is part of wp-Typography.
    33 *
    4  * Copyright 2016-2021 Peter Putzer.
     4 * Copyright 2016-2024 Peter Putzer.
    55 *
    66 * This program is free software; you can redistribute it and/or
     
    3232 * @author Peter Putzer <github@mundschenk.at>
    3333 */
    34 (function () {
     34( function() {
    3535    'use strict';
    3636
    37     if (window.getSelection) {
    38         document.addEventListener('copy', function () {
     37    if ( window.getSelection ) {
     38        document.addEventListener( 'copy', function() {
    3939            // Make sure we have an un-collapsed selection.
    4040            const sel = window.getSelection();
    41             if (sel.isCollapsed) {
     41            if ( sel.isCollapsed ) {
    4242                // This is probably a form field selection, no way to access it.
    4343                return;
     
    5050
    5151            // Save Range objects for later.
    52             for (let i = 0; i < rangeCount; i++) {
    53                 ranges[i] = sel.getRangeAt(i);
     52            for ( let i = 0; i < rangeCount; i++ ) {
     53                ranges[ i ] = sel.getRangeAt( i );
    5454            }
    5555
    5656            // Create new <div> containing cleaned HTML content.
    57             const shadow = document.createElement('div');
    58             shadow.appendChild(sel.getRangeAt(0).cloneContents());
     57            const shadow = document.createElement( 'div' );
     58            shadow.appendChild( sel.getRangeAt( 0 ).cloneContents() );
    5959            shadow.style.position = 'absolute';
    6060            shadow.style.left = '-99999px';
    6161            shadow.innerHTML = shadow.innerHTML
    6262                // Remove soft hyphens.
    63                 .replace(/\u00AD/gi, '')
     63                .replace( /\u00AD/gi, '' )
    6464                // Also remove zero-width spaces.
    65                 .replace(/\u200B/gi, '');
     65                .replace( /\u200B/gi, '' );
    6666
    6767            // Append to DOM and select the children of the "clean" <div>.
    68             document.body.appendChild(shadow);
    69             sel.selectAllChildren(shadow);
     68            document.body.appendChild( shadow );
     69            sel.selectAllChildren( shadow );
    7070
    7171            // Clean up after copying.
    72             window.setTimeout(function () {
     72            window.setTimeout( function() {
    7373                // Remove <div>.
    7474                shadow.remove();
     
    7676                // Restore real selection.
    7777                sel.removeAllRanges();
    78                 for (let i = 0; i < rangeCount; i++) {
    79                     sel.addRange(ranges[i]);
     78                for ( let i = 0; i < rangeCount; i++ ) {
     79                    sel.addRange( ranges[ i ] );
    8080                }
    81             }, 0);
    82         });
     81            }, 0 );
     82        } );
    8383    }
    84 })();
     84}() );
  • wp-typography/trunk/readme.txt

    r2852644 r3208262  
    22Contributors: pputzer, kingjeffrey
    33Tags: typography, hyphenation, smart quotes, formatting, widows, orphans, typogrify, quotes, prettify, small caps, diacritics
    4 Tested up to: 6.1
    5 Stable tag: 5.9.1
     4Tested up to: 6.7
     5Stable tag: 5.10.0
    66
    77Improve your web typography with: hyphenation, space control, intelligent character replacement, and CSS hooks.
     
    7878== Changelog ==
    7979
     80## 5.10.0 - December 15, 2024
     81* _Bugfix_: Default styles were always loaded, even when `Include styling for CSS hooks` was unchecked.
     82* _Bugfix_: No more `Function _load_textdomain_just_in_time was called incorrectly.` (present since WordPress 6.7).
     83* _Bugfix_: Block Editor blocks and the sidebar extension have been split into separate assets to prevent issues with the widget editor (and customizer preview).
     84* _Bugfix_: Passing a `null` value to `WP_Typography::process` will no longer result in a `TypeError` when processing has been disabled for the post.
     85* _Change_: WordPress minimum version increased to 6.6.
     86
    8087= 5.9.1 - January 22, 2023 =
    8188* _Bugfix_: Only apply filters to ACF fields returning strings to preserve type expectations for downstream code.
     
    9198= 5.8.1 - January 25, 2022 =
    9299* _Bugfix_: Whitescreen in `Requirements` class due to error in build process fixed.
    93 
    94 = 5.8.0 - January 25, 2022 =
    95 * _Feature_: wp-Typography is now compatible with PHP 8.0.
    96 * _Change_: WordPress minimum version increased to 5.3.
    97 * _Change_: PHP minimum version increased to 7.2.
    98 * _Change_: Support for Internet Explorer 11 has been dropped.
    99 * _Change_: A fabulous new plugin icon designed by [Johanna Amann](https://www.instagram.com/_jo_am/).
  • wp-typography/trunk/vendor-scoped/composer/ClassLoader.php

    r2848497 r3208262  
    4646    private static $includeFile;
    4747
    48     /** @var ?string */
     48    /** @var string|null */
    4949    private $vendorDir;
    5050
    5151    // PSR-4
    5252    /**
    53      * @var array[]
    54      * @psalm-var array<string, array<string, int>>
     53     * @var array<string, array<string, int>>
    5554     */
    5655    private $prefixLengthsPsr4 = array();
    5756    /**
    58      * @var array[]
    59      * @psalm-var array<string, array<int, string>>
     57     * @var array<string, list<string>>
    6058     */
    6159    private $prefixDirsPsr4 = array();
    6260    /**
    63      * @var array[]
    64      * @psalm-var array<string, string>
     61     * @var list<string>
    6562     */
    6663    private $fallbackDirsPsr4 = array();
     
    6865    // PSR-0
    6966    /**
    70      * @var array[]
    71      * @psalm-var array<string, array<string, string[]>>
     67     * List of PSR-0 prefixes
     68     *
     69     * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
     70     *
     71     * @var array<string, array<string, list<string>>>
    7272     */
    7373    private $prefixesPsr0 = array();
    7474    /**
    75      * @var array[]
    76      * @psalm-var array<string, string>
     75     * @var list<string>
    7776     */
    7877    private $fallbackDirsPsr0 = array();
     
    8281
    8382    /**
    84      * @var string[]
    85      * @psalm-var array<string, string>
     83     * @var array<string, string>
    8684     */
    8785    private $classMap = array();
     
    9189
    9290    /**
    93      * @var bool[]
    94      * @psalm-var array<string, bool>
     91     * @var array<string, bool>
    9592     */
    9693    private $missingClasses = array();
    9794
    98     /** @var ?string */
     95    /** @var string|null */
    9996    private $apcuPrefix;
    10097
    10198    /**
    102      * @var self[]
     99     * @var array<string, self>
    103100     */
    104101    private static $registeredLoaders = array();
    105102
    106103    /**
    107      * @param ?string $vendorDir
     104     * @param string|null $vendorDir
    108105     */
    109106    public function __construct($vendorDir = null)
     
    114111
    115112    /**
    116      * @return string[]
     113     * @return array<string, list<string>>
    117114     */
    118115    public function getPrefixes()
     
    126123
    127124    /**
    128      * @return array[]
    129      * @psalm-return array<string, array<int, string>>
     125     * @return array<string, list<string>>
    130126     */
    131127    public function getPrefixesPsr4()
     
    135131
    136132    /**
    137      * @return array[]
    138      * @psalm-return array<string, string>
     133     * @return list<string>
    139134     */
    140135    public function getFallbackDirs()
     
    144139
    145140    /**
    146      * @return array[]
    147      * @psalm-return array<string, string>
     141     * @return list<string>
    148142     */
    149143    public function getFallbackDirsPsr4()
     
    153147
    154148    /**
    155      * @return string[] Array of classname => path
    156      * @psalm-return array<string, string>
     149     * @return array<string, string> Array of classname => path
    157150     */
    158151    public function getClassMap()
     
    162155
    163156    /**
    164      * @param string[] $classMap Class to filename map
    165      * @psalm-param array<string, string> $classMap
     157     * @param array<string, string> $classMap Class to filename map
    166158     *
    167159     * @return void
     
    180172     * appending or prepending to the ones previously set for this prefix.
    181173     *
    182      * @param string          $prefix  The prefix
    183      * @param string[]|string $paths   The PSR-0 root directories
    184      * @param bool            $prepend Whether to prepend the directories
     174     * @param string              $prefix  The prefix
     175     * @param list<string>|string $paths   The PSR-0 root directories
     176     * @param bool                $prepend Whether to prepend the directories
    185177     *
    186178     * @return void
     
    188180    public function add($prefix, $paths, $prepend = false)
    189181    {
     182        $paths = (array) $paths;
    190183        if (!$prefix) {
    191184            if ($prepend) {
    192185                $this->fallbackDirsPsr0 = array_merge(
    193                     (array) $paths,
     186                    $paths,
    194187                    $this->fallbackDirsPsr0
    195188                );
     
    197190                $this->fallbackDirsPsr0 = array_merge(
    198191                    $this->fallbackDirsPsr0,
    199                     (array) $paths
     192                    $paths
    200193                );
    201194            }
     
    206199        $first = $prefix[0];
    207200        if (!isset($this->prefixesPsr0[$first][$prefix])) {
    208             $this->prefixesPsr0[$first][$prefix] = (array) $paths;
     201            $this->prefixesPsr0[$first][$prefix] = $paths;
    209202
    210203            return;
     
    212205        if ($prepend) {
    213206            $this->prefixesPsr0[$first][$prefix] = array_merge(
    214                 (array) $paths,
     207                $paths,
    215208                $this->prefixesPsr0[$first][$prefix]
    216209            );
     
    218211            $this->prefixesPsr0[$first][$prefix] = array_merge(
    219212                $this->prefixesPsr0[$first][$prefix],
    220                 (array) $paths
     213                $paths
    221214            );
    222215        }
     
    227220     * appending or prepending to the ones previously set for this namespace.
    228221     *
    229      * @param string          $prefix  The prefix/namespace, with trailing '\\'
    230      * @param string[]|string $paths   The PSR-4 base directories
    231      * @param bool            $prepend Whether to prepend the directories
     222     * @param string              $prefix  The prefix/namespace, with trailing '\\'
     223     * @param list<string>|string $paths   The PSR-4 base directories
     224     * @param bool                $prepend Whether to prepend the directories
    232225     *
    233226     * @throws \InvalidArgumentException
     
    237230    public function addPsr4($prefix, $paths, $prepend = false)
    238231    {
     232        $paths = (array) $paths;
    239233        if (!$prefix) {
    240234            // Register directories for the root namespace.
    241235            if ($prepend) {
    242236                $this->fallbackDirsPsr4 = array_merge(
    243                     (array) $paths,
     237                    $paths,
    244238                    $this->fallbackDirsPsr4
    245239                );
     
    247241                $this->fallbackDirsPsr4 = array_merge(
    248242                    $this->fallbackDirsPsr4,
    249                     (array) $paths
     243                    $paths
    250244                );
    251245            }
     
    257251            }
    258252            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
    259             $this->prefixDirsPsr4[$prefix] = (array) $paths;
     253            $this->prefixDirsPsr4[$prefix] = $paths;
    260254        } elseif ($prepend) {
    261255            // Prepend directories for an already registered namespace.
    262256            $this->prefixDirsPsr4[$prefix] = array_merge(
    263                 (array) $paths,
     257                $paths,
    264258                $this->prefixDirsPsr4[$prefix]
    265259            );
     
    268262            $this->prefixDirsPsr4[$prefix] = array_merge(
    269263                $this->prefixDirsPsr4[$prefix],
    270                 (array) $paths
     264                $paths
    271265            );
    272266        }
     
    277271     * replacing any others previously set for this prefix.
    278272     *
    279      * @param string          $prefix The prefix
    280      * @param string[]|string $paths  The PSR-0 base directories
     273     * @param string              $prefix The prefix
     274     * @param list<string>|string $paths  The PSR-0 base directories
    281275     *
    282276     * @return void
     
    295289     * replacing any others previously set for this namespace.
    296290     *
    297      * @param string          $prefix The prefix/namespace, with trailing '\\'
    298      * @param string[]|string $paths  The PSR-4 base directories
     291     * @param string              $prefix The prefix/namespace, with trailing '\\'
     292     * @param list<string>|string $paths  The PSR-4 base directories
    299293     *
    300294     * @throws \InvalidArgumentException
     
    430424    {
    431425        if ($file = $this->findFile($class)) {
    432             (self::$includeFile)($file);
     426            $includeFile = self::$includeFile;
     427            $includeFile($file);
    433428
    434429            return true;
     
    481476
    482477    /**
    483      * Returns the currently registered loaders indexed by their corresponding vendor directories.
    484      *
    485      * @return self[]
     478     * Returns the currently registered loaders keyed by their corresponding vendor directories.
     479     *
     480     * @return array<string, self>
    486481     */
    487482    public static function getRegisteredLoaders()
     
    561556    }
    562557
    563     private static function initializeIncludeClosure(): void
     558    /**
     559     * @return void
     560     */
     561    private static function initializeIncludeClosure()
    564562    {
    565563        if (self::$includeFile !== null) {
     
    575573         * @return void
    576574         */
    577         self::$includeFile = static function($file) {
     575        self::$includeFile = \Closure::bind(static function($file) {
    578576            include $file;
    579         };
     577        }, null, null);
    580578    }
    581579}
  • wp-typography/trunk/vendor-scoped/composer/autoload_classmap.php

    r2819294 r3208262  
    3838    'WP_Typography\\UI\\Sections' => $baseDir . '/includes/wp-typography/ui/class-sections.php',
    3939    'WP_Typography\\UI\\Tabs' => $baseDir . '/includes/wp-typography/ui/class-tabs.php',
     40    'WP_Typography\\UI\\Template' => $baseDir . '/includes/wp-typography/ui/class-template.php',
    4041    'WP_Typography\\Vendor\\Dice\\Dice' => $vendorDir . '/level-2/dice/Dice.php',
    4142    'WP_Typography\\Vendor\\Masterminds\\HTML5' => $vendorDir . '/masterminds/html5/src/HTML5.php',
     
    7778    'WP_Typography\\Vendor\\Mundschenk\\UI\\Controls\\Text_Input' => $vendorDir . '/mundschenk-at/wp-settings-ui/src/ui/controls/class-text-input.php',
    7879    'WP_Typography\\Vendor\\Mundschenk\\UI\\Controls\\Textarea' => $vendorDir . '/mundschenk-at/wp-settings-ui/src/ui/controls/class-textarea.php',
    79     'WP_Typography\\Vendor\\Mundschenk\\WP_Requirements' => $vendorDir . '/mundschenk-at/check-wp-requirements/class-wp-requirements.php',
     80    'WP_Typography\\Vendor\\Mundschenk\\WP_Requirements' => $vendorDir . '/mundschenk-at/check-wp-requirements/src/class-wp-requirements.php',
    8081    'WP_Typography\\Vendor\\PHP_Typography\\DOM' => $vendorDir . '/mundschenk-at/php-typography/src/class-dom.php',
    8182    'WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Default_Registry' => $vendorDir . '/mundschenk-at/php-typography/src/fixes/class-default-registry.php',
  • wp-typography/trunk/vendor-scoped/composer/autoload_static.php

    r2819294 r3208262  
    6464        'WP_Typography\\UI\\Sections' => __DIR__ . '/../..' . '/includes/wp-typography/ui/class-sections.php',
    6565        'WP_Typography\\UI\\Tabs' => __DIR__ . '/../..' . '/includes/wp-typography/ui/class-tabs.php',
     66        'WP_Typography\\UI\\Template' => __DIR__ . '/../..' . '/includes/wp-typography/ui/class-template.php',
    6667        'WP_Typography\\Vendor\\Dice\\Dice' => __DIR__ . '/..' . '/level-2/dice/Dice.php',
    6768        'WP_Typography\\Vendor\\Masterminds\\HTML5' => __DIR__ . '/..' . '/masterminds/html5/src/HTML5.php',
     
    103104        'WP_Typography\\Vendor\\Mundschenk\\UI\\Controls\\Text_Input' => __DIR__ . '/..' . '/mundschenk-at/wp-settings-ui/src/ui/controls/class-text-input.php',
    104105        'WP_Typography\\Vendor\\Mundschenk\\UI\\Controls\\Textarea' => __DIR__ . '/..' . '/mundschenk-at/wp-settings-ui/src/ui/controls/class-textarea.php',
    105         'WP_Typography\\Vendor\\Mundschenk\\WP_Requirements' => __DIR__ . '/..' . '/mundschenk-at/check-wp-requirements/class-wp-requirements.php',
     106        'WP_Typography\\Vendor\\Mundschenk\\WP_Requirements' => __DIR__ . '/..' . '/mundschenk-at/check-wp-requirements/src/class-wp-requirements.php',
    106107        'WP_Typography\\Vendor\\PHP_Typography\\DOM' => __DIR__ . '/..' . '/mundschenk-at/php-typography/src/class-dom.php',
    107108        'WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Default_Registry' => __DIR__ . '/..' . '/mundschenk-at/php-typography/src/fixes/class-default-registry.php',
  • wp-typography/trunk/vendor-scoped/level-2/dice/Dice.php

    r2852338 r3208262  
    3232     * @param array $rule The container can be fully configured using rules provided by associative arrays. See {@link https://r.je/dice.html#example3} for a description of the rules.
    3333     */
    34     public function addRule(string $name, array $rule) : self
     34    public function addRule(string $name, array $rule): self
    3535    {
    3636        $dice = clone $this;
     
    4242     * @param array Rules in a single array [name => $rule] format
    4343     */
    44     public function addRules($rules) : self
    45     {
    46         if (\is_string($rules)) {
    47             $rules = \json_decode(\file_get_contents($rules), \true);
     44    public function addRules($rules): self
     45    {
     46        if (is_string($rules)) {
     47            $rules = json_decode(file_get_contents($rules), \true);
    4848        }
    4949        $dice = clone $this;
     
    5555    private function addRuleTo(Dice $dice, string $name, array $rule)
    5656    {
    57         if (isset($rule['instanceOf']) && (!\array_key_exists('inherit', $rule) || $rule['inherit'] === \true)) {
    58             $rule = \array_replace_recursive($dice->getRule($rule['instanceOf']), $rule);
     57        if (isset($rule['instanceOf']) && (!array_key_exists('inherit', $rule) || $rule['inherit'] === \true)) {
     58            $rule = array_replace_recursive($dice->getRule($rule['instanceOf']), $rule);
    5959        }
    6060        //Allow substitutions rules to be defined with a leading a slash
    6161        if (isset($rule['substitutions'])) {
    6262            foreach ($rule['substitutions'] as $key => $value) {
    63                 $rule['substitutions'][\ltrim($key, '\\')] = $value;
     63                $rule['substitutions'][ltrim($key, '\\')] = $value;
    6464            }
    6565        }
    6666        //Clear any existing instance or cache for this class
    6767        unset($dice->instances[$name], $dice->cache[$name]);
    68         $dice->rules[\ltrim(\strtolower($name), '\\')] = \array_replace_recursive($dice->getRule($name), $rule);
     68        $dice->rules[ltrim(strtolower($name), '\\')] = array_replace_recursive($dice->getRule($name), $rule);
    6969    }
    7070    /**
     
    7373     * @return array The rules for the specified class
    7474     */
    75     public function getRule(string $name) : array
    76     {
    77         $lcName = \strtolower(\ltrim($name, '\\'));
     75    public function getRule(string $name): array
     76    {
     77        error_log("getRule for {$name}");
     78        $lcName = strtolower(ltrim($name, '\\'));
    7879        if (isset($this->rules[$lcName])) {
    7980            return $this->rules[$lcName];
     
    8182        foreach ($this->rules as $key => $rule) {
    8283            // Find a rule which matches the class described in $name where:
    83             if (empty($rule['instanceOf']) && $key !== '*' && \is_subclass_of($name, $key) && (!\array_key_exists('inherit', $rule) || $rule['inherit'] === \true)) {
     84            if (empty($rule['instanceOf']) && $key !== '*' && is_subclass_of($name, $key) && (!array_key_exists('inherit', $rule) || $rule['inherit'] === \true)) {
    8485                // And that rule should be inherited to subclasses
    8586                return $rule;
     
    104105        // Create a closure for creating the object if there isn't one already
    105106        if (empty($this->cache[$name])) {
    106             $this->cache[$name] = $this->getClosure(\ltrim($name, '\\'), $this->getRule($name));
     107            $this->cache[$name] = $this->getClosure(ltrim($name, '\\'), $this->getRule($name));
    107108        }
    108109        // Call the cached closure which will return a fully constructed object of type $name
     
    127128                throw new \InvalidArgumentException('Cannot instantiate interface');
    128129            };
     130        } else if ($params) {
     131            $closure = function (array $args, array $share) use ($class, $params) {
     132                // This class has depenencies, call the $params closure to generate them based on $args and $share
     133                return new $class->name(...$params($args, $share));
     134            };
    129135        } else {
    130             if ($params) {
    131                 $closure = function (array $args, array $share) use($class, $params) {
    132                     // This class has depenencies, call the $params closure to generate them based on $args and $share
    133                     return new $class->name(...$params($args, $share));
    134                 };
    135             } else {
    136                 $closure = function () use($class) {
    137                     // No constructor arguments, just instantiate the class
    138                     return new $class->name();
    139                 };
    140             }
     136            $closure = function () use ($class) {
     137                // No constructor arguments, just instantiate the class
     138                return new $class->name();
     139            };
    141140        }
    142141        if (!empty($rule['shared'])) {
    143             $closure = function (array $args, array $share) use($class, $name, $constructor, $params, $closure) {
     142            $closure = function (array $args, array $share) use ($class, $name, $constructor, $params, $closure) {
    144143                //Internal classes may not be able to be constructed without calling the constructor and will not suffer from #7, construct them normally.
    145144                if ($class->isInternal()) {
     
    158157        // If there are shared instances, create them and merge them with shared instances higher up the object graph
    159158        if (isset($rule['shareInstances'])) {
    160             $closure = function (array $args, array $share) use($closure, $rule) {
     159            $closure = function (array $args, array $share) use ($closure, $rule) {
    161160                foreach ($rule['shareInstances'] as $instance) {
    162161                    $share[] = $this->create($instance, [], $share);
     
    167166        // When $rule['call'] is set, wrap the closure in another closure which will call the required methods after constructing the object
    168167        // By putting this in a closure, the loop is never executed unless call is actually set
    169         return isset($rule['call']) ? function (array $args, array $share) use($closure, $class, $rule, $name) {
     168        return isset($rule['call']) ? function (array $args, array $share) use ($closure, $class, $rule, $name) {
    170169            // Construct the object using the original closure
    171170            $object = $closure($args, $share);
     
    179178                            $this->instances[$name] = $return;
    180179                        }
    181                         if (\is_object($return)) {
    182                             $class = new \ReflectionClass(\get_class($return));
     180                        if (is_object($return)) {
     181                            $class = new \ReflectionClass(get_class($return));
    183182                        }
    184183                        $object = $return;
    185                     } else {
    186                         if (\is_callable($call[2])) {
    187                             \call_user_func($call[2], $return);
    188                         }
     184                    } else if (is_callable($call[2])) {
     185                        call_user_func($call[2], $return);
    189186                    }
    190187                }
     
    202199    private function expand($param, array $share = [], bool $createFromString = \false)
    203200    {
    204         if (\is_array($param)) {
     201        if (is_array($param)) {
    205202            //if a rule specifies Dice::INSTANCE, look up the relevant instance
    206203            if (isset($param[self::INSTANCE])) {
     
    212209                $args = isset($param['params']) ? $this->expand($param['params']) : [];
    213210                //Support Dice::INSTANCE by creating/fetching the specified instance
    214                 if (\is_array($param[self::INSTANCE])) {
     211                if (is_array($param[self::INSTANCE])) {
    215212                    $param[self::INSTANCE][0] = $this->expand($param[self::INSTANCE][0], $share, \true);
    216213                }
    217                 if (\is_callable($param[self::INSTANCE])) {
    218                     return \call_user_func($param[self::INSTANCE], ...$args);
     214                if (is_callable($param[self::INSTANCE])) {
     215                    return call_user_func($param[self::INSTANCE], ...$args);
    219216                } else {
    220                     return $this->create($param[self::INSTANCE], \array_merge($args, $share));
    221                 }
     217                    return $this->create($param[self::INSTANCE], array_merge($args, $share));
     218                }
     219            } else if (isset($param[self::GLOBAL])) {
     220                return $GLOBALS[$param[self::GLOBAL]];
     221            } else if (isset($param[self::CONSTANT])) {
     222                return constant($param[self::CONSTANT]);
    222223            } else {
    223                 if (isset($param[self::GLOBAL])) {
    224                     return $GLOBALS[$param[self::GLOBAL]];
    225                 } else {
    226                     if (isset($param[self::CONSTANT])) {
    227                         return \constant($param[self::CONSTANT]);
    228                     } else {
    229                         foreach ($param as $name => $value) {
    230                             $param[$name] = $this->expand($value, $share);
    231                         }
    232                     }
    233                 }
    234             }
    235         }
    236         return \is_string($param) && $createFromString ? $this->create($param) : $param;
     224                foreach ($param as $name => $value) {
     225                    $param[$name] = $this->expand($value, $share);
     226                }
     227            }
     228        }
     229        return is_string($param) && $createFromString ? $this->create($param) : $param;
    237230    }
    238231    /**
     
    245238            if ($class && ($arg instanceof $class || $arg === null && $param->allowsNull())) {
    246239                // The argument matched, return it and remove it from $search so it won't wrongly match another parameter
    247                 return \array_splice($search, $i, 1)[0];
     240                return array_splice($search, $i, 1)[0];
    248241            }
    249242        }
     
    263256            $type = $param->getType();
    264257            $class = $type instanceof \ReflectionNamedType && !$type->isBuiltIn() ? $type->getName() : null;
    265             $paramInfo[] = [$class, $param, isset($rule['substitutions']) && \array_key_exists($class, $rule['substitutions'])];
     258            $paramInfo[] = [$class, $param, isset($rule['substitutions']) && array_key_exists($class, $rule['substitutions'])];
    266259        }
    267260        // Return a closure that uses the cached information to generate the arguments for the method
    268         return function (array $args, array $share = []) use($paramInfo, $rule) {
     261        return function (array $args, array $share = []) use ($paramInfo, $rule) {
    269262            // If the rule has construtParams set, construct any classes reference and use them as $args
    270263            if (isset($rule['constructParams'])) {
    271                 $args = \array_merge($args, $this->expand($rule['constructParams'], $share));
     264                $args = array_merge($args, $this->expand($rule['constructParams'], $share));
    272265            }
    273266            // Array of matched parameters
     
    278271                if ($args && ($match = $this->matchParam($param, $class, $args)) !== \false) {
    279272                    $parameters[] = $match;
    280                 } else {
    281                     if (($copy = $share) && ($match = $this->matchParam($param, $class, $copy)) !== \false) {
    282                         $parameters[] = $match;
    283                     } else {
    284                         if ($class) {
    285                             try {
    286                                 if ($sub) {
    287                                     $parameters[] = $this->expand($rule['substitutions'][$class], $share, \true);
    288                                 } else {
    289                                     $parameters[] = !$param->allowsNull() ? $this->create($class, [], $share) : null;
    290                                 }
    291                             } catch (\InvalidArgumentException $e) {
    292                             }
     273                } else if (($copy = $share) && ($match = $this->matchParam($param, $class, $copy)) !== \false) {
     274                    $parameters[] = $match;
     275                } else if ($class) {
     276                    try {
     277                        if ($sub) {
     278                            $parameters[] = $this->expand($rule['substitutions'][$class], $share, \true);
    293279                        } else {
    294                             if ($args && $param->getType()) {
    295                                 for ($i = 0; $i < \count($args); $i++) {
    296                                     if (\call_user_func('is_' . $param->getType()->getName(), $args[$i])) {
    297                                         $parameters[] = \array_splice($args, $i, 1)[0];
    298                                         break;
    299                                     }
    300                                 }
    301                             } else {
    302                                 if ($args) {
    303                                     $parameters[] = $this->expand(\array_shift($args));
    304                                 } else {
    305                                     if ($param->isVariadic()) {
    306                                         $parameters = \array_merge($parameters, $args);
    307                                     } else {
    308                                         $parameters[] = $param->isDefaultValueAvailable() ? $param->getDefaultValue() : null;
    309                                     }
    310                                 }
    311                             }
     280                            $parameters[] = !$param->allowsNull() ? $this->create($class, [], $share) : null;
     281                        }
     282                    } catch (\InvalidArgumentException $e) {
     283                    }
     284                } else if ($args && $param->getType()) {
     285                    for ($i = 0; $i < count($args); $i++) {
     286                        if (call_user_func('is_' . $param->getType()->getName(), $args[$i])) {
     287                            $parameters[] = array_splice($args, $i, 1)[0];
     288                            break;
    312289                        }
    313290                    }
     291                } else if ($args) {
     292                    $parameters[] = $this->expand(array_shift($args));
     293                } else if ($param->isVariadic()) {
     294                    $parameters = array_merge($parameters, $args);
     295                } else {
     296                    $parameters[] = $param->isDefaultValueAvailable() ? $param->getDefaultValue() : null;
    314297                }
    315298            }
  • wp-typography/trunk/vendor-scoped/masterminds/html5/README.md

    r2819294 r3208262  
    3131- Runs on **PHP** 5.3.0 or newer
    3232
    33 [![Build Status](https://travis-ci.org/Masterminds/html5-php.png?branch=master)](https://travis-ci.org/Masterminds/html5-php)
     33[![CI](https://github.com/Masterminds/html5-php/actions/workflows/ci.yaml/badge.svg)](https://github.com/Masterminds/html5-php/actions/workflows/ci.yaml)
    3434[![Latest Stable Version](https://poser.pugx.org/masterminds/html5/v/stable.png)](https://packagist.org/packages/masterminds/html5)
    3535[![Code Coverage](https://scrutinizer-ci.com/g/Masterminds/html5-php/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/Masterminds/html5-php/?branch=master)
     
    190190  interpreter. While one may be supplied, not all features will be
    191191  supported.
    192 - Rentrance: The current parser is not re-entrant. (Thus you can't pause
     192- Reentrance: The current parser is not re-entrant. (Thus you can't pause
    193193  the parser to modify the HTML string mid-parse.)
    194194- Validation: The current tree builder is **not** a validating parser.
  • wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5.php

    r2663994 r3208262  
    2828    public function __construct(array $defaultOptions = array())
    2929    {
    30         $this->defaultOptions = \array_merge($this->defaultOptions, $defaultOptions);
     30        $this->defaultOptions = array_merge($this->defaultOptions, $defaultOptions);
    3131    }
    3232    /**
     
    6060    {
    6161        // Handle the case where file is a resource.
    62         if (\is_resource($file)) {
    63             return $this->parse(\stream_get_contents($file), $options);
     62        if (is_resource($file)) {
     63            return $this->parse(stream_get_contents($file), $options);
    6464        }
    65         return $this->parse(\file_get_contents($file), $options);
     65        return $this->parse(file_get_contents($file), $options);
    6666    }
    6767    /**
     
    128128    public function hasErrors()
    129129    {
    130         return \count($this->errors) > 0;
     130        return count($this->errors) > 0;
    131131    }
    132132    /**
     
    141141    {
    142142        $this->errors = array();
    143         $options = \array_merge($this->defaultOptions, $options);
     143        $options = array_merge($this->defaultOptions, $options);
    144144        $events = new DOMTreeBuilder(\false, $options);
    145145        $scanner = new Scanner($input, !empty($options['encoding']) ? $options['encoding'] : 'UTF-8');
     
    162162    public function parseFragment($input, array $options = array())
    163163    {
    164         $options = \array_merge($this->defaultOptions, $options);
     164        $options = array_merge($this->defaultOptions, $options);
    165165        $events = new DOMTreeBuilder(\true, $options);
    166166        $scanner = new Scanner($input, !empty($options['encoding']) ? $options['encoding'] : 'UTF-8');
     
    183183    {
    184184        $close = \true;
    185         if (\is_resource($file)) {
     185        if (is_resource($file)) {
    186186            $stream = $file;
    187187            $close = \false;
    188188        } else {
    189             $stream = \fopen($file, 'wb');
     189            $stream = fopen($file, 'wb');
    190190        }
    191         $options = \array_merge($this->defaultOptions, $options);
     191        $options = array_merge($this->defaultOptions, $options);
    192192        $rules = new OutputRules($stream, $options);
    193193        $trav = new Traverser($dom, $stream, $rules, $options);
     
    198198        $rules->unsetTraverser();
    199199        if ($close) {
    200             \fclose($stream);
     200            fclose($stream);
    201201        }
    202202    }
     
    214214    public function saveHTML($dom, $options = array())
    215215    {
    216         $stream = \fopen('php://temp', 'wb');
    217         $this->save($dom, $stream, \array_merge($this->defaultOptions, $options));
    218         $html = \stream_get_contents($stream, -1, 0);
    219         \fclose($stream);
     216        $stream = fopen('php://temp', 'wb');
     217        $this->save($dom, $stream, array_merge($this->defaultOptions, $options));
     218        $html = stream_get_contents($stream, -1, 0);
     219        fclose($stream);
    220220        return $html;
    221221    }
  • wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5/Elements.php

    r2207810 r3208262  
    6565    const BLOCK_ONLY_INLINE = 128;
    6666    /**
     67     * Elements with optional end tags that cause auto-closing of previous and parent tags,
     68     * as example most of the table related tags, see https://www.w3.org/TR/html401/struct/tables.html
     69     * Structure is as follows:
     70     * TAG-NAME => [PARENT-TAG-NAME-TO-CLOSE1, PARENT-TAG-NAME-TO-CLOSE2, ...].
     71     *
     72     * Order is important, after auto-closing one parent with might have to close also their parent.
     73     *
     74     * @var array<string, string[]>
     75     */
     76    public static $optionalEndElementsParentsToClose = array('tr' => array('td', 'tr'), 'td' => array('td', 'th'), 'th' => array('td', 'th'), 'tfoot' => array('td', 'th', 'tr', 'tbody', 'thead'), 'tbody' => array('td', 'th', 'tr', 'thead'));
     77    /**
    6778     * The HTML5 elements as defined in http://dev.w3.org/html5/markup/elements.html.
    6879     *
     
    234245        // NORMAL | AUTOCLOSE_P | BLOCK_TAG
    235246        'var' => 1,
    236         'video' => 65,
    237         // NORMAL | BLOCK_TAG
     247        'video' => 1,
    238248        'wbr' => 9,
    239249        // NORMAL | VOID_TAG
     
    412422        // html5 element names are case insensitive. Forcing lowercase for the check.
    413423        // Do we need this check or will all data passed here already be lowercase?
    414         return isset(static::$html5[\strtolower($name)]);
     424        return isset(static::$html5[strtolower($name)]);
    415425    }
    416426    /**
     
    480490    public static function normalizeSvgElement($name)
    481491    {
    482         $name = \strtolower($name);
     492        $name = strtolower($name);
    483493        if (isset(static::$svgCaseSensitiveElementMap[$name])) {
    484494            $name = static::$svgCaseSensitiveElementMap[$name];
     
    495505    public static function normalizeSvgAttribute($name)
    496506    {
    497         $name = \strtolower($name);
     507        $name = strtolower($name);
    498508        if (isset(static::$svgCaseSensitiveAttributeMap[$name])) {
    499509            $name = static::$svgCaseSensitiveAttributeMap[$name];
     
    511521    public static function normalizeMathMlAttribute($name)
    512522    {
    513         $name = \strtolower($name);
     523        $name = strtolower($name);
    514524        // Only one attribute has a mixed case form for MathML.
    515525        if ('definitionurl' === $name) {
  • wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5/Parser/CharacterReference.php

    r2663994 r3208262  
    3636        // UNTESTED: This may fail on some planes. Couldn't find full documentation
    3737        // on the value of the mask array.
    38         return \mb_decode_numericentity($entity, static::$numeric_mask, 'utf-8');
     38        return mb_decode_numericentity($entity, static::$numeric_mask, 'utf-8');
    3939    }
    4040    /**
     
    4747    public static function lookupHex($hexdec)
    4848    {
    49         return static::lookupDecimal(\hexdec($hexdec));
     49        return static::lookupDecimal(hexdec($hexdec));
    5050    }
    5151}
  • wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php

    r2663994 r3208262  
    136136        }
    137137        // Fill $nsStack with the defalut HTML5 namespaces, plus the "implicitNamespaces" array taken form $options
    138         \array_unshift($this->nsStack, $implicitNS + array('' => self::NAMESPACE_HTML) + $this->implicitNamespaces);
     138        array_unshift($this->nsStack, $implicitNS + array('' => self::NAMESPACE_HTML) + $this->implicitNamespaces);
    139139        if ($isFragment) {
    140140            $this->insertMode = static::IM_IN_BODY;
     
    256256        // when we found a tag thats appears inside $nsRoots, we have to switch the defalut namespace
    257257        if (isset($this->nsRoots[$lname]) && $this->nsStack[0][''] !== $this->nsRoots[$lname]) {
    258             \array_unshift($this->nsStack, array('' => $this->nsRoots[$lname]) + $this->nsStack[0]);
     258            array_unshift($this->nsStack, array('' => $this->nsRoots[$lname]) + $this->nsStack[0]);
    259259            ++$pushes;
    260260        }
     
    265265                if ('xmlns' === $aName) {
    266266                    $needsWorkaround = $aVal;
    267                     \array_unshift($this->nsStack, array('' => $aVal) + $this->nsStack[0]);
     267                    array_unshift($this->nsStack, array('' => $aVal) + $this->nsStack[0]);
    268268                    ++$pushes;
    269                 } elseif ('xmlns' === (($pos = \strpos($aName, ':')) ? \substr($aName, 0, $pos) : '')) {
    270                     \array_unshift($this->nsStack, array(\substr($aName, $pos + 1) => $aVal) + $this->nsStack[0]);
     269                } elseif ('xmlns' === (($pos = strpos($aName, ':')) ? substr($aName, 0, $pos) : '')) {
     270                    array_unshift($this->nsStack, array(substr($aName, $pos + 1) => $aVal) + $this->nsStack[0]);
    271271                    ++$pushes;
    272272                }
     
    277277            $this->onlyInline = null;
    278278        }
     279        // some elements as table related tags might have optional end tags that force us to auto close multiple tags
     280        // https://www.w3.org/TR/html401/struct/tables.html
     281        if ($this->current instanceof \DOMElement && isset(Elements::$optionalEndElementsParentsToClose[$lname])) {
     282            foreach (Elements::$optionalEndElementsParentsToClose[$lname] as $parentElName) {
     283                if ($this->current instanceof \DOMElement && $this->current->tagName === $parentElName) {
     284                    $this->autoclose($parentElName);
     285                }
     286            }
     287        }
    279288        try {
    280             $prefix = ($pos = \strpos($lname, ':')) ? \substr($lname, 0, $pos) : '';
     289            $prefix = ($pos = strpos($lname, ':')) ? substr($lname, 0, $pos) : '';
    281290            if (\false !== $needsWorkaround) {
    282                 $xml = "<{$lname} xmlns=\"{$needsWorkaround}\" " . (\strlen($prefix) && isset($this->nsStack[0][$prefix]) ? "xmlns:{$prefix}=\"" . $this->nsStack[0][$prefix] . '"' : '') . '/>';
     291                $xml = "<{$lname} xmlns=\"{$needsWorkaround}\" " . (strlen($prefix) && isset($this->nsStack[0][$prefix]) ? "xmlns:{$prefix}=\"" . $this->nsStack[0][$prefix] . '"' : '') . '/>';
    283292                $frag = new \DOMDocument('1.0', 'UTF-8');
    284293                $frag->loadXML($xml);
    285294                $ele = $this->doc->importNode($frag->documentElement, \true);
     295            } else if (!isset($this->nsStack[0][$prefix]) || '' === $prefix && isset($this->options[self::OPT_DISABLE_HTML_NS]) && $this->options[self::OPT_DISABLE_HTML_NS]) {
     296                $ele = $this->doc->createElement($lname);
    286297            } else {
    287                 if (!isset($this->nsStack[0][$prefix]) || '' === $prefix && isset($this->options[self::OPT_DISABLE_HTML_NS]) && $this->options[self::OPT_DISABLE_HTML_NS]) {
    288                     $ele = $this->doc->createElement($lname);
    289                 } else {
    290                     $ele = $this->doc->createElementNS($this->nsStack[0][$prefix], $lname);
    291                 }
     298                $ele = $this->doc->createElementNS($this->nsStack[0][$prefix], $lname);
    292299            }
    293300        } catch (\DOMException $e) {
     
    304311            // to avoid spl_object_hash collisions whe have to avoid garbage collection of $ele storing it into $pushes
    305312            // see https://bugs.php.net/bug.php?id=67459
    306             $this->pushes[\spl_object_hash($ele)] = array($pushes, $ele);
     313            $this->pushes[spl_object_hash($ele)] = array($pushes, $ele);
    307314        }
    308315        foreach ($attributes as $aName => $aVal) {
     
    318325            $aVal = (string) $aVal;
    319326            try {
    320                 $prefix = ($pos = \strpos($aName, ':')) ? \substr($aName, 0, $pos) : \false;
     327                $prefix = ($pos = strpos($aName, ':')) ? substr($aName, 0, $pos) : \false;
    321328                if ('xmlns' === $prefix) {
    322329                    $ele->setAttributeNS(self::NAMESPACE_XMLNS, $aName, $aVal);
     
    361368            // remove the namespaced definded by current node
    362369            for ($i = 0; $i < $pushes; ++$i) {
    363                 \array_shift($this->nsStack);
     370                array_shift($this->nsStack);
    364371            }
    365372        }
     
    383390        if ($this->insertMode <= static::IM_BEFORE_HTML) {
    384391            // 8.2.5.4.2
    385             if (\in_array($name, array('html', 'br', 'head', 'title'))) {
     392            if (in_array($name, array('html', 'br', 'head', 'title'))) {
    386393                $this->startTag('html');
    387394                $this->endTag($name);
     
    397404            $lname = Elements::normalizeSvgElement($lname);
    398405        }
    399         $cid = \spl_object_hash($this->current);
     406        $cid = spl_object_hash($this->current);
    400407        // XXX: HTML has no parent. What do we do, though,
    401408        // if this element appears in the wrong place?
     
    406413        if (isset($this->pushes[$cid])) {
    407414            for ($i = 0; $i < $this->pushes[$cid][0]; ++$i) {
    408                 \array_shift($this->nsStack);
     415                array_shift($this->nsStack);
    409416            }
    410417            unset($this->pushes[$cid]);
     
    440447            // practical as most documents contain these characters. Other text is not
    441448            // expected here so recording a parse error is necessary.
    442             $dataTmp = \trim($data, " \t\n\r\f");
     449            $dataTmp = trim($data, " \t\n\r\f");
    443450            if (!empty($dataTmp)) {
    444451                // fprintf(STDOUT, "Unexpected insert mode: %d", $this->insertMode);
     
    457464    public function parseError($msg, $line = 0, $col = 0)
    458465    {
    459         $this->errors[] = \sprintf('Line %d, Col %d: %s', $line, $col, $msg);
     466        $this->errors[] = sprintf('Line %d, Col %d: %s', $line, $col, $msg);
    460467    }
    461468    public function getErrors()
     
    471478    {
    472479        // XXX: Ignore initial XML declaration, per the spec.
    473         if ($this->insertMode === static::IM_INITIAL && 'xml' === \strtolower($name)) {
     480        if ($this->insertMode === static::IM_INITIAL && 'xml' === strtolower($name)) {
    474481            return;
    475482        }
  • wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5/Parser/FileInputStream.php

    r2663994 r3208262  
    2727    {
    2828        // Get the contents of the file.
    29         $content = \file_get_contents($data);
     29        $content = file_get_contents($data);
    3030        parent::__construct($content, $encoding, $debug);
    3131    }
  • wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5/Parser/Scanner.php

    r2819294 r3208262  
    3939    {
    4040        if ($data instanceof InputStream) {
    41             @\trigger_error('InputStream objects are deprecated since version 2.4 and will be removed in 3.0. Use strings instead.', \E_USER_DEPRECATED);
     41            @trigger_error('InputStream objects are deprecated since version 2.4 and will be removed in 3.0. Use strings instead.', \E_USER_DEPRECATED);
    4242            $data = (string) $data;
    4343        }
     
    5050        $this->data = $data;
    5151        $this->char = 0;
    52         $this->EOF = \strlen($data);
     52        $this->EOF = strlen($data);
    5353    }
    5454    /**
     
    7272    public function sequenceMatches($sequence, $caseSensitive = \true)
    7373    {
    74         $portion = \substr($this->data, $this->char, \strlen($sequence));
    75         return $caseSensitive ? $portion === $sequence : 0 === \strcasecmp($portion, $sequence);
     74        $portion = substr($this->data, $this->char, strlen($sequence));
     75        return $caseSensitive ? $portion === $sequence : 0 === strcasecmp($portion, $sequence);
    7676    }
    7777    /**
     
    199199            return \false;
    200200        }
    201         $len = \strspn($this->data, "\n\t\f ", $this->char);
     201        $len = strspn($this->data, "\n\t\f ", $this->char);
    202202        $this->char += $len;
    203203        return $len;
     
    215215        // Add one to $this->char because we want the number for the next
    216216        // byte to be processed.
    217         return \substr_count($this->data, "\n", 0, \min($this->char, $this->EOF)) + 1;
     217        return substr_count($this->data, "\n", 0, min($this->char, $this->EOF)) + 1;
    218218    }
    219219    /**
     
    257257        // position of) added to it because strrpos's behaviour includes the
    258258        // final offset byte.
    259         $backwardFrom = $this->char - 1 - \strlen($this->data);
    260         $lastLine = \strrpos($this->data, "\n", $backwardFrom);
     259        $backwardFrom = $this->char - 1 - strlen($this->data);
     260        $lastLine = strrpos($this->data, "\n", $backwardFrom);
    261261        // However, for here we want the length up until the next byte to be
    262262        // processed, so add one to the current byte ($this->char).
    263263        if (\false !== $lastLine) {
    264             $findLengthOf = \substr($this->data, $lastLine + 1, $this->char - 1 - $lastLine);
     264            $findLengthOf = substr($this->data, $lastLine + 1, $this->char - 1 - $lastLine);
    265265        } else {
    266266            // After a newline.
    267             $findLengthOf = \substr($this->data, 0, $this->char);
     267            $findLengthOf = substr($this->data, 0, $this->char);
    268268        }
    269269        return UTF8Utils::countChars($findLengthOf);
     
    279279    {
    280280        if ($this->char < $this->EOF) {
    281             $data = \substr($this->data, $this->char);
     281            $data = substr($this->data, $this->char);
    282282            $this->char = $this->EOF;
    283283            return $data;
     
    303303         */
    304304        $crlfTable = array("\x00" => "�", "\r\n" => "\n", "\r" => "\n");
    305         return \strtr($data, $crlfTable);
     305        return strtr($data, $crlfTable);
    306306    }
    307307    /**
     
    325325        }
    326326        if (0 === $max || $max) {
    327             $len = \strcspn($this->data, $bytes, $this->char, $max);
     327            $len = strcspn($this->data, $bytes, $this->char, $max);
    328328        } else {
    329             $len = \strcspn($this->data, $bytes, $this->char);
    330         }
    331         $string = (string) \substr($this->data, $this->char, $len);
     329            $len = strcspn($this->data, $bytes, $this->char);
     330        }
     331        $string = (string) substr($this->data, $this->char, $len);
    332332        $this->char += $len;
    333333        return $string;
     
    352352        }
    353353        if (0 === $max || $max) {
    354             $len = \strspn($this->data, $bytes, $this->char, $max);
     354            $len = strspn($this->data, $bytes, $this->char, $max);
    355355        } else {
    356             $len = \strspn($this->data, $bytes, $this->char);
    357         }
    358         $string = (string) \substr($this->data, $this->char, $len);
     356            $len = strspn($this->data, $bytes, $this->char);
     357        }
     358        $string = (string) substr($this->data, $this->char, $len);
    359359        $this->char += $len;
    360360        return $string;
  • wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5/Parser/StringInputStream.php

    r2663994 r3208262  
    6666        $data = UTF8Utils::convertToUTF8($data, $encoding);
    6767        if ($debug) {
    68             \fprintf(\STDOUT, $debug, $data, \strlen($data));
     68            fprintf(\STDOUT, $debug, $data, strlen($data));
    6969        }
    7070        // There is good reason to question whether it makes sense to
     
    7575        $this->data = $data;
    7676        $this->char = 0;
    77         $this->EOF = \strlen($data);
     77        $this->EOF = strlen($data);
    7878    }
    7979    public function __toString()
     
    9494         */
    9595        $crlfTable = array("\x00" => "�", "\r\n" => "\n", "\r" => "\n");
    96         return \strtr($data, $crlfTable);
     96        return strtr($data, $crlfTable);
    9797    }
    9898    /**
     
    106106        // Add one to $this->char because we want the number for the next
    107107        // byte to be processed.
    108         return \substr_count($this->data, "\n", 0, \min($this->char, $this->EOF)) + 1;
     108        return substr_count($this->data, "\n", 0, min($this->char, $this->EOF)) + 1;
    109109    }
    110110    /**
     
    132132        // position of) added to it because strrpos's behaviour includes the
    133133        // final offset byte.
    134         $backwardFrom = $this->char - 1 - \strlen($this->data);
    135         $lastLine = \strrpos($this->data, "\n", $backwardFrom);
     134        $backwardFrom = $this->char - 1 - strlen($this->data);
     135        $lastLine = strrpos($this->data, "\n", $backwardFrom);
    136136        // However, for here we want the length up until the next byte to be
    137137        // processed, so add one to the current byte ($this->char).
    138138        if (\false !== $lastLine) {
    139             $findLengthOf = \substr($this->data, $lastLine + 1, $this->char - 1 - $lastLine);
     139            $findLengthOf = substr($this->data, $lastLine + 1, $this->char - 1 - $lastLine);
    140140        } else {
    141141            // After a newline.
    142             $findLengthOf = \substr($this->data, 0, $this->char);
     142            $findLengthOf = substr($this->data, 0, $this->char);
    143143        }
    144144        return UTF8Utils::countChars($findLengthOf);
     
    156156     * @return string The current character.
    157157     */
     158    #[\ReturnTypeWillChange]
    158159    public function current()
    159160    {
     
    164165     * This is part of the Iterator interface.
    165166     */
     167    #[\ReturnTypeWillChange]
    166168    public function next()
    167169    {
     
    171173     * Rewind to the start of the string.
    172174     */
     175    #[\ReturnTypeWillChange]
    173176    public function rewind()
    174177    {
     
    180183     * @return bool Whether the current pointer location is valid.
    181184     */
     185    #[\ReturnTypeWillChange]
    182186    public function valid()
    183187    {
     
    198202    {
    199203        if ($this->char < $this->EOF) {
    200             $data = \substr($this->data, $this->char);
     204            $data = substr($this->data, $this->char);
    201205            $this->char = $this->EOF;
    202206            return $data;
     
    225229        }
    226230        if (0 === $max || $max) {
    227             $len = \strcspn($this->data, $bytes, $this->char, $max);
     231            $len = strcspn($this->data, $bytes, $this->char, $max);
    228232        } else {
    229             $len = \strcspn($this->data, $bytes, $this->char);
    230         }
    231         $string = (string) \substr($this->data, $this->char, $len);
     233            $len = strcspn($this->data, $bytes, $this->char);
     234        }
     235        $string = (string) substr($this->data, $this->char, $len);
    232236        $this->char += $len;
    233237        return $string;
     
    252256        }
    253257        if (0 === $max || $max) {
    254             $len = \strspn($this->data, $bytes, $this->char, $max);
     258            $len = strspn($this->data, $bytes, $this->char, $max);
    255259        } else {
    256             $len = \strspn($this->data, $bytes, $this->char);
    257         }
    258         $string = (string) \substr($this->data, $this->char, $len);
     260            $len = strspn($this->data, $bytes, $this->char);
     261        }
     262        $string = (string) substr($this->data, $this->char, $len);
    259263        $this->char += $len;
    260264        return $string;
     
    281285        return \false;
    282286    }
     287    #[\ReturnTypeWillChange]
    283288    public function key()
    284289    {
  • wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5/Parser/Tokenizer.php

    r2819294 r3208262  
    117117            $this->flushBuffer();
    118118            $tok = $this->scanner->next();
    119             if ('!' === $tok) {
     119            if (\false === $tok) {
     120                // end of string
     121                $this->parseError('Illegal tag opening');
     122            } elseif ('!' === $tok) {
    120123                $this->markupDeclaration();
    121124            } elseif ('/' === $tok) {
     
    123126            } elseif ('?' === $tok) {
    124127                $this->processingInstruction();
    125             } elseif (\ctype_alpha($tok)) {
     128            } elseif ($this->is_alpha($tok)) {
    126129                $this->tagName();
    127130            } else {
     
    215218    protected function rawText($tok)
    216219    {
    217         if (\is_null($this->untilTag)) {
     220        if (is_null($this->untilTag)) {
    218221            return $this->text($tok);
    219222        }
     
    233236    protected function rcdata($tok)
    234237    {
    235         if (\is_null($this->untilTag)) {
     238        if (is_null($this->untilTag)) {
    236239            return $this->text($tok);
    237240        }
     
    248251            }
    249252        }
    250         $len = \strlen($sequence);
     253        $len = strlen($sequence);
    251254        $this->scanner->consume($len);
    252255        $len += $this->scanner->whitespace();
     
    304307        // EOF -> parse error
    305308        // -> parse error
    306         if (!\ctype_alpha($tok)) {
     309        if (!$this->is_alpha($tok)) {
    307310            $this->parseError("Expected tag name, got '%s'", $tok);
    308311            if ("\x00" == $tok || \false === $tok) {
     
    312315        }
    313316        $name = $this->scanner->charsUntil("\n\f \t>");
    314         $name = self::CONFORMANT_XML === $this->mode ? $name : \strtolower($name);
     317        $name = self::CONFORMANT_XML === $this->mode ? $name : strtolower($name);
    315318        // Trash whitespace.
    316319        $this->scanner->whitespace();
     
    332335        // We know this is at least one char.
    333336        $name = $this->scanner->charsWhile(':_-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz');
    334         $name = self::CONFORMANT_XML === $this->mode ? $name : \strtolower($name);
     337        $name = self::CONFORMANT_XML === $this->mode ? $name : strtolower($name);
    335338        $attributes = array();
    336339        $selfClose = \false;
     
    346349        }
    347350        $mode = $this->events->startTag($name, $attributes, $selfClose);
    348         if (\is_int($mode)) {
     351        if (is_int($mode)) {
    349352            $this->setTextMode($mode, $name);
    350353        }
     
    406409            throw new ParseError('Start tag inside of attribute.');
    407410        }
    408         $name = \strtolower($this->scanner->charsUntil("/>=\n\f\t "));
    409         if (0 == \strlen($name)) {
     411        $name = strtolower($this->scanner->charsUntil("/>=\n\f\t "));
     412        if (0 == strlen($name)) {
    410413            $tok = $this->scanner->current();
    411414            $this->parseError('Expected an attribute name, got %s.', $tok);
     
    421424        // see issue #23: https://github.com/Masterminds/html5-php/issues/23
    422425        // and http://www.w3.org/TR/2011/WD-html5-20110525/syntax.html#syntax-attribute-name
    423         if (\preg_match("/[\x01-,\\/;-@[-^`{-]/u", $name)) {
     426        if (preg_match("/[\x01-,\\/;-@[-^`{-]/u", $name)) {
    424427            $this->parseError('Unexpected characters in attribute name: %s', $name);
    425428            $isValidAttribute = \false;
    426         } elseif (\preg_match('/^[0-9.-]/u', $name)) {
     429        } elseif (preg_match('/^[0-9.-]/u', $name)) {
    427430            $this->parseError('Unexpected character at the begining of attribute name: %s', $name);
    428431            $isValidAttribute = \false;
     
    664667        $doctypeName = $this->scanner->charsUntil($stop);
    665668        // Lowercase ASCII, replace \0 with FFFD
    666         $doctypeName = \strtolower(\strtr($doctypeName, "\x00", UTF8Utils::FFFD));
     669        $doctypeName = strtolower(strtr($doctypeName, "\x00", UTF8Utils::FFFD));
    667670        $tok = $this->scanner->current();
    668671        // If false, emit a parse error, DOCTYPE, and return.
     
    675678        if ('>' == $tok) {
    676679            // DOCTYPE without a name.
    677             if (0 == \strlen($doctypeName)) {
     680            if (0 == strlen($doctypeName)) {
    678681                $this->parseError('Expected a DOCTYPE name. Got nothing.');
    679682                $this->events->doctype($doctypeName, 0, null, \true);
     
    686689        }
    687690        $this->scanner->whitespace();
    688         $pub = \strtoupper($this->scanner->getAsciiAlpha());
     691        $pub = strtoupper($this->scanner->getAsciiAlpha());
    689692        $white = $this->scanner->whitespace();
    690693        // Get ID, and flag it as pub or system.
     
    801804        $white = $this->scanner->whitespace();
    802805        // If not a PI, send to bogusComment.
    803         if (0 == \strlen($procName) || 0 == $white || \false == $this->scanner->current()) {
     806        if (0 == strlen($procName) || 0 == $white || \false == $this->scanner->current()) {
    804807            $this->parseError("Expected processing instruction name, got {$tok}");
    805808            $this->bogusComment('<?' . $tok . $procName);
     
    837840        $buffer = '';
    838841        // Optimization for reading larger blocks faster.
    839         $first = \substr($sequence, 0, 1);
     842        $first = substr($sequence, 0, 1);
    840843        while (\false !== $this->scanner->current()) {
    841844            $buffer .= $this->scanner->charsUntil($first);
     
    871874    protected function sequenceMatches($sequence, $caseSensitive = \true)
    872875    {
    873         @\trigger_error(__METHOD__ . ' method is deprecated since version 2.4 and will be removed in 3.0. Use Scanner::sequenceMatches() instead.', \E_USER_DEPRECATED);
     876        @trigger_error(__METHOD__ . ' method is deprecated since version 2.4 and will be removed in 3.0. Use Scanner::sequenceMatches() instead.', \E_USER_DEPRECATED);
    874877        return $this->scanner->sequenceMatches($sequence, $caseSensitive);
    875878    }
     
    912915    protected function parseError($msg)
    913916    {
    914         $args = \func_get_args();
    915         if (\count($args) > 1) {
    916             \array_shift($args);
    917             $msg = \vsprintf($msg, $args);
     917        $args = func_get_args();
     918        if (count($args) > 1) {
     919            array_shift($args);
     920            $msg = vsprintf($msg, $args);
    918921        }
    919922        $line = $this->scanner->currentLine();
     
    10131016        return '&';
    10141017    }
     1018    /**
     1019     * Checks whether a (single-byte) character is an ASCII letter or not.
     1020     *
     1021     * @param string $input A single-byte string
     1022     *
     1023     * @return bool True if it is a letter, False otherwise
     1024     */
     1025    protected function is_alpha($input)
     1026    {
     1027        $code = ord($input);
     1028        return $code >= 97 && $code <= 122 || $code >= 65 && $code <= 90;
     1029    }
    10151030}
  • wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5/Parser/TreeBuildingRules.php

    r2207810 r3208262  
    7474    protected function closeIfCurrentMatches($ele, $current, $match)
    7575    {
    76         if (\in_array($current->tagName, $match, \true)) {
     76        if (in_array($current->tagName, $match, \true)) {
    7777            $current->parentNode->appendChild($ele);
    7878        } else {
  • wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5/Parser/UTF8Utils.php

    r2663994 r3208262  
    3636    /**
    3737     * Count the number of characters in a string.
    38      * UTF-8 aware. This will try (in order) iconv, MB, libxml, and finally a custom counter.
     38     * UTF-8 aware. This will try (in order) iconv, MB, and finally a custom counter.
    3939     *
    4040     * @param string $string
     
    4545    {
    4646        // Get the length for the string we need.
    47         if (\function_exists('mb_strlen')) {
    48             return \mb_strlen($string, 'utf-8');
     47        if (function_exists('mb_strlen')) {
     48            return mb_strlen($string, 'utf-8');
    4949        }
    50         if (\function_exists('iconv_strlen')) {
    51             return \iconv_strlen($string, 'utf-8');
     50        if (function_exists('iconv_strlen')) {
     51            return iconv_strlen($string, 'utf-8');
    5252        }
    53         if (\function_exists('utf8_decode')) {
    54             // MPB: Will this work? Won't certain decodes lead to two chars
    55             // extrapolated out of 2-byte chars?
    56             return \strlen(\utf8_decode($string));
    57         }
    58         $count = \count_chars($string);
     53        $count = count_chars($string);
    5954        // 0x80 = 0x7F - 0 + 1 (one added to get inclusive range)
    6055        // 0x33 = 0xF4 - 0x2C + 1 (one added to get inclusive range)
    61         return \array_sum(\array_slice($count, 0, 0x80)) + \array_sum(\array_slice($count, 0xc2, 0x33));
     56        return array_sum(array_slice($count, 0, 0x80)) + array_sum(array_slice($count, 0xc2, 0x33));
    6257    }
    6358    /**
     
    8681        // which contains links to the actual but reports as well as work around
    8782        // details.
    88         if (\function_exists('mb_convert_encoding')) {
     83        if (function_exists('mb_convert_encoding')) {
    8984            // mb library has the following behaviors:
    9085            // - UTF-16 surrogates result in false.
     
    9590            // to our needs, and then change it back when we are done. This feels
    9691            // a little excessive and it would be great if there was a better way.
    97             $save = \mb_substitute_character();
    98             \mb_substitute_character('none');
    99             $data = \mb_convert_encoding($data, 'UTF-8', $encoding);
    100             \mb_substitute_character($save);
    101         } elseif (\function_exists('iconv') && 'auto' !== $encoding) {
     92            $save = mb_substitute_character();
     93            mb_substitute_character('none');
     94            $data = mb_convert_encoding($data, 'UTF-8', $encoding);
     95            mb_substitute_character($save);
     96        } elseif (function_exists('iconv') && 'auto' !== $encoding) {
    10297            // fprintf(STDOUT, "iconv found\n");
    10398            // iconv has the following behaviors:
     
    105100            // - Beyond Plane 16 is replaced with a lower char.
    106101            // - Incomplete sequences generate a warning.
    107             $data = @\iconv($encoding, 'UTF-8//IGNORE', $data);
     102            $data = @iconv($encoding, 'UTF-8//IGNORE', $data);
    108103        } else {
    109104            throw new Exception('Not implemented, please install mbstring or iconv');
     
    112107         * One leading U+FEFF BYTE ORDER MARK character must be ignored if any are present.
    113108         */
    114         if ("" === \substr($data, 0, 3)) {
    115             $data = \substr($data, 3);
     109        if ("" === substr($data, 0, 3)) {
     110            $data = substr($data, 3);
    116111        }
    117112        return $data;
     
    132127         * Any occurrences of such characters is a parse error.
    133128         */
    134         for ($i = 0, $count = \substr_count($data, "\x00"); $i < $count; ++$i) {
     129        for ($i = 0, $count = substr_count($data, "\x00"); $i < $count; ++$i) {
    135130            $errors[] = 'null-character';
    136131        }
     
    144139         */
    145140        // Check PCRE is loaded.
    146         $count = \preg_match_all('/(?:
    147         [\\x01-\\x08\\x0B\\x0E-\\x1F\\x7F] # U+0001 to U+0008, U+000B,  U+000E to U+001F and U+007F
     141        $count = preg_match_all('/(?:
     142        [\x01-\x08\x0B\x0E-\x1F\x7F] # U+0001 to U+0008, U+000B,  U+000E to U+001F and U+007F
    148143      |
    149         \\xC2[\\x80-\\x9F] # U+0080 to U+009F
     144        \xC2[\x80-\x9F] # U+0080 to U+009F
    150145      |
    151         \\xED(?:\\xA0[\\x80-\\xFF]|[\\xA1-\\xBE][\\x00-\\xFF]|\\xBF[\\x00-\\xBF]) # U+D800 to U+DFFFF
     146        \xED(?:\xA0[\x80-\xFF]|[\xA1-\xBE][\x00-\xFF]|\xBF[\x00-\xBF]) # U+D800 to U+DFFFF
    152147      |
    153         \\xEF\\xB7[\\x90-\\xAF] # U+FDD0 to U+FDEF
     148        \xEF\xB7[\x90-\xAF] # U+FDD0 to U+FDEF
    154149      |
    155         \\xEF\\xBF[\\xBE\\xBF] # U+FFFE and U+FFFF
     150        \xEF\xBF[\xBE\xBF] # U+FFFE and U+FFFF
    156151      |
    157         [\\xF0-\\xF4][\\x8F-\\xBF]\\xBF[\\xBE\\xBF] # U+nFFFE and U+nFFFF (1 <= n <= 10_{16})
     152        [\xF0-\xF4][\x8F-\xBF]\xBF[\xBE\xBF] # U+nFFFE and U+nFFFF (1 <= n <= 10_{16})
    158153      )/x', $data, $matches);
    159154        for ($i = 0; $i < $count; ++$i) {
  • wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5/Serializer/OutputRules.php

    r2663994 r3208262  
    6666        $this->outputMode = static::IM_IN_HTML;
    6767        $this->out = $output;
    68         $this->hasHTML5 = \defined('ENT_HTML5');
     68        $this->hasHTML5 = defined('ENT_HTML5');
    6969    }
    7070    public function addRule(array $rule)
     
    178178        }
    179179        foreach ($this->xpath->query('namespace::*[not(.=../../namespace::*)]', $ele) as $nsNode) {
    180             if (!\in_array($nsNode->nodeValue, $this->implicitNamespaces)) {
     180            if (!in_array($nsNode->nodeValue, $this->implicitNamespaces)) {
    181181                $this->wr(' ')->wr($nsNode->nodeName)->wr('="')->wr($nsNode->nodeValue)->wr('"');
    182182            }
     
    198198        if ($this->outputMode == static::IM_IN_HTML) {
    199199            $this->wr('>');
     200        } else if ($ele->hasChildNodes()) {
     201            $this->wr('>');
    200202        } else {
    201             if ($ele->hasChildNodes()) {
    202                 $this->wr('>');
    203             } else {
    204                 $this->wr(' />');
    205             }
     203            $this->wr(' />');
    206204        }
    207205    }
     
    247245                continue;
    248246            }
    249             if (isset($rule['nodeName']) && !\is_array($rule['nodeName']) && $rule['nodeName'] !== $ele->localName) {
    250                 continue;
    251             }
    252             if (isset($rule['nodeName']) && \is_array($rule['nodeName']) && !\in_array($ele->localName, $rule['nodeName'], \true)) {
    253                 continue;
    254             }
    255             if (isset($rule['attrName']) && !\is_array($rule['attrName']) && $rule['attrName'] !== $attr->localName) {
    256                 continue;
    257             }
    258             if (isset($rule['attrName']) && \is_array($rule['attrName']) && !\in_array($attr->localName, $rule['attrName'], \true)) {
     247            if (isset($rule['nodeName']) && !is_array($rule['nodeName']) && $rule['nodeName'] !== $ele->localName) {
     248                continue;
     249            }
     250            if (isset($rule['nodeName']) && is_array($rule['nodeName']) && !in_array($ele->localName, $rule['nodeName'], \true)) {
     251                continue;
     252            }
     253            if (isset($rule['attrName']) && !is_array($rule['attrName']) && $rule['attrName'] !== $attr->localName) {
     254                continue;
     255            }
     256            if (isset($rule['attrName']) && is_array($rule['attrName']) && !in_array($attr->localName, $rule['attrName'], \true)) {
    259257                continue;
    260258            }
     
    304302    protected function wr($text)
    305303    {
    306         \fwrite($this->out, $text);
     304        fwrite($this->out, $text);
    307305        return $this;
    308306    }
     
    314312    protected function nl()
    315313    {
    316         \fwrite($this->out, \PHP_EOL);
     314        fwrite($this->out, \PHP_EOL);
    317315        return $this;
    318316    }
     
    353351        // convert the named character references.
    354352        if ($this->hasHTML5) {
    355             return \htmlentities($text, \ENT_HTML5 | \ENT_SUBSTITUTE | \ENT_QUOTES, 'UTF-8', \false);
     353            return htmlentities($text, \ENT_HTML5 | \ENT_SUBSTITUTE | \ENT_QUOTES, 'UTF-8', \false);
    356354        } else {
    357             return \strtr($text, HTML5Entities::$map);
     355            return strtr($text, HTML5Entities::$map);
    358356        }
    359357    }
     
    385383            $replace = array('<' => '&lt;', '>' => '&gt;', '&' => '&amp;', " " => '&nbsp;');
    386384        }
    387         return \strtr($text, $replace);
     385        return strtr($text, $replace);
    388386    }
    389387}
  • wp-typography/trunk/vendor-scoped/mundschenk-at/check-wp-requirements/README.md

    r2663994 r3208262  
    11# check-wp-requirements
    22
    3 [![Build Status](https://travis-ci.com/mundschenk-at/check-wp-requirements.svg?branch=master)](https://travis-ci.com/mundschenk-at/check-wp-requirements)
     3![Build Status](https://github.com/mundschenk-at/check-wp-requirements/actions/workflows/ci.yml/badge.svg)
    44[![Latest Stable Version](https://poser.pugx.org/mundschenk-at/check-wp-requirements/v/stable)](https://packagist.org/packages/mundschenk-at/check-wp-requirements)
    5 [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/mundschenk-at/check-wp-requirements/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/mundschenk-at/check-wp-requirements/?branch=master)
    6 [![Code Coverage](https://scrutinizer-ci.com/g/mundschenk-at/check-wp-requirements/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/mundschenk-at/check-wp-requirements/?branch=master)
     5[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=mundschenk-at_check-wp-requirements&metric=coverage)](https://sonarcloud.io/dashboard?id=mundschenk-at_check-wp-requirements)
    76[![License](https://poser.pugx.org/mundschenk-at/check-wp-requirements/license)](https://packagist.org/packages/mundschenk-at/check-wp-requirements)
    87
     
    1110## Requirements
    1211
    13 *   PHP 5.6.0 or above
     12*   PHP 7.4.0 or above
    1413*   WordPress 5.2 or higher.
    1514
     
    4039
    4140    $requirements = new \Mundschenk\WP_Requirements( 'Your Plugin Name', __FILE__, 'your-textdomain', [
    42         'php'       => '5.6.0',
     41        'php'       => '8.1.0',
    4342        'multibyte' => true,
    4443        'utf-8'     => false,
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/IANA/tlds-alpha-by-domain.txt

    r2852644 r3208262  
    1 # Version 2023012200, Last Updated Sun Jan 22 07:07:02 2023 UTC
     1# Version 2024121500, Last Updated Sun Dec 15 07:07:01 2024 UTC
    22AAA
    33AARP
    4 ABARTH
    54ABB
    65ABBOTT
     
    3736AKDN
    3837AL
    39 ALFAROMEO
    4038ALIBABA
    4139ALIPAY
     
    8886AUTO
    8987AUTOS
    90 AVIANCA
    9188AW
    9289AWS
     
    9996BAIDU
    10097BANAMEX
    101 BANANAREPUBLIC
    10298BAND
    10399BANK
     
    216212CBN
    217213CBRE
    218 CBS
    219214CC
    220215CD
     
    245240CITIC
    246241CITY
    247 CITYEATS
    248242CK
    249243CL
     
    266260COLOGNE
    267261COM
    268 COMCAST
    269262COMMBANK
    270263COMMUNITY
     
    279272CONTRACTORS
    280273COOKING
    281 COOKINGCHANNEL
    282274COOL
    283275COOP
     
    306298CYOU
    307299CZ
    308 DABUR
    309300DAD
    310301DANCE
     
    385376ESTATE
    386377ET
    387 ETISALAT
    388378EU
    389379EUROVISION
     
    411401FERRERO
    412402FI
    413 FIAT
    414403FIDELITY
    415404FIDO
     
    437426FOO
    438427FOOD
    439 FOODNETWORK
    440428FOOTBALL
    441429FORD
     
    450438FRL
    451439FROGANS
    452 FRONTDOOR
    453440FRONTIER
    454441FTR
     
    522509GT
    523510GU
    524 GUARDIAN
    525511GUCCI
    526512GUGE
     
    543529HERE
    544530HERMES
    545 HGTV
    546531HIPHOP
    547532HISAMITSU
     
    565550HOSTING
    566551HOT
    567 HOTELES
    568552HOTELS
    569553HOTMAIL
     
    653637KIDS
    654638KIM
    655 KINDER
    656639KINDLE
    657640KITCHEN
     
    678661LAMER
    679662LANCASTER
    680 LANCIA
    681663LAND
    682664LANDROVER
     
    709691LIMO
    710692LINCOLN
    711 LINDE
    712693LINK
    713694LIPSY
     
    740721LY
    741722MA
    742 MACYS
    743723MADRID
    744724MAIF
     
    754734MARRIOTT
    755735MARSHALLS
    756 MASERATI
    757736MATTEL
    758737MBA
     
    814793MUSEUM
    815794MUSIC
    816 MUTUAL
    817795MV
    818796MW
     
    824802NAGOYA
    825803NAME
    826 NATURA
    827804NAVY
    828805NBA
     
    855832NO
    856833NOKIA
    857 NORTHWESTERNMUTUAL
    858834NORTON
    859835NOW
     
    874850OLAYAN
    875851OLAYANGROUP
    876 OLDNAVY
    877852OLLO
    878853OM
     
    901876PARTS
    902877PARTY
    903 PASSAGENS
    904878PAY
    905879PCCW
     
    1002976RIP
    1003977RO
    1004 ROCHER
    1005978ROCKS
    1006979RODEO
     
    10371010SBS
    10381011SC
    1039 SCA
    10401012SCB
    10411013SCHAEFFLER
     
    10661038SHANGRILA
    10671039SHARP
    1068 SHAW
    10691040SHELL
    10701041SHIA
     
    10751046SHOUJI
    10761047SHOW
    1077 SHOWTIME
    10781048SI
    10791049SILK
     
    11731143TICKETS
    11741144TIENDA
    1175 TIFFANY
    11761145TIPS
    11771146TIRES
     
    12031172TRAINING
    12041173TRAVEL
    1205 TRAVELCHANNEL
    12061174TRAVELERS
    12071175TRAVELERSINSURANCE
     
    12581226VN
    12591227VODKA
    1260 VOLKSWAGEN
    12611228VOLVO
    12621229VOTE
     
    12651232VOYAGE
    12661233VU
    1267 VUELOS
    12681234WALES
    12691235WALMART
     
    13031269XBOX
    13041270XEROX
    1305 XFINITY
    13061271XIHUAN
    13071272XIN
     
    13941359XN--MGBA3A4F16A
    13951360XN--MGBA7C0BBN0A
    1396 XN--MGBAAKC7DVF
    13971361XN--MGBAAM7A8H
    13981362XN--MGBAB2BD
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/class-dom.php

    r2819294 r3208262  
    195195            $func = Strings::functions($textnode->data);
    196196            if (!empty($func)) {
    197                 return \preg_replace('/\\p{C}/Su', '', $func['substr']($textnode->data, $position, $length));
     197                return \preg_replace('/\p{C}/Su', '', $func['substr']($textnode->data, $position, $length));
    198198            }
    199199        }
     
    392392 * @since 4.2.0
    393393 */
    394 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\DOM', 'PHP_Typography\\DOM', \false);
     394\class_alias('WP_Typography\Vendor\PHP_Typography\DOM', 'PHP_Typography\DOM', \false);
    395395/**
    396396 *  Initialize block tags on load.
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/class-hyphenator.php

    r2819294 r3208262  
    103103     * @param array<string,string> $exceptions Optional. An array of words with all hyphenation points marked with a hard hyphen. Default empty array.
    104104     */
    105     public function set_custom_exceptions(array $exceptions = []) : void
     105    public function set_custom_exceptions(array $exceptions = []): void
    106106    {
    107107        if (empty($exceptions) && empty($this->custom_exceptions)) {
     
    298298                    $value = $pattern_offset[0];
    299299                    $offset = $pattern_offset[1] + $start - 1;
    300                     $word_pattern[$offset] = isset($word_pattern[$offset]) ? \max($word_pattern[$offset], $value) : $value;
     300                    $word_pattern[$offset] = isset($word_pattern[$offset]) ? max($word_pattern[$offset], $value) : $value;
    301301                }
    302302            }
     
    308308     * generates patterns for all of them.
    309309     */
    310     protected function merge_hyphenation_exceptions() : void
     310    protected function merge_hyphenation_exceptions(): void
    311311    {
    312312        $exceptions = [];
    313313        // Merge custom and language specific word hyphenations.
    314314        if (!empty($this->pattern_exceptions) && !empty($this->custom_exceptions)) {
    315             $exceptions = \array_merge($this->custom_exceptions, $this->pattern_exceptions);
     315            $exceptions = array_merge($this->custom_exceptions, $this->pattern_exceptions);
    316316        } elseif (!empty($this->pattern_exceptions)) {
    317317            $exceptions = $this->pattern_exceptions;
     
    378378 * @since 3.4.0
    379379 */
    380 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Hyphenator', 'PHP_Typography\\Hyphenator', \false);
     380\class_alias('WP_Typography\Vendor\PHP_Typography\Hyphenator', 'PHP_Typography\Hyphenator', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/class-php-typography.php

    r2819294 r3208262  
    164164     * @param bool     $is_title   A flag indicating whether the HTML fragment in the DOM is a title.
    165165     */
    166     private function process_textnodes_internal(\DOMNode $body_node, callable $fixer, Settings $settings, bool $is_title) : void
     166    private function process_textnodes_internal(\DOMNode $body_node, callable $fixer, Settings $settings, bool $is_title): void
    167167    {
    168168        // Get the list of tags that should be ignored.
     
    393393     * @param Hyphenator\Cache $cache A hyphenator cache instance.
    394394     */
    395     public function set_hyphenator_cache(Hyphenator\Cache $cache) : void
     395    public function set_hyphenator_cache(Hyphenator\Cache $cache): void
    396396    {
    397397        $this->hyphenator_cache = $cache;
     
    424424            if ('.json' === \substr($file, -5)) {
    425425                $file_content = (string) \file_get_contents($path . $file);
    426                 if (\preg_match('/"language"\\s*:\\s*((".+")|(\'.+\'))\\s*,/', $file_content, $matches)) {
     426                if (\preg_match('/"language"\s*:\s*((".+")|(\'.+\'))\s*,/', $file_content, $matches)) {
    427427                    $language_name = \substr($matches[1], 1, -1);
    428428                    $language_code = \substr($file, 0, -5);
     
    476476 *  @author Peter Putzer <github@mundschenk.at>
    477477 */
    478 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\PHP_Typography', 'PHP_Typography\\PHP_Typography', \false);
     478\class_alias('WP_Typography\Vendor\PHP_Typography\PHP_Typography', 'PHP_Typography\PHP_Typography', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/class-re.php

    r2819294 r3208262  
    4949     */
    5050    const HTML_SPACES = '
    51         \\x{00a0}       # no-break space
     51        \x{00a0}        # no-break space
    5252        |
    53         \\x{1361}       # ethiopic wordspace
     53        \x{1361}        # ethiopic wordspace
    5454        |
    55         \\x{2000}       # en quad-space
     55        \x{2000}        # en quad-space
    5656        |
    57         \\x{2001}       # em quad-space
     57        \x{2001}        # em quad-space
    5858        |
    59         \\x{2002}       # en space
     59        \x{2002}        # en space
    6060        |
    61         \\x{2003}       # em space
     61        \x{2003}        # em space
    6262        |
    63         \\x{2004}       # three-per-em space
     63        \x{2004}        # three-per-em space
    6464        |
    65         \\x{2005}       # four-per-em space
     65        \x{2005}        # four-per-em space
    6666        |
    67         \\x{2006}       # six-per-em space
     67        \x{2006}        # six-per-em space
    6868        |
    69         \\x{2007}       # figure space
     69        \x{2007}        # figure space
    7070        |
    71         \\x{2008}       # punctuation space
     71        \x{2008}        # punctuation space
    7272        |
    73         \\x{2009}       # thin space
     73        \x{2009}        # thin space
    7474        |
    75         \\x{200a}       # hair space
     75        \x{200a}        # hair space
    7676        |
    77         \\x{200b}       # zero-width space
     77        \x{200b}        # zero-width space
    7878        |
    79         \\x{200c}       # zero-width joiner
     79        \x{200c}        # zero-width joiner
    8080        |
    81         \\x{200d}       # zero-width non-joiner
     81        \x{200d}        # zero-width non-joiner
    8282        |
    83         \\x{202f}       # narrow no-break space
     83        \x{202f}        # narrow no-break space
    8484        |
    85         \\x{205f}       # medium mathematical space
     85        \x{205f}        # medium mathematical space
    8686        |
    87         \\x{3000}       # ideographic space
     87        \x{3000}        # ideographic space
    8888        ';
    8989    // required modifiers: x (multiline pattern) i (case insensitive) u (utf8).
     
    152152    public static function escape_tags($tags)
    153153    {
    154         return \str_replace(['<', '>'], [self::ESCAPED_HTML_OPEN, self::ESCAPED_HTML_CLOSE], $tags);
     154        return str_replace(['<', '>'], [self::ESCAPED_HTML_OPEN, self::ESCAPED_HTML_CLOSE], $tags);
    155155    }
    156156    /**
     
    163163    public static function unescape_tags($tags)
    164164    {
    165         return \str_replace([self::ESCAPED_HTML_OPEN, self::ESCAPED_HTML_CLOSE], ['<', '>'], $tags);
     165        return str_replace([self::ESCAPED_HTML_OPEN, self::ESCAPED_HTML_CLOSE], ['<', '>'], $tags);
    166166    }
    167167}
     
    171171 * @since 5.0.0
    172172 */
    173 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\RE', 'PHP_Typography\\RE', \false);
     173\class_alias('WP_Typography\Vendor\PHP_Typography\RE', 'PHP_Typography\RE', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/class-settings.php

    r2819294 r3208262  
    199199     * @param mixed  $value The settings value.
    200200     */
    201     public function __set($key, $value) : void
     201    public function __set($key, $value): void
    202202    {
    203203        $this->data[$key] = $value;
     
    219219     * @param string $key The settings key.
    220220     */
    221     public function __unset($key) : void
     221    public function __unset($key): void
    222222    {
    223223        unset($this->data[$key]);
     
    229229     * @param mixed  $value  The settings value.
    230230     */
    231     public function offsetSet($offset, $value) : void
     231    public function offsetSet($offset, $value): void
    232232    {
    233233        if (!empty($offset)) {
     
    240240     * @param string $offset The settings key.
    241241     */
    242     public function offsetExists($offset) : bool
     242    public function offsetExists($offset): bool
    243243    {
    244244        return isset($this->data[$offset]);
     
    249249     * @param string $offset The settings key.
    250250     */
    251     public function offsetUnset($offset) : void
     251    public function offsetUnset($offset): void
    252252    {
    253253        unset($this->data[$offset]);
     
    283283     * @param  string $new_char The character to actually use.
    284284     */
    285     public function remap_character($char, $new_char) : void
     285    public function remap_character($char, $new_char): void
    286286    {
    287287        if ($char !== $new_char) {
     
    371371     * (Re)set various options to their default values.
    372372     */
    373     public function set_defaults() : void
     373    public function set_defaults(): void
    374374    {
    375375        // General attributes.
     
    438438     * @param bool $on Optional. Default false.
    439439     */
    440     public function set_ignore_parser_errors($on = \false) : void
     440    public function set_ignore_parser_errors($on = \false): void
    441441    {
    442442        $this->data[self::PARSER_ERRORS_IGNORE] = $on;
     
    449449     * @param callable|null $handler Optional. A callable that takes an array of error strings as its parameter. Default null.
    450450     */
    451     public function set_parser_errors_handler(callable $handler = null) : void
     451    public function set_parser_errors_handler(callable $handler = null): void
    452452    {
    453453        $this->data[self::PARSER_ERRORS_HANDLER] = $handler;
     
    460460     * @param bool $on Optional. Default false.
    461461     */
    462     public function set_true_no_break_narrow_space($on = \false) : void
     462    public function set_true_no_break_narrow_space($on = \false): void
    463463    {
    464464        if ($on) {
     
    473473     * @param string|string[] $tags A comma separated list or an array of tag names.
    474474     */
    475     public function set_tags_to_ignore($tags = ['code', 'head', 'kbd', 'object', 'option', 'pre', 'samp', 'script', 'noscript', 'noembed', 'select', 'style', 'textarea', 'title', 'var', 'math']) : void
     475    public function set_tags_to_ignore($tags = ['code', 'head', 'kbd', 'object', 'option', 'pre', 'samp', 'script', 'noscript', 'noembed', 'select', 'style', 'textarea', 'title', 'var', 'math']): void
    476476    {
    477477        // Ensure that we pass only lower-case tag names to XPath.
    478         $tags = \array_filter(\array_map('strtolower', Strings::maybe_split_parameters($tags)), 'ctype_alnum');
    479         $this->data[self::IGNORE_TAGS] = \array_unique(\array_merge($tags, \array_flip(DOM::inappropriate_tags())));
     478        $tags = array_filter(array_map('strtolower', Strings::maybe_split_parameters($tags)), 'ctype_alnum');
     479        $this->data[self::IGNORE_TAGS] = array_unique(array_merge($tags, array_flip(DOM::inappropriate_tags())));
    480480    }
    481481    /**
     
    484484     * @param string|string[] $classes A comma separated list or an array of class names.
    485485     */
    486     public function set_classes_to_ignore($classes = ['vcard', 'noTypo']) : void
     486    public function set_classes_to_ignore($classes = ['vcard', 'noTypo']): void
    487487    {
    488488        $this->data[self::IGNORE_CLASSES] = Strings::maybe_split_parameters($classes);
     
    493493     * @param string|string[] $ids A comma separated list or an array of tag names.
    494494     */
    495     public function set_ids_to_ignore($ids = []) : void
     495    public function set_ids_to_ignore($ids = []): void
    496496    {
    497497        $this->data[self::IGNORE_IDS] = Strings::maybe_split_parameters($ids);
     
    502502     * @param bool $on Optional. Default true.
    503503     */
    504     public function set_smart_quotes($on = \true) : void
     504    public function set_smart_quotes($on = \true): void
    505505    {
    506506        $this->data[self::SMART_QUOTES] = $on;
     
    530530     * @throws \DomainException Thrown if $style constant is invalid.
    531531     */
    532     public function set_smart_quotes_primary($style = Quote_Style::DOUBLE_CURLED) : void
     532    public function set_smart_quotes_primary($style = Quote_Style::DOUBLE_CURLED): void
    533533    {
    534534        $this->primary_quote_style = $this->get_quote_style($style);
     
    558558     * @throws \DomainException Thrown if $style constant is invalid.
    559559     */
    560     public function set_smart_quotes_secondary($style = Quote_Style::SINGLE_CURLED) : void
     560    public function set_smart_quotes_secondary($style = Quote_Style::SINGLE_CURLED): void
    561561    {
    562562        $this->secondary_quote_style = $this->get_quote_style($style);
     
    582582     *                             Default a list of English words beginning with an apostrophy.
    583583     */
    584     public function set_smart_quotes_exceptions($exceptions = ["'tain't" => U::APOSTROPHE . 'tain' . U::APOSTROPHE . 't', "'twere" => U::APOSTROPHE . 'twere', "'twas" => U::APOSTROPHE . 'twas', "'tis" => U::APOSTROPHE . 'tis', "'til" => U::APOSTROPHE . 'til', "'bout" => U::APOSTROPHE . 'bout', "'nuff" => U::APOSTROPHE . 'nuff', "'round" => U::APOSTROPHE . 'round', "'cause" => U::APOSTROPHE . 'cause', "'splainin" => U::APOSTROPHE . 'splainin', "'em'" => U::APOSTROPHE . 'em']) : void
     584    public function set_smart_quotes_exceptions($exceptions = ["'tain't" => U::APOSTROPHE . 'tain' . U::APOSTROPHE . 't', "'twere" => U::APOSTROPHE . 'twere', "'twas" => U::APOSTROPHE . 'twas', "'tis" => U::APOSTROPHE . 'tis', "'til" => U::APOSTROPHE . 'til', "'bout" => U::APOSTROPHE . 'bout', "'nuff" => U::APOSTROPHE . 'nuff', "'round" => U::APOSTROPHE . 'round', "'cause" => U::APOSTROPHE . 'cause', "'splainin" => U::APOSTROPHE . 'splainin', "'em'" => U::APOSTROPHE . 'em']): void
    585585    {
    586586        $this->data[self::SMART_QUOTES_EXCEPTIONS] = ['patterns' => \array_keys($exceptions), 'replacements' => \array_values($exceptions)];
     
    618618     * @param bool $on Optional. Default true.
    619619     */
    620     public function set_smart_dashes($on = \true) : void
     620    public function set_smart_dashes($on = \true): void
    621621    {
    622622        $this->data[self::SMART_DASHES] = $on;
     
    633633     * @throws \DomainException Thrown if $style constant is invalid.
    634634     */
    635     public function set_smart_dashes_style($style = Dash_Style::TRADITIONAL_US) : void
     635    public function set_smart_dashes_style($style = Dash_Style::TRADITIONAL_US): void
    636636    {
    637637        $this->dash_style = $this->get_style($style, Settings\Dashes::class, [Dash_Style::class, 'get_styled_dashes'], 'dash');
     
    642642     * @param bool $on Optional. Default true.
    643643     */
    644     public function set_smart_ellipses($on = \true) : void
     644    public function set_smart_ellipses($on = \true): void
    645645    {
    646646        $this->data[self::SMART_ELLIPSES] = $on;
     
    651651     * @param bool $on Optional. Default true.
    652652     */
    653     public function set_smart_diacritics($on = \true) : void
     653    public function set_smart_diacritics($on = \true): void
    654654    {
    655655        $this->data[self::SMART_DIACRITICS] = $on;
     
    660660     * @param string $lang Has to correspond to a filename in 'diacritics'. Optional. Default 'en-US'.
    661661     */
    662     public function set_diacritic_language($lang = 'en-US') : void
     662    public function set_diacritic_language($lang = 'en-US'): void
    663663    {
    664664        if (isset($this->data[self::DIACRITIC_LANGUAGE]) && $this->data[self::DIACRITIC_LANGUAGE] === $lang) {
     
    684684     *                                                         or a string formatted `"needle"=>"replacement","needle"=>"replacement",...
    685685     */
    686     public function set_diacritic_custom_replacements($custom_replacements = []) : void
     686    public function set_diacritic_custom_replacements($custom_replacements = []): void
    687687    {
    688688        if (!\is_array($custom_replacements)) {
     
    711711        foreach (\preg_split('/,/', $custom_replacements, -1, \PREG_SPLIT_NO_EMPTY) ?: [] as $replacement) {
    712712            // phpcs:ignore WordPress.PHP.DisallowShortTernary -- Ensure array type in case of error.
    713             if (\preg_match('/(?<kquo>"|\')(?<key>(?:(?!\\k<kquo>).)+)\\k<kquo>\\s*=>\\s*(?<rquo>"|\')(?<replacement>(?:(?!\\k<rquo>).)+)\\k<rquo>/', $replacement, $match)) {
     713            if (\preg_match('/(?<kquo>"|\')(?<key>(?:(?!\k<kquo>).)+)\k<kquo>\s*=>\s*(?<rquo>"|\')(?<replacement>(?:(?!\k<rquo>).)+)\k<rquo>/', $replacement, $match)) {
    714714                $replacements[$match['key']] = $match['replacement'];
    715715            }
     
    732732     * @return array<T>
    733733     */
    734     protected static function array_map_assoc(callable $callback, array $array) : array
     734    protected static function array_map_assoc(callable $callback, array $array): array
    735735    {
    736736        $new = [];
     
    749749     * when the custom replacements are updated.
    750750     */
    751     private function update_diacritics_replacement_arrays() : void
     751    private function update_diacritics_replacement_arrays(): void
    752752    {
    753753        $patterns = [];
     
    768768     * @param array<string,string> $replacements     Resulting replacements. Passed by reference.
    769769     */
    770     private function parse_diacritics_rules(array $diacritics_rules, array &$patterns, array &$replacements) : void
     770    private function parse_diacritics_rules(array $diacritics_rules, array &$patterns, array &$replacements): void
    771771    {
    772772        foreach ($diacritics_rules as $needle => $replacement) {
    773             $patterns[] = '/\\b(?<!\\w[' . U::NO_BREAK_SPACE . U::SOFT_HYPHEN . '])' . $needle . '\\b(?![' . U::NO_BREAK_SPACE . U::SOFT_HYPHEN . ']\\w)/u';
     773            $patterns[] = '/\b(?<!\w[' . U::NO_BREAK_SPACE . U::SOFT_HYPHEN . '])' . $needle . '\b(?![' . U::NO_BREAK_SPACE . U::SOFT_HYPHEN . ']\w)/u';
    774774            $replacements[$needle] = $replacement;
    775775        }
     
    780780     * @param bool $on Optional. Default true.
    781781     */
    782     public function set_smart_marks($on = \true) : void
     782    public function set_smart_marks($on = \true): void
    783783    {
    784784        $this->data[self::SMART_MARKS] = $on;
     
    789789     * @param bool $on Optional. Default true.
    790790     */
    791     public function set_smart_math($on = \true) : void
     791    public function set_smart_math($on = \true): void
    792792    {
    793793        $this->data[self::SMART_MATH] = $on;
     
    798798     * @param bool $on Optional. Default true.
    799799     */
    800     public function set_smart_exponents($on = \true) : void
     800    public function set_smart_exponents($on = \true): void
    801801    {
    802802        $this->data[self::SMART_EXPONENTS] = $on;
     
    807807     * @param bool $on Optional. Default true.
    808808     */
    809     public function set_smart_fractions($on = \true) : void
     809    public function set_smart_fractions($on = \true): void
    810810    {
    811811        $this->data[self::SMART_FRACTIONS] = $on;
     
    816816     * @param bool $on Optional. Default true.
    817817     */
    818     public function set_smart_ordinal_suffix($on = \true) : void
     818    public function set_smart_ordinal_suffix($on = \true): void
    819819    {
    820820        $this->data[self::SMART_ORDINAL_SUFFIX] = $on;
     
    827827     * @param bool $on Optional. Default false.
    828828     */
    829     public function set_smart_ordinal_suffix_match_roman_numerals($on = \false) : void
     829    public function set_smart_ordinal_suffix_match_roman_numerals($on = \false): void
    830830    {
    831831        $this->data[self::SMART_ORDINAL_SUFFIX_ROMAN_NUMERALS] = $on;
     
    836836     * @param bool $on Optional. Default true.
    837837     */
    838     public function set_smart_area_units($on = \true) : void
     838    public function set_smart_area_units($on = \true): void
    839839    {
    840840        $this->data[self::SMART_AREA_UNITS] = $on;
     
    845845     * @param bool $on Optional. Default true.
    846846     */
    847     public function set_single_character_word_spacing($on = \true) : void
     847    public function set_single_character_word_spacing($on = \true): void
    848848    {
    849849        $this->data[self::SINGLE_CHARACTER_WORD_SPACING] = $on;
     
    854854     * @param bool $on Optional. Default true.
    855855     */
    856     public function set_fraction_spacing($on = \true) : void
     856    public function set_fraction_spacing($on = \true): void
    857857    {
    858858        $this->data[self::FRACTION_SPACING] = $on;
     
    863863     * @param bool $on Optional. Default true.
    864864     */
    865     public function set_unit_spacing($on = \true) : void
     865    public function set_unit_spacing($on = \true): void
    866866    {
    867867        $this->data[self::UNIT_SPACING] = $on;
     
    872872     * @param bool $on Optional. Default true.
    873873     */
    874     public function set_numbered_abbreviation_spacing($on = \true) : void
     874    public function set_numbered_abbreviation_spacing($on = \true): void
    875875    {
    876876        $this->data[self::NUMBERED_ABBREVIATION_SPACING] = $on;
     
    883883     * @param bool $on Optional. Default false.
    884884     */
    885     public function set_french_punctuation_spacing($on = \false) : void
     885    public function set_french_punctuation_spacing($on = \false): void
    886886    {
    887887        $this->data[self::FRENCH_PUNCTUATION_SPACING] = $on;
     
    892892     * @param string|string[] $units A comma separated list or an array of units.
    893893     */
    894     public function set_units($units = []) : void
     894    public function set_units($units = []): void
    895895    {
    896896        $this->data[self::UNITS] = Strings::maybe_split_parameters($units);
     
    921921     * @param bool $on Optional. Default true.
    922922     */
    923     public function set_dash_spacing($on = \true) : void
     923    public function set_dash_spacing($on = \true): void
    924924    {
    925925        $this->data[self::DASH_SPACING] = $on;
     
    930930     * @param bool $on Optional. Default true.
    931931     */
    932     public function set_space_collapse($on = \true) : void
     932    public function set_space_collapse($on = \true): void
    933933    {
    934934        $this->data[self::SPACE_COLLAPSE] = $on;
     
    939939     * @param bool $on Optional. Default true.
    940940     */
    941     public function set_dewidow($on = \true) : void
     941    public function set_dewidow($on = \true): void
    942942    {
    943943        $this->data[self::DEWIDOW] = $on;
     
    948948     * @param int $length Defaults to 5. Trying to set the value to less than 2 resets the length to the default.
    949949     */
    950     public function set_max_dewidow_length($length = 5) : void
     950    public function set_max_dewidow_length($length = 5): void
    951951    {
    952952        $length = $length > 1 ? $length : 5;
     
    958958     * @param int $number Defaults to 1. Only 1, 2 and 3 are valid.
    959959     */
    960     public function set_dewidow_word_number($number = 1) : void
     960    public function set_dewidow_word_number($number = 1): void
    961961    {
    962962        $number = $number > 3 || $number < 1 ? 1 : $number;
     
    968968     * @param int $length Defaults to 5. Trying to set the value to less than 2 resets the length to the default.
    969969     */
    970     public function set_max_dewidow_pull($length = 5) : void
     970    public function set_max_dewidow_pull($length = 5): void
    971971    {
    972972        $length = $length > 1 ? $length : 5;
     
    978978     * @param bool $on Optional. Default true.
    979979     */
    980     public function set_wrap_hard_hyphens($on = \true) : void
     980    public function set_wrap_hard_hyphens($on = \true): void
    981981    {
    982982        $this->data[self::HYPHEN_HARD_WRAP] = $on;
     
    987987     * @param bool $on Optional. Default true.
    988988     */
    989     public function set_url_wrap($on = \true) : void
     989    public function set_url_wrap($on = \true): void
    990990    {
    991991        $this->data[self::URL_WRAP] = $on;
     
    996996     * @param bool $on Optional. Default true.
    997997     */
    998     public function set_email_wrap($on = \true) : void
     998    public function set_email_wrap($on = \true): void
    999999    {
    10001000        $this->data[self::EMAIL_WRAP] = $on;
     
    10051005     * @param int $length Defaults to 5. Trying to set the value to less than 1 resets the length to the default.
    10061006     */
    1007     public function set_min_after_url_wrap($length = 5) : void
     1007    public function set_min_after_url_wrap($length = 5): void
    10081008    {
    10091009        $length = $length > 0 ? $length : 5;
     
    10151015     * @param bool $on Optional. Default true.
    10161016     */
    1017     public function set_style_ampersands($on = \true) : void
     1017    public function set_style_ampersands($on = \true): void
    10181018    {
    10191019        $this->data[self::STYLE_AMPERSANDS] = $on;
     
    10241024     * @param bool $on Optional. Default true.
    10251025     */
    1026     public function set_style_caps($on = \true) : void
     1026    public function set_style_caps($on = \true): void
    10271027    {
    10281028        $this->data[self::STYLE_CAPS] = $on;
     
    10331033     * @param bool $on Optional. Default true.
    10341034     */
    1035     public function set_style_initial_quotes($on = \true) : void
     1035    public function set_style_initial_quotes($on = \true): void
    10361036    {
    10371037        $this->data[self::STYLE_INITIAL_QUOTES] = $on;
     
    10421042     * @param bool $on Optional. Default true.
    10431043     */
    1044     public function set_style_numbers($on = \true) : void
     1044    public function set_style_numbers($on = \true): void
    10451045    {
    10461046        $this->data[self::STYLE_NUMBERS] = $on;
     
    10511051     * @param bool $on Optional. Default true.
    10521052     */
    1053     public function set_style_hanging_punctuation($on = \true) : void
     1053    public function set_style_hanging_punctuation($on = \true): void
    10541054    {
    10551055        $this->data[self::STYLE_HANGING_PUNCTUATION] = $on;
     
    10601060     * @param string|string[] $tags A comma separated list or an array of tag names.
    10611061     */
    1062     public function set_initial_quote_tags($tags = ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'li', 'dd', 'dt']) : void
     1062    public function set_initial_quote_tags($tags = ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'li', 'dd', 'dt']): void
    10631063    {
    10641064        // Make array if handed a list of tags as a string.
     
    10751075     * @param bool $on Optional. Default true.
    10761076     */
    1077     public function set_hyphenation($on = \true) : void
     1077    public function set_hyphenation($on = \true): void
    10781078    {
    10791079        $this->data[self::HYPHENATION] = $on;
     
    10841084     * @param string $lang Has to correspond to a filename in 'lang'. Optional. Default 'en-US'.
    10851085     */
    1086     public function set_hyphenation_language($lang = 'en-US') : void
     1086    public function set_hyphenation_language($lang = 'en-US'): void
    10871087    {
    10881088        if (isset($this->data[self::HYPHENATION_LANGUAGE]) && $this->data[self::HYPHENATION_LANGUAGE] === $lang) {
     
    10971097     * @param int $length Defaults to 5. Trying to set the value to less than 2 resets the length to the default.
    10981098     */
    1099     public function set_min_length_hyphenation($length = 5) : void
     1099    public function set_min_length_hyphenation($length = 5): void
    11001100    {
    11011101        $length = $length > 1 ? $length : 5;
     
    11071107     * @param int $length Defaults to 3. Trying to set the value to less than 1 resets the length to the default.
    11081108     */
    1109     public function set_min_before_hyphenation($length = 3) : void
     1109    public function set_min_before_hyphenation($length = 3): void
    11101110    {
    11111111        $length = $length > 0 ? $length : 3;
     
    11171117     * @param int $length Defaults to 2. Trying to set the value to less than 1 resets the length to the default.
    11181118     */
    1119     public function set_min_after_hyphenation($length = 2) : void
     1119    public function set_min_after_hyphenation($length = 2): void
    11201120    {
    11211121        $length = $length > 0 ? $length : 2;
     
    11271127     * @param bool $on Optional. Default true.
    11281128     */
    1129     public function set_hyphenate_headings($on = \true) : void
     1129    public function set_hyphenate_headings($on = \true): void
    11301130    {
    11311131        $this->data[self::HYPHENATE_HEADINGS] = $on;
     
    11361136     * @param bool $on Optional. Default true.
    11371137     */
    1138     public function set_hyphenate_all_caps($on = \true) : void
     1138    public function set_hyphenate_all_caps($on = \true): void
    11391139    {
    11401140        $this->data[self::HYPHENATE_ALL_CAPS] = $on;
     
    11451145     * @param bool $on Optional. Default true.
    11461146     */
    1147     public function set_hyphenate_title_case($on = \true) : void
     1147    public function set_hyphenate_title_case($on = \true): void
    11481148    {
    11491149        $this->data[self::HYPHENATE_TITLE_CASE] = $on;
     
    11541154     * @param bool $on Optional. Default true.
    11551155     */
    1156     public function set_hyphenate_compounds($on = \true) : void
     1156    public function set_hyphenate_compounds($on = \true): void
    11571157    {
    11581158        $this->data[self::HYPHENATE_COMPOUNDS] = $on;
     
    11641164     *        In the latter case, only alphanumeric characters and hyphens are recognized. The default is empty.
    11651165     */
    1166     public function set_hyphenation_exceptions($exceptions = []) : void
     1166    public function set_hyphenation_exceptions($exceptions = []): void
    11671167    {
    11681168        $this->data[self::HYPHENATION_CUSTOM_EXCEPTIONS] = Strings::maybe_split_parameters($exceptions);
     
    11971197 * @implements \ArrayAccess<string,mixed>
    11981198 */
    1199 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Settings', 'PHP_Typography\\Settings', \false);
     1199\class_alias('WP_Typography\Vendor\PHP_Typography\Settings', 'PHP_Typography\Settings', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/class-strings.php

    r2819294 r3208262  
    5151     * @var string
    5252     */
    53     const RE_PARAMETER_SPLITTING = '/[\\s,]+/S';
     53    const RE_PARAMETER_SPLITTING = '/[\s,]+/S';
    5454    /**
    5555     * An array of encodings in detection order.
     
    131131        $json = '"';
    132132        foreach ($codes as $code) {
    133             $json .= \sprintf('\\u%04x', $code);
     133            $json .= \sprintf('\u%04x', $code);
    134134        }
    135135        $json .= '"';
     
    167167 * }
    168168 */
    169 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Strings', 'PHP_Typography\\Strings', \false);
     169\class_alias('WP_Typography\Vendor\PHP_Typography\Strings', 'PHP_Typography\Strings', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/class-text-parser.php

    r2819294 r3208262  
    7171                |
    7272                (?:                                     # decimal matches
    73                     &\\#
     73                    &\#
    7474                    (?: 09|1[03]|32|160|4961|5760|819[2-9]|820[0-2]|8239|8287|12288 )
    7575                    ;
     
    7777                |
    7878                (?:                                     # hexidecimal matches
    79                     &\\#x
     79                    &\#x
    8080                    (?: 000[9ad]|0020|00a0|1361|1680|200[0-9a]|202f|205f|3000 )
    8181                    ;
     
    8383                |
    8484                (?:                                     # actual characters
    85                     \\x{0009}|\\x{000a}|\\x{000d}|\\x{0020}|\\x{00a0}|\\x{1361}|\\x{2000}|\\x{2001}|\\x{2002}|\\x{2003}|
    86                     \\x{2004}|\\x{2005}|\\x{2006}|\\x{2007}|\\x{2008}|\\x{2009}|\\x{200a}|\\x{202f}|\\x{205f}|\\x{3000}
     85                    \x{0009}|\x{000a}|\x{000d}|\x{0020}|\x{00a0}|\x{1361}|\x{2000}|\x{2001}|\x{2002}|\x{2003}|
     86                    \x{2004}|\x{2005}|\x{2006}|\x{2007}|\x{2008}|\x{2009}|\x{200a}|\x{202f}|\x{205f}|\x{3000}
    8787                )
    8888            )
    8989        ';
    9090    // required modifiers: x (multiline pattern) i (case insensitive) u (utf8).
    91     private const SPACE = '(?:\\s|' . self::HTML_SPACING . ')+';
     91    private const SPACE = '(?:\s|' . self::HTML_SPACING . ')+';
    9292    // required modifiers: x (multiline pattern) i (case insensitive) $utf8.
    9393    /**
     
    115115                |
    116116                (?:                                     # decimal matches
    117                     &\\#
     117                    &\#
    118118                    (?: 3[3-9]|4[0-467]|5[89]|6[02-4]|9[1-46]|12[3-6]|16[1-9]|17[0-24-9]|18[0-9]|19[01]|215|247|710|732|97[78]|982|821[1-9]|822[0-9]|823[01]|82[4-7][0-9]|828[0-6]|8289|829[0-2]|835[2-9]|86[6-9][0-9]|844[89]|84[5-9][0-9]|851[0-9]|852[0-7]|859[2-9]|85[6-9][0-9]|8[6-9][0-9][0-9]|9[01][0-9][0-9]|920[0-9]|921[0-5]|963[2-9]|96[4-9][0-9]|9[78][0-9][0-9]|99[0-7][0-9]|998[0-3]|1177[6-9]|117[89][0-9]|118[0-9][0-9]|1190[0-3] )
    119119                    ;
     
    121121                |
    122122                (?:                                     # hexidecimal matches
    123                     &\\#x
     123                    &\#x
    124124                    (?: 002[1-9a-cef]|003[a-cef]|0040|005[b-e]|0060|007[b-e]|00a[1-9a-cef]|00b[0-9a-f]|00d7|00f7|02c6|02dc|03d[126]|201[3-9a-f]|202[0-7]|20[34][0-9a-f]|205[0-9a-e]|206[1-4]|20[a-c][0-9a-f]|21[0-4][0-9a-f]|219[0-9a-f]|2[23][0-9a-f][0-9a-f]|25[a-f][0-9a-f]|23[0-9a-f][0-9a-f]|2e[0-7][0-9a-f] )
    125125                    ;
     
    131131    (?:
    132132        (?:
    133             [^\\w\\s\\&\\/\\@]  # assume characters that are not word spaces or whitespace are punctuation
     133            [^\w\s\&\/\@]  # assume characters that are not word spaces or whitespace are punctuation
    134134                           # exclude & as that is an illegal stand-alone character (and would interfere with HTML character representations
    135                            # exclude slash \\/as to not include the last slash in a URL
     135                           # exclude slash \/as to not include the last slash in a URL
    136136                           # exclude @ as to keep twitter names together
    137137            |
     
    158158            |
    159159            (?:                                             # decimal matches
    160                 &\\#
     160                &\#
    161161                (?: 45|95|173|820[3-589]|8210 )
    162162                ;
     
    164164            |
    165165            (?:                                             # hexidecimal matches
    166                 &\\#x
     166                &\#x
    167167                (?: 002d|005f|00ad|200[b-d]|201[0-2] )
    168168                ;
     
    170170            |
    171171            (?:                                             # actual characters
    172                 \\x{002d}|\\x{005f}|\\x{00ad}|\\x{200b}|\\x{200c}|\\x{200d}|\\x{2010}|\\x{2011}|\\x{2012}
     172                \x{002d}|\x{005f}|\x{00ad}|\x{200b}|\x{200c}|\x{200d}|\x{2010}|\x{2011}|\x{2012}
    173173            )
    174174        )
     
    190190            |
    191191            (?:                                             # decimal matches
    192                 &\\#
     192                &\#
    193193                (?: 4[89]|5[0-7]|9[7-9]|1[01][0-9]|12[0-2]|19[2-9]|20[0-9]|21[0-46-9]|2[23][0-9]|24[0-68-9]|2[5-9][0-9]|3[0-7][0-9]|38[0-3] )
    194194                ;
     
    197197            (?:                                             # hexidecimal matches
    198198                (?:
    199                     &\\#x00
     199                    &\#x00
    200200                    (?: 3[1-9]|4[1-9a-f]|5[0-9a]|6[1-9a-f]|7[0-9a]|c[0-9a-f]|d[0-689]|e[0-9a-f]|f[0-689a-f] )
    201201                    ;
     
    203203                |
    204204                (?:
    205                     &\\#x01[0-7][0-9a-f];
     205                    &\#x01[0-7][0-9a-f];
    206206                )
    207207            )
    208208            |
    209209            (?:                                             # actual characters
    210                 [0-9A-Za-z]|\\x{00c0}|\\x{00c1}|\\x{00c2}|\\x{00c3}|\\x{00c4}|\\x{00c5}|\\x{00c6}|\\x{00c7}|\\x{00c8}|\\x{00c9}|
    211                 \\x{00ca}|\\x{00cb}|\\x{00cc}|\\x{00cd}|\\x{00ce}|\\x{00cf}|\\x{00d0}|\\x{00d1}|\\x{00d2}|\\x{00d3}|\\x{00d4}|
    212                 \\x{00d5}|\\x{00d6}|\\x{00d8}|\\x{00d9}|\\x{00da}|\\x{00db}|\\x{00dc}|\\x{00dd}|\\x{00de}|\\x{00df}|\\x{00e0}|
    213                 \\x{00e1}|\\x{00e2}|\\x{00e3}|\\x{00e4}|\\x{00e5}|\\x{00e6}|\\x{00e7}|\\x{00e8}|\\x{00e9}|\\x{00ea}|\\x{00eb}|
    214                 \\x{00ec}|\\x{00ed}|\\x{00ee}|\\x{00ef}|\\x{00f0}|\\x{00f1}|\\x{00f2}|\\x{00f3}|\\x{00f4}|\\x{00f5}|\\x{00f6}|
    215                 \\x{00f8}|\\x{00f9}|\\x{00fa}|\\x{00fb}|\\x{00fc}|\\x{00fd}|\\x{00fe}|\\x{00ff}|\\x{0100}|\\x{0101}|\\x{0102}|
    216                 \\x{0103}|\\x{0104}|\\x{0105}|\\x{0106}|\\x{0107}|\\x{0108}|\\x{0109}|\\x{010a}|\\x{010b}|\\x{010c}|\\x{010d}|
    217                 \\x{010e}|\\x{010f}|\\x{0110}|\\x{0111}|\\x{0112}|\\x{0113}|\\x{0114}|\\x{0115}|\\x{0116}|\\x{0117}|\\x{0118}|
    218                 \\x{0119}|\\x{011a}|\\x{011b}|\\x{011c}|\\x{011d}|\\x{011e}|\\x{011f}|\\x{0120}|\\x{0121}|\\x{0122}|\\x{0123}|
    219                 \\x{0124}|\\x{0125}|\\x{0126}|\\x{0127}|\\x{0128}|\\x{0129}|\\x{012a}|\\x{012b}|\\x{012c}|\\x{012d}|\\x{012e}|
    220                 \\x{012f}|\\x{0130}|\\x{0131}|\\x{0132}|\\x{0133}|\\x{0134}|\\x{0135}|\\x{0136}|\\x{0137}|\\x{0138}|\\x{0139}|
    221                 \\x{013a}|\\x{013b}|\\x{013c}|\\x{013d}|\\x{013e}|\\x{013f}|\\x{0140}|\\x{0141}|\\x{0142}|\\x{0143}|\\x{0144}|
    222                 \\x{0145}|\\x{0146}|\\x{0147}|\\x{0148}|\\x{0149}|\\x{014a}|\\x{014b}|\\x{014c}|\\x{014d}|\\x{014e}|\\x{014f}|
    223                 \\x{0150}|\\x{0151}|\\x{0152}|\\x{0153}|\\x{0154}|\\x{0155}|\\x{0156}|\\x{0157}|\\x{0158}|\\x{0159}|\\x{015a}|
    224                 \\x{015b}|\\x{015c}|\\x{015d}|\\x{015e}|\\x{015f}|\\x{0160}|\\x{0161}|\\x{0162}|\\x{0163}|\\x{0164}|\\x{0165}|
    225                 \\x{0166}|\\x{0167}|\\x{0168}|\\x{0169}|\\x{016a}|\\x{016b}|\\x{016c}|\\x{016d}|\\x{016e}|\\x{016f}|\\x{0170}|
    226                 \\x{0171}|\\x{0172}|\\x{0173}|\\x{0174}|\\x{0175}|\\x{0176}|\\x{0177}|\\x{0178}|\\x{0179}|\\x{017a}|\\x{017b}|
    227                 \\x{017c}|\\x{017d}|\\x{017e}|\\x{017f}
     210                [0-9A-Za-z]|\x{00c0}|\x{00c1}|\x{00c2}|\x{00c3}|\x{00c4}|\x{00c5}|\x{00c6}|\x{00c7}|\x{00c8}|\x{00c9}|
     211                \x{00ca}|\x{00cb}|\x{00cc}|\x{00cd}|\x{00ce}|\x{00cf}|\x{00d0}|\x{00d1}|\x{00d2}|\x{00d3}|\x{00d4}|
     212                \x{00d5}|\x{00d6}|\x{00d8}|\x{00d9}|\x{00da}|\x{00db}|\x{00dc}|\x{00dd}|\x{00de}|\x{00df}|\x{00e0}|
     213                \x{00e1}|\x{00e2}|\x{00e3}|\x{00e4}|\x{00e5}|\x{00e6}|\x{00e7}|\x{00e8}|\x{00e9}|\x{00ea}|\x{00eb}|
     214                \x{00ec}|\x{00ed}|\x{00ee}|\x{00ef}|\x{00f0}|\x{00f1}|\x{00f2}|\x{00f3}|\x{00f4}|\x{00f5}|\x{00f6}|
     215                \x{00f8}|\x{00f9}|\x{00fa}|\x{00fb}|\x{00fc}|\x{00fd}|\x{00fe}|\x{00ff}|\x{0100}|\x{0101}|\x{0102}|
     216                \x{0103}|\x{0104}|\x{0105}|\x{0106}|\x{0107}|\x{0108}|\x{0109}|\x{010a}|\x{010b}|\x{010c}|\x{010d}|
     217                \x{010e}|\x{010f}|\x{0110}|\x{0111}|\x{0112}|\x{0113}|\x{0114}|\x{0115}|\x{0116}|\x{0117}|\x{0118}|
     218                \x{0119}|\x{011a}|\x{011b}|\x{011c}|\x{011d}|\x{011e}|\x{011f}|\x{0120}|\x{0121}|\x{0122}|\x{0123}|
     219                \x{0124}|\x{0125}|\x{0126}|\x{0127}|\x{0128}|\x{0129}|\x{012a}|\x{012b}|\x{012c}|\x{012d}|\x{012e}|
     220                \x{012f}|\x{0130}|\x{0131}|\x{0132}|\x{0133}|\x{0134}|\x{0135}|\x{0136}|\x{0137}|\x{0138}|\x{0139}|
     221                \x{013a}|\x{013b}|\x{013c}|\x{013d}|\x{013e}|\x{013f}|\x{0140}|\x{0141}|\x{0142}|\x{0143}|\x{0144}|
     222                \x{0145}|\x{0146}|\x{0147}|\x{0148}|\x{0149}|\x{014a}|\x{014b}|\x{014c}|\x{014d}|\x{014e}|\x{014f}|
     223                \x{0150}|\x{0151}|\x{0152}|\x{0153}|\x{0154}|\x{0155}|\x{0156}|\x{0157}|\x{0158}|\x{0159}|\x{015a}|
     224                \x{015b}|\x{015c}|\x{015d}|\x{015e}|\x{015f}|\x{0160}|\x{0161}|\x{0162}|\x{0163}|\x{0164}|\x{0165}|
     225                \x{0166}|\x{0167}|\x{0168}|\x{0169}|\x{016a}|\x{016b}|\x{016c}|\x{016d}|\x{016e}|\x{016f}|\x{0170}|
     226                \x{0171}|\x{0172}|\x{0173}|\x{0174}|\x{0175}|\x{0176}|\x{0177}|\x{0178}|\x{0179}|\x{017a}|\x{017b}|
     227                \x{017c}|\x{017d}|\x{017e}|\x{017f}
    228228            )
    229229        )
     
    232232    private const WORD = '
    233233    (?:
    234         (?<![\\w\\&])    # negative lookbehind to ensure
     234        (?<![\w\&])  # negative lookbehind to ensure
    235235                     #  1) we are proceeded by a non-word-character, and
    236236                     #  2) we are not inside an HTML character def
    237237        (?:
    238             [\\w\\-\\_\\/]
     238            [\w\-\_\/]
    239239            |
    240240            ' . self::HTML_LETTERS . '
     
    250250    // Regular expressions.
    251251    private const RE_ANY_TEXT = '/(' . self::ANY_TEXT . ')/Sxiu';
    252     private const RE_SPACE = '/\\A' . self::SPACE . '\\Z/Sxiu';
    253     private const RE_PUNCTUATION = '/\\A' . self::PUNCTUATION . '\\Z/Ssxiu';
    254     private const RE_WORD = '/\\A' . self::WORD . '\\Z/Sxu';
    255     private const RE_HTML_LETTER_CONNECTORS = '/' . self::HTML_LETTER_CONNECTORS . '|[0-9\\-_&#;\\/]/Sxu';
    256     private const RE_MAX_STRING_LENGTH = '/\\w{500}/Ss';
     252    private const RE_SPACE = '/\A' . self::SPACE . '\Z/Sxiu';
     253    private const RE_PUNCTUATION = '/\A' . self::PUNCTUATION . '\Z/Ssxiu';
     254    private const RE_WORD = '/\A' . self::WORD . '\Z/Sxu';
     255    private const RE_HTML_LETTER_CONNECTORS = '/' . self::HTML_LETTER_CONNECTORS . '|[0-9\-_&#;\/]/Sxu';
     256    private const RE_MAX_STRING_LENGTH = '/\w{500}/Ss';
    257257    /**
    258258     * The current strtoupper function to use (either 'strtoupper' or 'mb_strtoupper').
     
    338338     * @param int                      $index         The current index. Passed by reference.
    339339     */
    340     protected static function parse_ambiguous_token($expected_type, $part, array &$tokens, &$index) : void
     340    protected static function parse_ambiguous_token($expected_type, $part, array &$tokens, &$index): void
    341341    {
    342342        // Make sure that things like email addresses and URLs are not broken up incorrectly.
     
    413413     * Clears the currently set text from the parser.
    414414     */
    415     public function clear() : void
     415    public function clear(): void
    416416    {
    417417        $this->text = [];
     
    422422     * @param Token[] $tokens An array of tokens.
    423423     */
    424     public function update($tokens) : void
     424    public function update($tokens): void
    425425    {
    426426        foreach ($tokens as $index => $token) {
     
    574574 * If multibyte characters are passed, they must be encoded as UTF-8.
    575575 */
    576 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Text_Parser', 'PHP_Typography\\Text_Parser', \false);
     576\class_alias('WP_Typography\Vendor\PHP_Typography\Text_Parser', 'PHP_Typography\Text_Parser', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/class-u.php

    r2819294 r3208262  
    8686 * @since 5.0.0
    8787 */
    88 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\U', 'PHP_Typography\\U', \false);
     88\class_alias('WP_Typography\Vendor\PHP_Typography\U', 'PHP_Typography\U', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/class-default-registry.php

    r2819294 r3208262  
    6666                $arguments = [];
    6767                if (!empty($params['classes'])) {
    68                     $arguments += \array_map(function ($index) use($css_classes) {
     68                    $arguments += \array_map(function ($index) use ($css_classes) {
    6969                        return $css_classes[$index];
    7070                    }, $params['classes']);
     
    164164 * @since 6.0.0
    165165 */
    166 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Default_Registry', 'PHP_Typography\\Fixes\\Default_Registry', \false);
     166\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Default_Registry', 'PHP_Typography\Fixes\Default_Registry', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/class-node-fix.php

    r2819294 r3208262  
    6161 * @since 5.0.0
    6262 */
    63 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fix', 'PHP_Typography\\Fixes\\Node_Fix', \false);
     63\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fix', 'PHP_Typography\Fixes\Node_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/class-registry.php

    r2819294 r3208262  
    8787     * @throws \InvalidArgumentException Group is invalid.
    8888     */
    89     public function register_node_fix(Node_Fix $fix, $group) : void
     89    public function register_node_fix(Node_Fix $fix, $group): void
    9090    {
    9191        if (isset($this->node_fixes[$group])) {
     
    100100     * @param Token_Fix $fix Required.
    101101     */
    102     public function register_token_fix(Token_Fix $fix) : void
     102    public function register_token_fix(Token_Fix $fix): void
    103103    {
    104104        $this->process_words_fix->register_token_fix($fix);
     
    109109     * @param Cache $cache A hyphenator cache instance.
    110110     */
    111     public function update_hyphenator_cache(Cache $cache) : void
     111    public function update_hyphenator_cache(Cache $cache): void
    112112    {
    113113        $this->process_words_fix->update_hyphenator_cache($cache);
     
    121121     * @param bool     $is_feed  Check for feed compatibility if true.
    122122     */
    123     public function apply_fixes(\DOMText $textnode, Settings $settings, $is_title, $is_feed) : void
     123    public function apply_fixes(\DOMText $textnode, Settings $settings, $is_title, $is_feed): void
    124124    {
    125125        foreach ($this->node_fixes as $fix_group) {
     
    139139 * @since 6.0.0
    140140 */
    141 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Registry', 'PHP_Typography\\Fixes\\Registry', \false);
     141\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Registry', 'PHP_Typography\Fixes\Registry', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/class-token-fix.php

    r2819294 r3208262  
    7373 * @since 5.0.0
    7474 */
    75 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Token_Fix', 'PHP_Typography\\Fixes\\Token_Fix', \false);
     75\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fix', 'PHP_Typography\Fixes\Token_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-abstract-node-fix.php

    r2819294 r3208262  
    6363     * @return void
    6464     */
    65     public abstract function apply(\DOMText $textnode, Settings $settings, $is_title = \false);
     65    abstract public function apply(\DOMText $textnode, Settings $settings, $is_title = \false);
    6666    /**
    6767     * Determines whether the fix should be applied to (RSS) feeds.
     
    109109 * @since 5.0.0
    110110 */
    111 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Abstract_Node_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Abstract_Node_Fix', \false);
     111\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Abstract_Node_Fix', 'PHP_Typography\Fixes\Node_Fixes\Abstract_Node_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-classes-dependent-fix.php

    r2819294 r3208262  
    5353    {
    5454        parent::__construct($feed_compatible);
    55         if (!\is_array($classes)) {
     55        if (!is_array($classes)) {
    5656            $classes = [$classes];
    5757        }
     
    8484     * @return void
    8585     */
    86     protected abstract function apply_internal(\DOMText $textnode, Settings $settings, $is_title = \false);
     86    abstract protected function apply_internal(\DOMText $textnode, Settings $settings, $is_title = \false);
    8787}
    8888/**
     
    9393 * @since 5.0.0
    9494 */
    95 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Classes_Dependent_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Classes_Dependent_Fix', \false);
     95\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Classes_Dependent_Fix', 'PHP_Typography\Fixes\Node_Fixes\Classes_Dependent_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-dash-spacing-fix.php

    r2819294 r3208262  
    4343    const EM_DASH_SPACING = '/
    4444        (?:
    45             \\s
     45            \s
    4646            (' . U::EM_DASH . ')
    47             \\s
     47            \s
    4848        )
    4949        |
    5050        (?:
    51             (?<=\\S)                   # lookbehind assertion
     51            (?<=\S)                   # lookbehind assertion
    5252            (' . U::EM_DASH . ')
    53             (?=\\S)                    # lookahead assertion
     53            (?=\S)                    # lookahead assertion
    5454        )
    5555    /xu';
     
    125125     * @param string $interval_space      The space character used around interval dashes.
    126126     */
    127     private function update_dash_spacing_regex($parenthetical, $parenthetical_space, $interval, $interval_space) : void
     127    private function update_dash_spacing_regex($parenthetical, $parenthetical_space, $interval, $interval_space): void
    128128    {
    129129        // Mandatory UTF-8 modifier.
     
    144144 * @since 5.0.0
    145145 */
    146 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Dash_Spacing_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Dash_Spacing_Fix', \false);
     146\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Dash_Spacing_Fix', 'PHP_Typography\Fixes\Node_Fixes\Dash_Spacing_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-dewidow-fix.php

    r2819294 r3208262  
    4242class Dewidow_Fix extends Abstract_Node_Fix
    4343{
    44     const SPACE_BETWEEN = '[\\s]+';
     44    const SPACE_BETWEEN = '[\s]+';
    4545    // \s includes all special spaces (but not ZWSP) with the u flag.
    46     const WIDOW = '[\\w\\p{M}\\-' . U::HYPHEN . U::ZERO_WIDTH_SPACE . U::SOFT_HYPHEN . ']+?';
     46    const WIDOW = '[\w\p{M}\-' . U::HYPHEN . U::ZERO_WIDTH_SPACE . U::SOFT_HYPHEN . ']+?';
    4747    // \w includes all alphanumeric Unicode characters but not composed characters.
    4848    // Mandatory UTF-8 modifer.
    4949    const REGEX_START = '/
    5050        (?:
    51             \\A
     51            \A
    5252            |
    5353            (?:
    5454                (?<space_before>            # subpattern 1: space before (note: ZWSP is not a space)
    55                     [\\s' . U::ZERO_WIDTH_SPACE . U::SOFT_HYPHEN . ']+
     55                    [\s' . U::ZERO_WIDTH_SPACE . U::SOFT_HYPHEN . ']+
    5656                )
    5757                (?<neighbor>                # subpattern 2: neighbors widow (short as possible)
    58                     [^\\s' . U::ZERO_WIDTH_SPACE . U::SOFT_HYPHEN . ']+?
     58                    [^\s' . U::ZERO_WIDTH_SPACE . U::SOFT_HYPHEN . ']+?
    5959                )
    6060            )
     
    7171    const REGEX_END = '})
    7272        (?<trailing>                       # subpattern 5: any trailing punctuation or spaces
    73             [^\\w\\p{M}]*
     73            [^\w\p{M}]*
    7474        )
    75         \\Z
     75        \Z
    7676    /Sxu';
    7777    const MASKED_NARROW_SPACE = '__NO_BREAK_NARROW_SPACE__';
     
    116116        }
    117117        // Do what we have to do.
    118         return \preg_replace_callback(self::REGEX_START . ($word_number - 1) . self::REGEX_END, function (array $widow) use($func, $max_pull, $max_length, $word_number) {
     118        return \preg_replace_callback(self::REGEX_START . ($word_number - 1) . self::REGEX_END, function (array $widow) use ($func, $max_pull, $max_length, $word_number) {
    119119            // If we are here, we know that widows are being protected in some fashion
    120120            // with that, we will assert that widows should never be hyphenated or wrapped
     
    166166    protected static function make_space_nonbreaking($string, $deprecated, $u)
    167167    {
    168         return \preg_replace(['/\\s*(?:' . U::THIN_SPACE . '|' . U::NO_BREAK_NARROW_SPACE . ')\\s*/Su', "/\\s+/S{$u}", '/' . self::MASKED_NARROW_SPACE . "/S{$u}"], [self::MASKED_NARROW_SPACE, U::NO_BREAK_SPACE, U::NO_BREAK_NARROW_SPACE], $string);
     168        return \preg_replace(['/\s*(?:' . U::THIN_SPACE . '|' . U::NO_BREAK_NARROW_SPACE . ')\s*/Su', "/\\s+/S{$u}", '/' . self::MASKED_NARROW_SPACE . "/S{$u}"], [self::MASKED_NARROW_SPACE, U::NO_BREAK_SPACE, U::NO_BREAK_NARROW_SPACE], $string);
    169169    }
    170170}
     
    176176 * @since 5.0.0
    177177 */
    178 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Dewidow_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Dewidow_Fix', \false);
     178\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Dewidow_Fix', 'PHP_Typography\Fixes\Node_Fixes\Dewidow_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-french-punctuation-spacing-fix.php

    r2819294 r3208262  
    4747{
    4848    // Regular expressions with mandatary Unicode modifier.
    49     const INSERT_NARROW_SPACE = '/(\\w+(?:\\s?»)?)(\\s?)([?!;])(\\s|\\Z)/u';
    50     const INSERT_FULL_SPACE = '/(\\w+(?:\\s?»)?)(\\s?)(:)(\\s|\\Z)/u';
    51     const INSERT_SPACE_AFTER_OPENING_QUOTE = '/(\\s|\\A|[\\(\\[])(«)(\\s?)(\\w+)/u';
    52     const INSERT_SPACE_BEFORE_CLOSING_QUOTE = '/(\\w+[.?!]?)(\\s?)(»)(\\s|[.,?!:\\)\\]]|\\Z)/u';
     49    const INSERT_NARROW_SPACE = '/(\w+(?:\s?»)?)(\s?)([?!;])(\s|\Z)/u';
     50    const INSERT_FULL_SPACE = '/(\w+(?:\s?»)?)(\s?)(:)(\s|\Z)/u';
     51    const INSERT_SPACE_AFTER_OPENING_QUOTE = '/(\s|\A|[\(\[])(«)(\s?)(\w+)/u';
     52    const INSERT_SPACE_BEFORE_CLOSING_QUOTE = '/(\w+[.?!]?)(\s?)(»)(\s|[.,?!:\)\]]|\Z)/u';
    5353    /**
    5454     * Apply the fix to a given textnode.
     
    9595 * @since 5.0.0
    9696 */
    97 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\French_Punctuation_Spacing_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\French_Punctuation_Spacing_Fix', \false);
     97\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\French_Punctuation_Spacing_Fix', 'PHP_Typography\Fixes\Node_Fixes\French_Punctuation_Spacing_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-numbered-abbreviation-spacing-fix.php

    r2819294 r3208262  
    4242class Numbered_Abbreviation_Spacing_Fix extends Simple_Regex_Replacement_Fix
    4343{
    44     private const ISO = 'ISO(?:\\/(?:IEC|TR|TS))?';
     44    private const ISO = 'ISO(?:\/(?:IEC|TR|TS))?';
    4545    private const ABBREVIATIONS = '
    4646        ### Internationl standards
     
    5353        DIN[ ]' . self::ISO . '|
    5454        DIN[ ]IEC|
    55         DIN[ ]CEN\\/TS|
    56         DIN[ ]CLC\\/TS|
     55        DIN[ ]CEN\/TS|
     56        DIN[ ]CLC\/TS|
    5757        DIN[ ]CWA|
    5858        DIN[ ]VDE|
     
    7373    // required modifiers: x (multiline pattern).
    7474    const REPLACEMENT = '$1' . U::NO_BREAK_SPACE . '$2';
    75     const REGEX = '/\\b(' . self::ABBREVIATIONS . ')[' . RE::NORMAL_SPACES . ']+([0-9]+)/xu';
     75    const REGEX = '/\b(' . self::ABBREVIATIONS . ')[' . RE::NORMAL_SPACES . ']+([0-9]+)/xu';
    7676    /**
    7777     * Creates a new fix object.
     
    9393 * @since 5.0.0
    9494 */
    95 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Numbered_Abbreviation_Spacing_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Numbered_Abbreviation_Spacing_Fix', \false);
     95\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Numbered_Abbreviation_Spacing_Fix', 'PHP_Typography\Fixes\Node_Fixes\Numbered_Abbreviation_Spacing_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-process-words-fix.php

    r2819294 r3208262  
    112112     * @param Token_Fix $fix Required.
    113113     */
    114     public function register_token_fix(Token_Fix $fix) : void
     114    public function register_token_fix(Token_Fix $fix): void
    115115    {
    116116        $this->token_fixes[] = $fix;
     
    121121     * @param Cache $cache A hyphenator cache instance.
    122122     */
    123     public function update_hyphenator_cache(Cache $cache) : void
     123    public function update_hyphenator_cache(Cache $cache): void
    124124    {
    125125        foreach ($this->token_fixes as $fix) {
     
    143143 * @since 5.0.0
    144144 */
    145 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Process_Words_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Process_Words_Fix', \false);
     145\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Process_Words_Fix', 'PHP_Typography\Fixes\Node_Fixes\Process_Words_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-simple-regex-replacement-fix.php

    r2819294 r3208262  
    9696 * @since 5.0.0
    9797 */
    98 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Simple_Regex_Replacement_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Simple_Regex_Replacement_Fix', \false);
     98\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Simple_Regex_Replacement_Fix', 'PHP_Typography\Fixes\Node_Fixes\Simple_Regex_Replacement_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-simple-style-fix.php

    r2819294 r3208262  
    9797 * @since 5.0.0
    9898 */
    99 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Simple_Style_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Simple_Style_Fix', \false);
     99\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Simple_Style_Fix', 'PHP_Typography\Fixes\Node_Fixes\Simple_Style_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-single-character-word-spacing-fix.php

    r2819294 r3208262  
    4444    const REGEX = '/
    4545        (?:
    46             (\\s)
    47             (\\w|&)
     46            (\s)
     47            (\w|&)
    4848            [' . RE::NORMAL_SPACES . ']
    49             (?=\\w)
     49            (?=\w)
    5050        )
    5151    /x';
     
    8585 * @since 6.0.0 The replacement now assumes decoded ampersands (i.e. plain "&" instead of "&amp;").
    8686 */
    87 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Single_Character_Word_Spacing_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Single_Character_Word_Spacing_Fix', \false);
     87\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Single_Character_Word_Spacing_Fix', 'PHP_Typography\Fixes\Node_Fixes\Single_Character_Word_Spacing_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-smart-area-units-fix.php

    r2819294 r3208262  
    4141    const LENGTH_UNITS = '(?:p|µ|[mcdhkMGT])?m';
    4242    // Just metric for now.
    43     const NUMBER = '[0-9]+(?:\\.,)?[0-9]*';
    44     const WHITESPACE = '\\s*';
    45     const AREA_UNITS = '/\\b(' . self::NUMBER . ')(' . self::WHITESPACE . ')(' . self::LENGTH_UNITS . ')2\\b/Su';
    46     const VOLUME_UNITS = '/\\b(' . self::NUMBER . ')(' . self::WHITESPACE . ')(' . self::LENGTH_UNITS . ')3\\b/Su';
     43    const NUMBER = '[0-9]+(?:\.,)?[0-9]*';
     44    const WHITESPACE = '\s*';
     45    const AREA_UNITS = '/\b(' . self::NUMBER . ')(' . self::WHITESPACE . ')(' . self::LENGTH_UNITS . ')2\b/Su';
     46    const VOLUME_UNITS = '/\b(' . self::NUMBER . ')(' . self::WHITESPACE . ')(' . self::LENGTH_UNITS . ')3\b/Su';
    4747    /**
    4848     * Apply the fix to a given textnode.
     
    6767 * @since 5.0.0
    6868 */
    69 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Smart_Area_Units_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Smart_Area_Units_Fix', \false);
     69\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Area_Units_Fix', 'PHP_Typography\Fixes\Node_Fixes\Smart_Area_Units_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-smart-dashes-fix.php

    r2819294 r3208262  
    4242{
    4343    // Standard dashes.
    44     const PARENTHETICAL_DOUBLE_DASH = '/(\\s|' . RE::HTML_SPACES . ')--(\\s|' . RE::HTML_SPACES . ')/Sxui';
     44    const PARENTHETICAL_DOUBLE_DASH = '/(\s|' . RE::HTML_SPACES . ')--(\s|' . RE::HTML_SPACES . ')/Sxui';
    4545    // ' -- '.
    46     const PARENTHETICAL_SINGLE_DASH = '/(\\s|' . RE::HTML_SPACES . ')-(\\s|' . RE::HTML_SPACES . ')/Sxui';
     46    const PARENTHETICAL_SINGLE_DASH = '/(\s|' . RE::HTML_SPACES . ')-(\s|' . RE::HTML_SPACES . ')/Sxui';
    4747    // ' - '.
    48     const EN_DASH_WORDS = '/([\\w])\\-(' . U::THIN_SPACE . '|' . U::HAIR_SPACE . '|' . U::NO_BREAK_NARROW_SPACE . '|' . U::NO_BREAK_SPACE . ')/Su';
     48    const EN_DASH_WORDS = '/([\w])\-(' . U::THIN_SPACE . '|' . U::HAIR_SPACE . '|' . U::NO_BREAK_NARROW_SPACE . '|' . U::NO_BREAK_SPACE . ')/Su';
    4949    const EN_DASH_NUMBERS = "/(\\b\\d+(\\.?))\\-(\\d+\\2)/S";
    5050    const EN_DASH_PHONE_NUMBERS = "/(\\b\\d{3})" . U::EN_DASH . "(\\d{4}\\b)/S";
     
    5353    const DATE_YYYY_MM_DD = '/
    5454        (
    55             (?<=\\s|\\A|' . U::NO_BREAK_SPACE . ')
     55            (?<=\s|\A|' . U::NO_BREAK_SPACE . ')
    5656            [12][0-9]{3}
    5757        )
    58         [\\-' . U::EN_DASH . ']
     58        [\-' . U::EN_DASH . ']
    5959        (
    6060            (?:[0][1-9]|[1][0-2])
    6161        )
    62         [\\-' . U::EN_DASH . "]\n\t\t\t(\n\t\t\t\t(?:[0][1-9]|[12][0-9]|[3][0-1])\n\t\t\t\t(?=\\s|\\Z|\\)|\\]|\\.|\\,|\\?|\\;|\\:|\\'|\"|\\!|" . U::NO_BREAK_SPACE . ')
     62        [\-' . U::EN_DASH . "]\n\t\t\t(\n\t\t\t\t(?:[0][1-9]|[12][0-9]|[3][0-1])\n\t\t\t\t(?=\\s|\\Z|\\)|\\]|\\.|\\,|\\?|\\;|\\:|\\'|\"|\\!|" . U::NO_BREAK_SPACE . ')
    6363        )
    6464    /xu';
     
    6767            (?:
    6868                (
    69                     (?<=\\s|\\A|' . U::NO_BREAK_SPACE . ')
     69                    (?<=\s|\A|' . U::NO_BREAK_SPACE . ')
    7070                    (?:[0]?[1-9]|[1][0-2])
    7171                )
    72                 [\\-' . U::EN_DASH . ']
     72                [\-' . U::EN_DASH . ']
    7373                (
    7474                    (?:[0]?[1-9]|[12][0-9]|[3][0-1])
     
    7878            (?:
    7979                (
    80                     (?<=\\s|\\A|' . U::NO_BREAK_SPACE . ')
     80                    (?<=\s|\A|' . U::NO_BREAK_SPACE . ')
    8181                    (?:[0]?[1-9]|[12][0-9]|[3][0-1])
    8282                )
    83                 [\\-' . U::EN_DASH . ']
     83                [\-' . U::EN_DASH . ']
    8484                (
    8585                    (?:[0]?[1-9]|[1][0-2])
     
    8787            )
    8888        )
    89         [\\-' . U::EN_DASH . "]\n\t\t(\n\t\t\t[12][0-9]{3}\n\t\t\t(?=\\s|\\Z|\\)|\\]|\\.|\\,|\\?|\\;|\\:|\\'|\"|\\!|" . U::NO_BREAK_SPACE . ')
     89        [\-' . U::EN_DASH . "]\n\t\t(\n\t\t\t[12][0-9]{3}\n\t\t\t(?=\\s|\\Z|\\)|\\]|\\.|\\,|\\?|\\;|\\:|\\'|\"|\\!|" . U::NO_BREAK_SPACE . ')
    9090        )
    9191    /xu';
    9292    const DATE_YYYY_MM = '/
    9393        (
    94             (?<=\\s|\\A|' . U::NO_BREAK_SPACE . ')
     94            (?<=\s|\A|' . U::NO_BREAK_SPACE . ')
    9595            [12][0-9]{3}
    9696        )
    97         [\\-' . U::EN_DASH . "]\n\t\t(\n\t\t\t(?:\n\t\t\t\t(?:[0][1-9]|[1][0-2])\n\t\t\t\t|\n\t\t\t\t(?:[0][0-9][1-9]|[1-2][0-9]{2}|[3][0-5][0-9]|[3][6][0-6])\n\t\t\t)\n\t\t\t(?=\\s|\\Z|\\)|\\]|\\.|\\,|\\?|\\;|\\:|\\'|\"|\\!|" . U::NO_BREAK_SPACE . ')
     97        [\-' . U::EN_DASH . "]\n\t\t(\n\t\t\t(?:\n\t\t\t\t(?:[0][1-9]|[1][0-2])\n\t\t\t\t|\n\t\t\t\t(?:[0][0-9][1-9]|[1-2][0-9]{2}|[3][0-5][0-9]|[3][6][0-6])\n\t\t\t)\n\t\t\t(?=\\s|\\Z|\\)|\\]|\\.|\\,|\\?|\\;|\\:|\\'|\"|\\!|" . U::NO_BREAK_SPACE . ')
    9898        )
    9999    /xu';
     
    139139 * @since 5.0.0
    140140 */
    141 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Smart_Dashes_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Smart_Dashes_Fix', \false);
     141\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Dashes_Fix', 'PHP_Typography\Fixes\Node_Fixes\Smart_Dashes_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-smart-diacritics-fix.php

    r2819294 r3208262  
    5454            // Uses "word" => "replacement" pairs from an array to make fast preg_* replacements.
    5555            $replacements = $settings[Settings::DIACRITIC_REPLACEMENT_DATA]['replacements'];
    56             $textnode->data = \preg_replace_callback($settings[Settings::DIACRITIC_REPLACEMENT_DATA]['patterns'], function ($match) use($replacements) {
     56            $textnode->data = \preg_replace_callback($settings[Settings::DIACRITIC_REPLACEMENT_DATA]['patterns'], function ($match) use ($replacements) {
    5757                if (isset($replacements[$match[0]])) {
    5858                    return $replacements[$match[0]];
     
    7171 * @since 5.0.0
    7272 */
    73 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Smart_Diacritics_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Smart_Diacritics_Fix', \false);
     73\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Diacritics_Fix', 'PHP_Typography\Fixes\Node_Fixes\Smart_Diacritics_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-smart-ellipses-fix.php

    r2819294 r3208262  
    6666 * @since 5.0.0
    6767 */
    68 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Smart_Ellipses_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Smart_Ellipses_Fix', \false);
     68\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Ellipses_Fix', 'PHP_Typography\Fixes\Node_Fixes\Smart_Ellipses_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-smart-exponents-fix.php

    r2819294 r3208262  
    4848    public function __construct($feed_compatible = \false)
    4949    {
    50         parent::__construct('/\\b(\\d+)\\^(\\w+)\\b/u', RE::escape_tags('$1<sup>$2</sup>'), Settings::SMART_EXPONENTS, $feed_compatible);
     50        parent::__construct('/\b(\d+)\^(\w+)\b/u', RE::escape_tags('$1<sup>$2</sup>'), Settings::SMART_EXPONENTS, $feed_compatible);
    5151    }
    5252}
     
    5959 * @since 5.0.0
    6060 */
    61 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Smart_Exponents_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Smart_Exponents_Fix', \false);
     61\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Exponents_Fix', 'PHP_Typography\Fixes\Node_Fixes\Smart_Exponents_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-smart-fractions-fix.php

    r2819294 r3208262  
    4343class Smart_Fractions_Fix extends Abstract_Node_Fix
    4444{
    45     const SPACING = '/\\b(\\d+)\\s(\\d+\\s?\\/\\s?\\d+)\\b/';
     45    const SPACING = '/\b(\d+)\s(\d+\s?\/\s?\d+)\b/';
    4646    const FRACTION_MATCHING = '/
    4747        # lookbehind assertion: makes sure we are not messing up a url
    48         (?<=\\A|\\s|' . U::NO_BREAK_SPACE . '|' . U::NO_BREAK_NARROW_SPACE . ')
     48        (?<=\A|\s|' . U::NO_BREAK_SPACE . '|' . U::NO_BREAK_NARROW_SPACE . ')
    4949
    50         (\\d+)
     50        (\d+)
    5151
    5252        # strip out any zero-width spaces inserted by wrap_hard_hyphens
    53         (?:\\s?\\/\\s?' . U::ZERO_WIDTH_SPACE . '?)
     53        (?:\s?\/\s?' . U::ZERO_WIDTH_SPACE . '?)
    5454
    5555        (
     
    5757            (?:
    5858                # ignore x:x where x > 1
    59                 (?!\\1(?:[^0-9]|\\Z)) |
     59                (?!\1(?:[^0-9]|\Z)) |
    6060
    6161                # but allow 1:1
    62                 (?=\\1)(?=1(?:[^0-9]|\\Z))
     62                (?=\1)(?=1(?:[^0-9]|\Z))
    6363            )
    6464
    6565            # Any numbers, except those above
    66             \\d+
     66            \d+
    6767        )
    6868        (
     
    7171
    7272            # handle ordinals after fractions
    73             (?:\\<sup\\>(?:st|nd|rd|th)<\\/sup\\>)?
     73            (?:\<sup\>(?:st|nd|rd|th)<\/sup\>)?
    7474
    7575            # makes sure we are not messing up a url
    76             (?:\\Z|\\s|' . U::NO_BREAK_SPACE . '|' . U::NO_BREAK_NARROW_SPACE . '|\\.|,|\\!|\\?|\\)|\\;|\\:|\'|")
     76            (?:\Z|\s|' . U::NO_BREAK_SPACE . '|' . U::NO_BREAK_NARROW_SPACE . '|\.|,|\!|\?|\)|\;|\:|\'|")
    7777        )
    7878        /Sxu';
    7979    const ESCAPE_DATE_MM_YYYY = '/
    8080            # capture valid one- or two-digit months
    81             ( \\b (?: 0?[1-9] | 1[0-2] ) )
     81            ( \b (?: 0?[1-9] | 1[0-2] ) )
    8282
    8383            # capture any zero-width spaces inserted by wrap_hard_hyphens
    84             (\\s?\\/\\s?' . U::ZERO_WIDTH_SPACE . '?)
     84            (\s?\/\s?' . U::ZERO_WIDTH_SPACE . '?)
    8585
    8686            # handle 4-decimal years
    87             ( [12][0-9]{3}\\b )
     87            ( [12][0-9]{3}\b )
    8888
    8989        /Sxu';
     
    115115            $year_regex[] = "(?: ( {$year} ) (\\s?\\/\\s?" . U::ZERO_WIDTH_SPACE . '?) ( ' . ($year + 1) . ' ) )';
    116116        }
    117         $this->escape_consecutive_years = '/\\b (?| ' . \implode('|', $year_regex) . ' ) \\b/Sxu';
     117        $this->escape_consecutive_years = '/\b (?| ' . implode('|', $year_regex) . ' ) \b/Sxu';
    118118        // Replace fractions.
    119119        $numerator_css = empty($css_numerator) ? '' : ' class="' . $css_numerator . '"';
     
    165165 * @since 5.0.0
    166166 */
    167 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Smart_Fractions_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Smart_Fractions_Fix', \false);
     167\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Fractions_Fix', 'PHP_Typography\Fixes\Node_Fixes\Smart_Fractions_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-smart-marks-fix.php

    r2819294 r3208262  
    3939class Smart_Marks_Fix extends Abstract_Node_Fix
    4040{
    41     const ESCAPE_501C = '/\\b(501\\()(c)(\\)\\((?:[1-9]|[1-2][0-9])\\))/S';
     41    const ESCAPE_501C = '/\b(501\()(c)(\)\((?:[1-9]|[1-2][0-9])\))/S';
    4242    const MARKS = ['(c)' => U::COPYRIGHT, '(C)' => U::COPYRIGHT, '(r)' => U::REGISTERED_MARK, '(R)' => U::REGISTERED_MARK, '(p)' => U::SOUND_COPY_MARK, '(P)' => U::SOUND_COPY_MARK, '(sm)' => U::SERVICE_MARK, '(SM)' => U::SERVICE_MARK, '(tm)' => U::TRADE_MARK, '(TM)' => U::TRADE_MARK];
    4343    /**
     
    9797 * @since 5.0.0
    9898 */
    99 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Smart_Marks_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Smart_Marks_Fix', \false);
     99\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Marks_Fix', 'PHP_Typography\Fixes\Node_Fixes\Smart_Marks_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-smart-maths-fix.php

    r2819294 r3208262  
    4040{
    4141    // Lookbehind assertion: preceded by beginning of string or space.
    42     const INITIAL_LOOKBEHIND = '(?<=\\s|\\A)';
     42    const INITIAL_LOOKBEHIND = '(?<=\s|\A)';
    4343    // Needs u modifier.
    4444    // Lookahead assertion: followed by end of string, space, or certain allowed punctuation marks.
    45     const FINAL_LOOKAHEAD = '(?=\\s|\\Z|\\)|\\]|\\.|\\,|\\?|\\;|\\:|\'|\\"|\\!)';
     45    const FINAL_LOOKAHEAD = '(?=\s|\Z|\)|\]|\.|\,|\?|\;|\:|\'|\"|\!)';
    4646    // Needs u modifier.
    4747    // Common date components.
     
    5454    const YEAR_2_OR_4_DIGITS = '(?:' . self::YEAR_2_DIGITS . '|' . self::YEAR_4_DIGITS . ')';
    5555    // Maths components.
    56     const DECIMAL_SEPARATOR = '[\\.,]';
     56    const DECIMAL_SEPARATOR = '[\.,]';
    5757    const DECIMAL_NUMBER = '[0-9]+(?:' . self::DECIMAL_SEPARATOR . '[0-9]+)?';
    5858    // First, let's find math equations.
    5959    const MATH_EQUATION = '/
    6060        ' . self::INITIAL_LOOKBEHIND . '
    61         [\\.,\'\\"\\¿\\¡' . U::ELLIPSIS . U::SINGLE_QUOTE_OPEN . U::DOUBLE_QUOTE_OPEN . U::GUILLEMET_OPEN . U::GUILLEMET_CLOSE . U::SINGLE_LOW_9_QUOTE . U::DOUBLE_LOW_9_QUOTE . ']*
     61        [\.,\'\"\¿\¡' . U::ELLIPSIS . U::SINGLE_QUOTE_OPEN . U::DOUBLE_QUOTE_OPEN . U::GUILLEMET_OPEN . U::GUILLEMET_CLOSE . U::SINGLE_LOW_9_QUOTE . U::DOUBLE_LOW_9_QUOTE . ']*
    6262                                                        # allowed preceding punctuation
    63         [\\-\\(' . U::MINUS . ']*                         # optionally preceded by dash, minus sign or open parenthesis
     63        [\-\(' . U::MINUS . ']*                         # optionally preceded by dash, minus sign or open parenthesis
    6464        ' . self::DECIMAL_NUMBER . '                    # must begin with a number, optional decimal values after first integer
    6565        (                                               # followed by a math symbol and a number
    66             [\\/\\*x\\-+=\\^' . U::MINUS . U::MULTIPLICATION . U::DIVISION . ']
     66            [\/\*x\-+=\^' . U::MINUS . U::MULTIPLICATION . U::DIVISION . ']
    6767                                                        # allowed math symbols
    68             [\\-\\(' . U::MINUS . ']*                     # optionally preceded by dash, minus sign or open parenthesis
     68            [\-\(' . U::MINUS . ']*                     # optionally preceded by dash, minus sign or open parenthesis
    6969            ' . self::DECIMAL_NUMBER . '                # must begin with a number, optional decimal values after first integer
    70             [\\-\\(\\)' . U::MINUS . ']*                   # optionally followed by dash, minus sign or parenthesis
     70            [\-\(\)' . U::MINUS . ']*                   # optionally followed by dash, minus sign or parenthesis
    7171        )+
    72         [\\.,;:\'\\"\\?\\!' . U::ELLIPSIS . U::SINGLE_QUOTE_CLOSE . U::DOUBLE_QUOTE_CLOSE . U::GUILLEMET_OPEN . U::GUILLEMET_CLOSE . ']*
     72        [\.,;:\'\"\?\!' . U::ELLIPSIS . U::SINGLE_QUOTE_CLOSE . U::DOUBLE_QUOTE_CLOSE . U::GUILLEMET_OPEN . U::GUILLEMET_CLOSE . ']*
    7373                                                        # allowed trailing punctuation
    74         (?=\\Z|\\s)                                       # lookahead assertion: followed by end of string or space
     74        (?=\Z|\s)                                       # lookahead assertion: followed by end of string or space
    7575    /Sxu';
    7676    // Revert 4-4 to plain minus-hyphen so as to not mess with ranges of numbers (i.e. pp. 46-50).
     
    7878        ' . self::INITIAL_LOOKBEHIND . '
    7979
    80         (\\d+)' . U::MINUS . '(\\d+)
     80        (\d+)' . U::MINUS . '(\d+)
    8181
    8282        ' . self::FINAL_LOOKAHEAD . '                   # lookahead assertion: most punctuation marks are allowd
     
    8686    const REVERT_FRACTION = "/\n\t\t(?<=\\s|\\A|\\'|\"|" . U::NO_BREAK_SPACE . ')
    8787        (
    88             \\d+
     88            \d+
    8989        )
    9090        ' . U::DIVISION . '
    9191        (
    92             \\d+
     92            \d+
    9393            (?:st|nd|rd|th)?
    9494        )
     
    200200 * @since 5.0.0
    201201 */
    202 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Smart_Maths_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Smart_Maths_Fix', \false);
     202\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Maths_Fix', 'PHP_Typography\Fixes\Node_Fixes\Smart_Maths_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-smart-ordinal-suffix-fix.php

    r2819294 r3208262  
    4949    // Ordinals with arabic numerals.
    5050    const RE_ARABIC_ORDINALS = '/' . self::WORD_BOUNDARY_START . '
    51         (\\d+)
     51        (\d+)
    5252        (' . self::ENGLISH_SUFFIXES . '|' . self::FRENCH_SUFFIXES . '|' . self::LATIN_SUFFIXES . '
    5353        )' . self::WORD_BOUNDARY_END . '
     
    6868    const ROMAN_NUMERALS = '[MDCLXVI]';
    6969    // Zero-width spaces and soft hyphens should not be treated as word boundaries.
    70     const WORD_BOUNDARY_START = '\\b(?<![' . U::SOFT_HYPHEN . U::ZERO_WIDTH_SPACE . '])';
    71     const WORD_BOUNDARY_END = '\\b(?![' . U::SOFT_HYPHEN . U::ZERO_WIDTH_SPACE . '])';
     70    const WORD_BOUNDARY_START = '\b(?<![' . U::SOFT_HYPHEN . U::ZERO_WIDTH_SPACE . '])';
     71    const WORD_BOUNDARY_END = '\b(?![' . U::SOFT_HYPHEN . U::ZERO_WIDTH_SPACE . '])';
    7272    /**
    7373     * The replacement expression (depends on CSS class).
     
    118118 * @since 5.0.0
    119119 */
    120 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Smart_Ordinal_Suffix_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Smart_Ordinal_Suffix_Fix', \false);
     120\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Ordinal_Suffix_Fix', 'PHP_Typography\Fixes\Node_Fixes\Smart_Ordinal_Suffix_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-smart-quotes-fix.php

    r2819294 r3208262  
    4242class Smart_Quotes_Fix extends Abstract_Node_Fix
    4343{
    44     const NUMBERS_BEFORE_PRIME = '\\b(?:\\d+\\/)?\\d{1,3}';
     44    const NUMBERS_BEFORE_PRIME = '\b(?:\d+\/)?\d{1,3}';
    4545    const DOUBLE_PRIME = '/(' . self::NUMBERS_BEFORE_PRIME . ")(?:''|\")(?=\\W|\\Z|-\\w)/S";
    4646    const SINGLE_PRIME = '/(' . self::NUMBERS_BEFORE_PRIME . ")'(?=\\W|\\Z|-\\w)/S";
    4747    const SINGLE_DOUBLE_PRIME = '/(' . self::NUMBERS_BEFORE_PRIME . ")'(\\s*)(\\b(?:\\d+\\/)?\\d+)(?:''|\")(?=\\W|\\Z)/S";
    4848    const SINGLE_QUOTED_NUMBERS = "/(?<=\\W|\\A)'([^\"]*\\d+)'(?=\\W|\\Z)/S";
    49     const DOUBLE_QUOTED_NUMBERS = '/(?<=\\W|\\A)"([^"]*\\d+)"(?=\\W|\\Z)/S';
    50     const COMMA_QUOTE = '/(?<=\\s|\\A),(?=\\S)/S';
     49    const DOUBLE_QUOTED_NUMBERS = '/(?<=\W|\A)"([^"]*\d+)"(?=\W|\Z)/S';
     50    const COMMA_QUOTE = '/(?<=\s|\A),(?=\S)/S';
    5151    const APOSTROPHE_WORDS = "/(?<=\\w)'(?=\\w)/S";
    5252    const APOSTROPHE_DECADES = "/'(\\d\\d(s|er)?\\b)/S";
     
    5555    // Alternative is for expressions like _'¿hola?'_.
    5656    const SINGLE_QUOTE_CLOSE = "/(?: (?<=\\w)' ) | (?: (?<=\\S)'(?=\\s|\\Z) )/Sx";
    57     const DOUBLE_QUOTE_OPEN = '/(?: "(?=\\w) )  | (?: (?<=\\s|\\A)"(?=\\S) )/Sx';
    58     const DOUBLE_QUOTE_CLOSE = '/(?: (?<=\\w)" ) | (?: (?<=\\S)"(?=\\s|\\Z) )/Sx';
     57    const DOUBLE_QUOTE_OPEN = '/(?: "(?=\w) )  | (?: (?<=\s|\A)"(?=\S) )/Sx';
     58    const DOUBLE_QUOTE_CLOSE = '/(?: (?<=\w)" ) | (?: (?<=\S)"(?=\s|\Z) )/Sx';
    5959    /**
    6060     * Cached primary quote style.
     
    205205     * @param  string $secondary_close Secondary quote style close.
    206206     */
    207     private function update_smart_quotes_brackets($primary_open, $primary_close, $secondary_open, $secondary_close) : void
     207    private function update_smart_quotes_brackets($primary_open, $primary_close, $secondary_open, $secondary_close): void
    208208    {
    209209        $brackets = [
     
    237237 * @since 5.0.0
    238238 */
    239 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Smart_Quotes_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Smart_Quotes_Fix', \false);
     239\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Quotes_Fix', 'PHP_Typography\Fixes\Node_Fixes\Smart_Quotes_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-space-collapse-fix.php

    r2819294 r3208262  
    4545    const COLLAPSE_NON_BREAKABLE_SPACES = '/(?:[' . RE::NORMAL_SPACES . ']|' . RE::HTML_SPACES . ')*' . U::NO_BREAK_SPACE . '(?:[' . RE::NORMAL_SPACES . ']|' . RE::HTML_SPACES . ')*/Sxu';
    4646    const COLLAPSE_OTHER_SPACES = '/(?:[' . RE::NORMAL_SPACES . '])*(' . RE::HTML_SPACES . ')(?:[' . RE::NORMAL_SPACES . ']|' . RE::HTML_SPACES . ')*/Sxu';
    47     const COLLAPSE_SPACES_AT_START_OF_BLOCK = '/\\A(?:[' . RE::NORMAL_SPACES . ']|' . RE::HTML_SPACES . ')+/Sxu';
     47    const COLLAPSE_SPACES_AT_START_OF_BLOCK = '/\A(?:[' . RE::NORMAL_SPACES . ']|' . RE::HTML_SPACES . ')+/Sxu';
    4848    /**
    4949     * Apply the fix to a given textnode.
     
    9494 * @since 5.0.0
    9595 */
    96 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Space_Collapse_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Space_Collapse_Fix', \false);
     96\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Space_Collapse_Fix', 'PHP_Typography\Fixes\Node_Fixes\Space_Collapse_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-style-ampersands-fix.php

    r2819294 r3208262  
    6464 * @since 6.0.0 The replacement now assumes decoded ampersands (i.e. plain "&" instead of "&amp;").
    6565 */
    66 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Style_Ampersands_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Style_Ampersands_Fix', \false);
     66\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Style_Ampersands_Fix', 'PHP_Typography\Fixes\Node_Fixes\Style_Ampersands_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-style-caps-fix.php

    r2819294 r3208262  
    4444    // PCRE needs to be compiled with "--enable-unicode-properties", but we already depend on that elsehwere.
    4545    const REGEX = '/
    46         (?<![\\w' . self::COMBINING_MARKS . '])  # negative lookbehind assertion
     46        (?<![\w' . self::COMBINING_MARKS . '])  # negative lookbehind assertion
    4747        (
    4848            (?:                                 # CASE 1: " 9A "
     
    5050                (?:[' . self::COMBINING_MARKS . '])*
    5151                                                # may contain hyphens, underscores, zero width spaces, or soft hyphens,
    52                 \\p{Lu}                          # but must contain at least one capital letter
    53                 (?:\\p{Lu}|[0-9]|[' . self::COMBINING_MARKS . '])*
     52                \p{Lu}                          # but must contain at least one capital letter
     53                (?:\p{Lu}|[0-9]|[' . self::COMBINING_MARKS . '])*
    5454                                                # may be followed by any number of numbers capital letters, hyphens,
    5555                                                # underscores, zero width spaces, or soft hyphens
     
    5757            |
    5858            (?:                                 # CASE 2: " A9 "
    59                 \\p{Lu}                          # starts with capital letter
    60                 (?:\\p{Lu}|[0-9])                # must be followed a number or capital letter
    61                 (?:\\p{Lu}|[0-9]|[' . self::COMBINING_MARKS . '])*
     59                \p{Lu}                          # starts with capital letter
     60                (?:\p{Lu}|[0-9])                # must be followed a number or capital letter
     61                (?:\p{Lu}|[0-9]|[' . self::COMBINING_MARKS . '])*
    6262                                                # may be followed by any number of numbers capital letters, hyphens,
    6363                                                # underscores, zero width spaces, or soft hyphens
    6464            )
    6565        )
    66         (?![\\w' . self::COMBINING_MARKS . '])   # negative lookahead assertion
     66        (?![\w' . self::COMBINING_MARKS . '])   # negative lookahead assertion
    6767    /Sxu';
    68     private const COMBINING_MARKS = '\\-_' . U::HYPHEN . U::SOFT_HYPHEN . U::ZERO_WIDTH_SPACE;
     68    private const COMBINING_MARKS = '\-_' . U::HYPHEN . U::SOFT_HYPHEN . U::ZERO_WIDTH_SPACE;
    6969    // Needs to be part of character class.
    7070    /**
     
    8989 * @since 5.0.0
    9090 */
    91 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Style_Caps_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Style_Caps_Fix', \false);
     91\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Style_Caps_Fix', 'PHP_Typography\Fixes\Node_Fixes\Style_Caps_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-style-hanging-punctuation-fix.php

    r2819294 r3208262  
    8585    // requires modifiers: x (multiline pattern) u (utf8).
    8686    // Style hanging punctuation.
    87     const STYLE_DOUBLE = '/(\\s)([' . self::DOUBLE_HANGING_PUNCTUATION . '])(\\w+)/S';
    88     const STYLE_SINGLE = '/(\\s)([' . self::SINGLE_HANGING_PUNCTUATION . '])(\\w+)/S';
    89     const STYLE_INITIAL_DOUBLE = '/(?:\\A)([' . self::DOUBLE_HANGING_PUNCTUATION . '])(\\w+)/S';
    90     const STYLE_INITIAL_SINGLE = '/(?:\\A)([' . self::SINGLE_HANGING_PUNCTUATION . '])(\\w+)/S';
     87    const STYLE_DOUBLE = '/(\s)([' . self::DOUBLE_HANGING_PUNCTUATION . '])(\w+)/S';
     88    const STYLE_SINGLE = '/(\s)([' . self::SINGLE_HANGING_PUNCTUATION . '])(\w+)/S';
     89    const STYLE_INITIAL_DOUBLE = '/(?:\A)([' . self::DOUBLE_HANGING_PUNCTUATION . '])(\w+)/S';
     90    const STYLE_INITIAL_SINGLE = '/(?:\A)([' . self::SINGLE_HANGING_PUNCTUATION . '])(\w+)/S';
    9191    /**
    9292     * Creates a new classes dependent fix.
     
    165165 * @since 5.0.0
    166166 */
    167 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Style_Hanging_Punctuation_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Style_Hanging_Punctuation_Fix', \false);
     167\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Style_Hanging_Punctuation_Fix', 'PHP_Typography\Fixes\Node_Fixes\Style_Hanging_Punctuation_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-style-initial-quotes-fix.php

    r2819294 r3208262  
    130130 * @since 5.0.0
    131131 */
    132 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Style_Initial_Quotes_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Style_Initial_Quotes_Fix', \false);
     132\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Style_Initial_Quotes_Fix', 'PHP_Typography\Fixes\Node_Fixes\Style_Initial_Quotes_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-style-numbers-fix.php

    r2819294 r3208262  
    6666 * @since 5.0.0
    6767 */
    68 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Style_Numbers_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Style_Numbers_Fix', \false);
     68\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Style_Numbers_Fix', 'PHP_Typography\Fixes\Node_Fixes\Style_Numbers_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-unit-spacing-fix.php

    r2819294 r3208262  
    4141{
    4242    const REPLACEMENT = '$1' . U::NO_BREAK_NARROW_SPACE . '$2';
    43     const REGEX = '/(\\d\\.?)\\s(' . self::STANDARD_UNITS . ')' . self::WORD_BOUNDARY . '/Sxu';
     43    const REGEX = '/(\d\.?)\s(' . self::STANDARD_UNITS . ')' . self::WORD_BOUNDARY . '/Sxu';
    4444    private const STANDARD_UNITS = '
    4545        ### Temporal units
    46         (?:ms|s|secs?|mins?|hrs?)\\.?|
     46        (?:ms|s|secs?|mins?|hrs?)\.?|
    4747        milliseconds?|seconds?|minutes?|hours?|days?|years?|decades?|century|centuries|millennium|millennia|
    4848
    4949        ### Imperial units
    50         (?:in|ft|yd|mi)\\.?|
    51         (?:ac|ha|oz|pt|qt|gal|lb|st)\\.?
    52         s\\.f\\.|sf|s\\.i\\.|si|square[ ]feet|square[ ]foot|
     50        (?:in|ft|yd|mi)\.?|
     51        (?:ac|ha|oz|pt|qt|gal|lb|st)\.?
     52        s\.f\.|sf|s\.i\.|si|square[ ]feet|square[ ]foot|
    5353        inch|inches|foot|feet|yards?|miles?|acres?|hectares?|ounces?|pints?|quarts?|gallons?|pounds?|stones?|
    5454
     
    6363
    6464        ### Money
    65         ¢|M?(?:£|¥|€|\\$)|
     65        ¢|M?(?:£|¥|€|\$)|
    6666
    6767        ### Other units
     
    7171    // required modifiers: x (multiline pattern), u (unicode).
    7272    // (?=\p{^L})|\z) is used instead of \b because otherwise the special symbols ($, € etc.) would not match properly (they are not word characters).
    73     const WORD_BOUNDARY = '(?:(?=\\p{^L})|\\z)';
     73    const WORD_BOUNDARY = '(?:(?=\p{^L})|\z)';
    7474    /**
    7575     * Creates a new fix object.
     
    102102 * @since 5.0.0
    103103 */
    104 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Node_Fixes\\Unit_Spacing_Fix', 'PHP_Typography\\Fixes\\Node_Fixes\\Unit_Spacing_Fix', \false);
     104\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Unit_Spacing_Fix', 'PHP_Typography\Fixes\Node_Fixes\Unit_Spacing_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/token-fixes/class-abstract-token-fix.php

    r2819294 r3208262  
    7272     * @return Token[] An array of tokens.
    7373     */
    74     public abstract function apply(array $tokens, Settings $settings, $is_title = \false, \DOMText $textnode = null);
     74    abstract public function apply(array $tokens, Settings $settings, $is_title = \false, \DOMText $textnode = null);
    7575    /**
    7676     * Determines whether the fix should be applied to (RSS) feeds.
     
    9999 * @since 5.0.0
    100100 */
    101 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Token_Fixes\\Abstract_Token_Fix', 'PHP_Typography\\Fixes\\Token_Fixes\\Abstract_Token_Fix', \false);
     101\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Abstract_Token_Fix', 'PHP_Typography\Fixes\Token_Fixes\Abstract_Token_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/token-fixes/class-hyphenate-compounds-fix.php

    r2819294 r3208262  
    9393 * @since 5.0.0
    9494 */
    95 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Token_Fixes\\Hyphenate_Compounds_Fix', 'PHP_Typography\\Fixes\\Token_Fixes\\Hyphenate_Compounds_Fix', \false);
     95\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Hyphenate_Compounds_Fix', 'PHP_Typography\Fixes\Token_Fixes\Hyphenate_Compounds_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/token-fixes/class-hyphenate-fix.php

    r2819294 r3208262  
    143143     * @param Hyphenator\Cache $cache Required.
    144144     */
    145     public function set_hyphenator_cache(Hyphenator\Cache $cache) : void
     145    public function set_hyphenator_cache(Hyphenator\Cache $cache): void
    146146    {
    147147        $this->cache = $cache;
     
    155155 * @since 5.0.0
    156156 */
    157 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Token_Fixes\\Hyphenate_Fix', 'PHP_Typography\\Fixes\\Token_Fixes\\Hyphenate_Fix', \false);
     157\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Hyphenate_Fix', 'PHP_Typography\Fixes\Token_Fixes\Hyphenate_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/token-fixes/class-smart-dashes-hyphen-fix.php

    r2819294 r3208262  
    7777 * @since 6.3.0
    7878 */
    79 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Token_Fixes\\Smart_Dashes_Hyphen_Fix', 'PHP_Typography\\Fixes\\Token_Fixes\\Smart_Dashes_Hyphen_Fix', \false);
     79\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Smart_Dashes_Hyphen_Fix', 'PHP_Typography\Fixes\Token_Fixes\Smart_Dashes_Hyphen_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/token-fixes/class-wrap-emails-fix.php

    r2819294 r3208262  
    5757        $this->email_pattern = "/(?:\n\t\t\t\\A\n\t\t\t[a-z0-9\\!\\#\$\\%\\&\\'\\*\\+\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~\\-]+\n\t\t\t(?:\n\t\t\t\t\\.\n\t\t\t\t[a-z0-9\\!\\#\$\\%\\&\\'\\*\\+\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~\\-]+\n\t\t\t)*\n\t\t\t@\n\t\t\t(?:\n\t\t\t\t[a-z0-9]\n\t\t\t\t[a-z0-9\\-]{0,61}\n\t\t\t\t[a-z0-9]\n\t\t\t\t\\.\n\t\t\t)+\n\t\t\t(?:\n\t\t\t\t" . RE::top_level_domains() . '
    5858            )
    59             \\Z
     59            \Z
    6060        )/Sxi';
    6161        // required modifiers: x (multiline pattern) i (case insensitive).
     
    9393 * @since 5.0.0
    9494 */
    95 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Token_Fixes\\Wrap_Emails_Fix', 'PHP_Typography\\Fixes\\Token_Fixes\\Wrap_Emails_Fix', \false);
     95\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Wrap_Emails_Fix', 'PHP_Typography\Fixes\Token_Fixes\Wrap_Emails_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/token-fixes/class-wrap-hard-hyphens-fix.php

    r2819294 r3208262  
    9898 * @since 5.0.0
    9999 */
    100 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Token_Fixes\\Wrap_Hard_Hyphens_Fix', 'PHP_Typography\\Fixes\\Token_Fixes\\Wrap_Hard_Hyphens_Fix', \false);
     100\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Wrap_Hard_Hyphens_Fix', 'PHP_Typography\Fixes\Token_Fixes\Wrap_Hard_Hyphens_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/fixes/token-fixes/class-wrap-urls-fix.php

    r2819294 r3208262  
    4646    // Valid URL schemes.
    4747    const URL_SCHEME = '(?:https?|ftps?|file|nfs|feed|itms|itpc)';
    48     const WRAP_URLS_DOMAIN_PARTS = '#(\\-|\\.)#';
     48    const WRAP_URLS_DOMAIN_PARTS = '#(\-|\.)#';
    4949    /**
    5050     * The URL matching regular expression.
     
    6464        // Combined URL pattern.
    6565        $this->url_pattern = '`(?:
    66             \\A
    67             (?<scheme>' . self::URL_SCHEME . ':\\/\\/)?         # Subpattern 1: contains _http://_ if it exists
     66            \A
     67            (?<scheme>' . self::URL_SCHEME . ':\/\/)?           # Subpattern 1: contains _http://_ if it exists
    6868            (?<domain>                                          # Subpattern 2: contains subdomains.domain.tld
    6969                (?:
    7070                    [a-z0-9]                                    # first chr of (sub)domain can not be a hyphen
    71                     [a-z0-9\\-]{0,61}                           # middle chrs of (sub)domain may be a hyphen;
     71                    [a-z0-9\-]{0,61}                            # middle chrs of (sub)domain may be a hyphen;
    7272                                                                # limit qty of middle chrs so total domain does not exceed 63 chrs
    7373                    [a-z0-9]                                    # last chr of (sub)domain can not be a hyphen
    74                     \\.                                         # dot separator
     74                    \.                                          # dot separator
    7575                )+
    7676                (?:
     
    8686            (?<path>                                            # Subpattern 3: contains path following domain
    8787                (?:
    88                     \\/                                         # marks nested directory
    89                     [a-z0-9\\"\\$\\-_\\.\\+!\\*\'\\(\\),;\\?:@=&\\#]+       # valid characters within directory structure
     88                    \/                                          # marks nested directory
     89                    [a-z0-9\"\$\-_\.\+!\*\'\(\),;\?:@=&\#]+     # valid characters within directory structure
    9090                )*
    91                 [\\/]?                                          # trailing slash if any
     91                [\/]?                                           # trailing slash if any
    9292            )
    93             \\Z
     93            \Z
    9494        )`xi';
    9595        // required modifiers: x (multiline pattern) i (case insensitive).
     
    139139     * @return string             The hyphenated domain name.
    140140     */
    141     private function split_domain(string $domain, Settings $settings) : string
     141    private function split_domain(string $domain, Settings $settings): string
    142142    {
    143143        $domain_parts = \preg_split(self::WRAP_URLS_DOMAIN_PARTS, $domain, -1, \PREG_SPLIT_DELIM_CAPTURE);
     
    177177     * @return string             The hyphenated domain name.
    178178     */
    179     private function split_path(string $path, Settings $settings) : string
     179    private function split_path(string $path, Settings $settings): string
    180180    {
    181181        // Break up the URL path to individual characters.
     
    201201 * @since 5.0.0
    202202 */
    203 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Fixes\\Token_Fixes\\Wrap_URLs_Fix', 'PHP_Typography\\Fixes\\Token_Fixes\\Wrap_URLs_Fix', \false);
     203\class_alias('WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Wrap_URLs_Fix', 'PHP_Typography\Fixes\Token_Fixes\Wrap_URLs_Fix', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/hyphenator/class-cache.php

    r2819294 r3208262  
    6464     * @param Hyphenator $hyphenator The object to cache.
    6565     */
    66     public function set_hyphenator($lang, Hyphenator $hyphenator) : void
     66    public function set_hyphenator($lang, Hyphenator $hyphenator): void
    6767    {
    6868        $this->cache[$lang] = $hyphenator;
     
    101101 * @author Peter Putzer <github@mundschenk.at>
    102102 */
    103 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Hyphenator\\Cache', 'PHP_Typography\\Hyphenator\\Cache', \false);
     103\class_alias('WP_Typography\Vendor\PHP_Typography\Hyphenator\Cache', 'PHP_Typography\Hyphenator\Cache', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/hyphenator/class-trie-node.php

    r2819294 r3208262  
    126126 * @since 5.0.0
    127127 */
    128 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Hyphenator\\Trie_Node', 'PHP_Typography\\Hyphenator\\Trie_Node', \false);
     128\class_alias('WP_Typography\Vendor\PHP_Typography\Hyphenator\Trie_Node', 'PHP_Typography\Hyphenator\Trie_Node', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/settings/class-dash-style.php

    r2819294 r3208262  
    113113 * @since 5.0.0
    114114 */
    115 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Settings\\Dash_Style', 'PHP_Typography\\Settings\\Dash_Style', \false);
     115\class_alias('WP_Typography\Vendor\PHP_Typography\Settings\Dash_Style', 'PHP_Typography\Settings\Dash_Style', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/settings/class-dashes.php

    r2819294 r3208262  
    6868 * @since 5.0.0
    6969 */
    70 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Settings\\Dashes', 'PHP_Typography\\Settings\\Dashes', \false);
     70\class_alias('WP_Typography\Vendor\PHP_Typography\Settings\Dashes', 'PHP_Typography\Settings\Dashes', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/settings/class-quote-style.php

    r2819294 r3208262  
    101101 * @since 5.0.0
    102102 */
    103 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Settings\\Quote_Style', 'PHP_Typography\\Settings\\Quote_Style', \false);
     103\class_alias('WP_Typography\Vendor\PHP_Typography\Settings\Quote_Style', 'PHP_Typography\Settings\Quote_Style', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/settings/class-quotes.php

    r2819294 r3208262  
    5656 * @since 5.0.0
    5757 */
    58 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Settings\\Quotes', 'PHP_Typography\\Settings\\Quotes', \false);
     58\class_alias('WP_Typography\Vendor\PHP_Typography\Settings\Quotes', 'PHP_Typography\Settings\Quotes', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/settings/class-simple-dashes.php

    r2819294 r3208262  
    119119 * @since 5.0.0
    120120 */
    121 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Settings\\Simple_Dashes', 'PHP_Typography\\Settings\\Simple_Dashes', \false);
     121\class_alias('WP_Typography\Vendor\PHP_Typography\Settings\Simple_Dashes', 'PHP_Typography\Settings\Simple_Dashes', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/settings/class-simple-quotes.php

    r2819294 r3208262  
    8585 * @since 5.0.0
    8686 */
    87 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Settings\\Simple_Quotes', 'PHP_Typography\\Settings\\Simple_Quotes', \false);
     87\class_alias('WP_Typography\Vendor\PHP_Typography\Settings\Simple_Quotes', 'PHP_Typography\Settings\Simple_Quotes', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/text-parser/class-token.php

    r2819294 r3208262  
    127127    public function __set($id, $val)
    128128    {
    129         throw new \BadMethodCallException('Object of class Text_Parser\\Token is immutable.');
     129        throw new \BadMethodCallException('Object of class Text_Parser\Token is immutable.');
    130130    }
    131131    /**
     
    139139    public function __unset($id)
    140140    {
    141         throw new \BadMethodCallException('Object of class Text_Parser\\Token is immutable.');
     141        throw new \BadMethodCallException('Object of class Text_Parser\Token is immutable.');
    142142    }
    143143    /**
     
    176176 * @property-read bool   $mutable Wether the properties of the object can be modified.
    177177 */
    178 \class_alias('WP_Typography\\Vendor\\PHP_Typography\\Text_Parser\\Token', 'PHP_Typography\\Text_Parser\\Token', \false);
     178\class_alias('WP_Typography\Vendor\PHP_Typography\Text_Parser\Token', 'PHP_Typography\Text_Parser\Token', \false);
  • wp-typography/trunk/vendor-scoped/mundschenk-at/wp-data-storage/src/class-abstract-cache.php

    r2207810 r3208262  
    6363     * @return void
    6464     */
    65     public abstract function invalidate();
     65    abstract public function invalidate();
    6666    /**
    6767     * Retrieves a cached value.
     
    7171     * @return mixed
    7272     */
    73     public abstract function get($key);
     73    abstract public function get($key);
    7474    /**
    7575     * Sets an entry in the cache and stores the key.
     
    8181     * @return bool True if the cache could be set successfully.
    8282     */
    83     public abstract function set($key, $value, $duration = 0);
     83    abstract public function set($key, $value, $duration = 0);
    8484    /**
    8585     * Deletes an entry from the cache.
     
    8989     * @return bool True on successful removal, false on failure.
    9090     */
    91     public abstract function delete($key);
     91    abstract public function delete($key);
    9292    /**
    9393     * Retrieves the complete key to use.
  • wp-typography/trunk/vendor-scoped/mundschenk-at/wp-data-storage/src/class-cache.php

    r2663994 r3208262  
    6464    public function invalidate()
    6565    {
    66         $this->incrementor = \time();
     66        $this->incrementor = time();
    6767        \wp_cache_set($this->incrementor_key, $this->incrementor, $this->group, 0);
    6868    }
  • wp-typography/trunk/vendor-scoped/mundschenk-at/wp-data-storage/src/class-network-options.php

    r2663994 r3208262  
    6363    {
    6464        $value = \get_network_option($this->network_id, $raw ? $option : $this->get_name($option), $default);
    65         if (\is_array($default) && '' === $value) {
     65        if (is_array($default) && '' === $value) {
    6666            $value = [];
    6767        }
  • wp-typography/trunk/vendor-scoped/mundschenk-at/wp-data-storage/src/class-options.php

    r2207810 r3208262  
    6161    {
    6262        $value = \get_option($raw ? $option : $this->get_name($option), $default);
    63         if (\is_array($default) && '' === $value) {
     63        if (is_array($default) && '' === $value) {
    6464            $value = [];
    6565        }
  • wp-typography/trunk/vendor-scoped/mundschenk-at/wp-data-storage/src/class-site-transients.php

    r2819294 r3208262  
    4343    {
    4444        // If we are not running on multisite, fall back to the parent implementation.
    45         if (!\is_multisite()) {
     45        if (!is_multisite()) {
    4646            return parent::get_keys_from_database();
    4747        }
  • wp-typography/trunk/vendor-scoped/mundschenk-at/wp-data-storage/src/class-transients.php

    r2819294 r3208262  
    6464        }
    6565        // Update incrementor.
    66         $this->incrementor = \time();
     66        $this->incrementor = time();
    6767        $this->set($this->incrementor_key, $this->incrementor, 0, \true);
    6868    }
  • wp-typography/trunk/vendor-scoped/mundschenk-at/wp-settings-ui/src/ui/class-abstract-control.php

    r2663994 r3208262  
    188188        $this->settings_args = $settings_args;
    189189        $this->sanitize_callback = $sanitize_callback;
    190         $this->base_path = \dirname(\dirname(__DIR__));
     190        $this->base_path = dirname(dirname(__DIR__));
    191191    }
    192192    /**
     
    247247     * @return string
    248248     */
    249     protected abstract function get_element_markup();
     249    abstract protected function get_element_markup();
    250250    /**
    251251     * Render the HTML representation of the control.
     
    334334    protected function label_has_placeholder()
    335335    {
    336         return \false !== \strpos($this->label, '%1$s');
     336        return \false !== strpos($this->label, '%1$s');
    337337    }
    338338    /**
     
    354354    {
    355355        if ($this->label_has_placeholder()) {
    356             return \sprintf($this->label, $this->get_element_markup());
     356            return sprintf($this->label, $this->get_element_markup());
    357357        } else {
    358358            return $this->label;
  • wp-typography/trunk/vendor-scoped/scoper-autoload.php

    r2852338 r3208262  
    33// scoper-autoload.php @generated by PhpScoper
    44
    5 $loader = require_once __DIR__.'/autoload.php';
     5$loader = (static function () {
     6    // Backup the autoloaded Composer files
     7    $existingComposerAutoloadFiles = isset($GLOBALS['__composer_autoload_files']) ? $GLOBALS['__composer_autoload_files'] : [];
    68
    7 // Exposed classes. For more information see:
    8 // https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#exposing-classes
    9 if (!class_exists('PHP_Typography\Fixes\Token_Fix', false) && !interface_exists('PHP_Typography\Fixes\Token_Fix', false) && !trait_exists('PHP_Typography\Fixes\Token_Fix', false)) {
    10     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fix');
     9    $loader = require_once __DIR__.'/autoload.php';
     10    // Ensure InstalledVersions is available
     11    $installedVersionsPath = __DIR__.'/composer/InstalledVersions.php';
     12    if (file_exists($installedVersionsPath)) require_once $installedVersionsPath;
     13
     14    // Restore the backup and ensure the excluded files are properly marked as loaded
     15    $GLOBALS['__composer_autoload_files'] = \array_merge(
     16        $existingComposerAutoloadFiles,
     17        \array_fill_keys([], true)
     18    );
     19
     20    return $loader;
     21})();
     22
     23// Class aliases. For more information see:
     24// https://github.com/humbug/php-scoper/blob/master/docs/further-reading.md#class-aliases
     25if (!function_exists('humbug_phpscoper_expose_class')) {
     26    function humbug_phpscoper_expose_class($exposed, $prefixed) {
     27        if (!class_exists($exposed, false) && !interface_exists($exposed, false) && !trait_exists($exposed, false)) {
     28            spl_autoload_call($prefixed);
     29        }
     30    }
    1131}
    12 if (!class_exists('PHP_Typography\Fixes\Default_Registry', false) && !interface_exists('PHP_Typography\Fixes\Default_Registry', false) && !trait_exists('PHP_Typography\Fixes\Default_Registry', false)) {
    13     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Default_Registry');
    14 }
    15 if (!class_exists('PHP_Typography\Fixes\Token_Fixes\Hyphenate_Fix', false) && !interface_exists('PHP_Typography\Fixes\Token_Fixes\Hyphenate_Fix', false) && !trait_exists('PHP_Typography\Fixes\Token_Fixes\Hyphenate_Fix', false)) {
    16     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Hyphenate_Fix');
    17 }
    18 if (!class_exists('PHP_Typography\Fixes\Token_Fixes\Hyphenate_Compounds_Fix', false) && !interface_exists('PHP_Typography\Fixes\Token_Fixes\Hyphenate_Compounds_Fix', false) && !trait_exists('PHP_Typography\Fixes\Token_Fixes\Hyphenate_Compounds_Fix', false)) {
    19     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Hyphenate_Compounds_Fix');
    20 }
    21 if (!class_exists('PHP_Typography\Fixes\Token_Fixes\Smart_Dashes_Hyphen_Fix', false) && !interface_exists('PHP_Typography\Fixes\Token_Fixes\Smart_Dashes_Hyphen_Fix', false) && !trait_exists('PHP_Typography\Fixes\Token_Fixes\Smart_Dashes_Hyphen_Fix', false)) {
    22     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Smart_Dashes_Hyphen_Fix');
    23 }
    24 if (!class_exists('PHP_Typography\Fixes\Token_Fixes\Abstract_Token_Fix', false) && !interface_exists('PHP_Typography\Fixes\Token_Fixes\Abstract_Token_Fix', false) && !trait_exists('PHP_Typography\Fixes\Token_Fixes\Abstract_Token_Fix', false)) {
    25     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Abstract_Token_Fix');
    26 }
    27 if (!class_exists('PHP_Typography\Fixes\Token_Fixes\Wrap_URLs_Fix', false) && !interface_exists('PHP_Typography\Fixes\Token_Fixes\Wrap_URLs_Fix', false) && !trait_exists('PHP_Typography\Fixes\Token_Fixes\Wrap_URLs_Fix', false)) {
    28     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Wrap_URLs_Fix');
    29 }
    30 if (!class_exists('PHP_Typography\Fixes\Token_Fixes\Wrap_Emails_Fix', false) && !interface_exists('PHP_Typography\Fixes\Token_Fixes\Wrap_Emails_Fix', false) && !trait_exists('PHP_Typography\Fixes\Token_Fixes\Wrap_Emails_Fix', false)) {
    31     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Wrap_Emails_Fix');
    32 }
    33 if (!class_exists('PHP_Typography\Fixes\Token_Fixes\Wrap_Hard_Hyphens_Fix', false) && !interface_exists('PHP_Typography\Fixes\Token_Fixes\Wrap_Hard_Hyphens_Fix', false) && !trait_exists('PHP_Typography\Fixes\Token_Fixes\Wrap_Hard_Hyphens_Fix', false)) {
    34     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Wrap_Hard_Hyphens_Fix');
    35 }
    36 if (!class_exists('PHP_Typography\Fixes\Registry', false) && !interface_exists('PHP_Typography\Fixes\Registry', false) && !trait_exists('PHP_Typography\Fixes\Registry', false)) {
    37     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Registry');
    38 }
    39 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Space_Collapse_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Space_Collapse_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Space_Collapse_Fix', false)) {
    40     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Space_Collapse_Fix');
    41 }
    42 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Fractions_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Fractions_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Fractions_Fix', false)) {
    43     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Fractions_Fix');
    44 }
    45 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Dash_Spacing_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Dash_Spacing_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Dash_Spacing_Fix', false)) {
    46     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Dash_Spacing_Fix');
    47 }
    48 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Dewidow_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Dewidow_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Dewidow_Fix', false)) {
    49     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Dewidow_Fix');
    50 }
    51 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Style_Numbers_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Style_Numbers_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Style_Numbers_Fix', false)) {
    52     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Style_Numbers_Fix');
    53 }
    54 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Maths_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Maths_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Maths_Fix', false)) {
    55     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Maths_Fix');
    56 }
    57 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Diacritics_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Diacritics_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Diacritics_Fix', false)) {
    58     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Diacritics_Fix');
    59 }
    60 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Ordinal_Suffix_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Ordinal_Suffix_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Ordinal_Suffix_Fix', false)) {
    61     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Ordinal_Suffix_Fix');
    62 }
    63 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Process_Words_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Process_Words_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Process_Words_Fix', false)) {
    64     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Process_Words_Fix');
    65 }
    66 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Area_Units_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Area_Units_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Area_Units_Fix', false)) {
    67     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Area_Units_Fix');
    68 }
    69 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Style_Hanging_Punctuation_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Style_Hanging_Punctuation_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Style_Hanging_Punctuation_Fix', false)) {
    70     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Style_Hanging_Punctuation_Fix');
    71 }
    72 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Simple_Style_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Simple_Style_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Simple_Style_Fix', false)) {
    73     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Simple_Style_Fix');
    74 }
    75 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Quotes_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Quotes_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Quotes_Fix', false)) {
    76     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Quotes_Fix');
    77 }
    78 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Exponents_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Exponents_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Exponents_Fix', false)) {
    79     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Exponents_Fix');
    80 }
    81 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Style_Caps_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Style_Caps_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Style_Caps_Fix', false)) {
    82     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Style_Caps_Fix');
    83 }
    84 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Single_Character_Word_Spacing_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Single_Character_Word_Spacing_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Single_Character_Word_Spacing_Fix', false)) {
    85     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Single_Character_Word_Spacing_Fix');
    86 }
    87 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Numbered_Abbreviation_Spacing_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Numbered_Abbreviation_Spacing_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Numbered_Abbreviation_Spacing_Fix', false)) {
    88     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Numbered_Abbreviation_Spacing_Fix');
    89 }
    90 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Abstract_Node_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Abstract_Node_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Abstract_Node_Fix', false)) {
    91     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Abstract_Node_Fix');
    92 }
    93 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Unit_Spacing_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Unit_Spacing_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Unit_Spacing_Fix', false)) {
    94     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Unit_Spacing_Fix');
    95 }
    96 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Dashes_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Dashes_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Dashes_Fix', false)) {
    97     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Dashes_Fix');
    98 }
    99 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Style_Initial_Quotes_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Style_Initial_Quotes_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Style_Initial_Quotes_Fix', false)) {
    100     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Style_Initial_Quotes_Fix');
    101 }
    102 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\French_Punctuation_Spacing_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\French_Punctuation_Spacing_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\French_Punctuation_Spacing_Fix', false)) {
    103     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\French_Punctuation_Spacing_Fix');
    104 }
    105 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Marks_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Marks_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Marks_Fix', false)) {
    106     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Marks_Fix');
    107 }
    108 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Style_Ampersands_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Style_Ampersands_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Style_Ampersands_Fix', false)) {
    109     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Style_Ampersands_Fix');
    110 }
    111 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Simple_Regex_Replacement_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Simple_Regex_Replacement_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Simple_Regex_Replacement_Fix', false)) {
    112     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Simple_Regex_Replacement_Fix');
    113 }
    114 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Classes_Dependent_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Classes_Dependent_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Classes_Dependent_Fix', false)) {
    115     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Classes_Dependent_Fix');
    116 }
    117 if (!class_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Ellipses_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Ellipses_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fixes\Smart_Ellipses_Fix', false)) {
    118     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Ellipses_Fix');
    119 }
    120 if (!class_exists('PHP_Typography\Fixes\Node_Fix', false) && !interface_exists('PHP_Typography\Fixes\Node_Fix', false) && !trait_exists('PHP_Typography\Fixes\Node_Fix', false)) {
    121     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fix');
    122 }
    123 if (!class_exists('PHP_Typography\Settings\Simple_Quotes', false) && !interface_exists('PHP_Typography\Settings\Simple_Quotes', false) && !trait_exists('PHP_Typography\Settings\Simple_Quotes', false)) {
    124     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Settings\Simple_Quotes');
    125 }
    126 if (!class_exists('PHP_Typography\Settings\Simple_Dashes', false) && !interface_exists('PHP_Typography\Settings\Simple_Dashes', false) && !trait_exists('PHP_Typography\Settings\Simple_Dashes', false)) {
    127     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Settings\Simple_Dashes');
    128 }
    129 if (!class_exists('PHP_Typography\Settings\Quote_Style', false) && !interface_exists('PHP_Typography\Settings\Quote_Style', false) && !trait_exists('PHP_Typography\Settings\Quote_Style', false)) {
    130     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Settings\Quote_Style');
    131 }
    132 if (!class_exists('PHP_Typography\Settings\Quotes', false) && !interface_exists('PHP_Typography\Settings\Quotes', false) && !trait_exists('PHP_Typography\Settings\Quotes', false)) {
    133     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Settings\Quotes');
    134 }
    135 if (!class_exists('PHP_Typography\Settings\Dashes', false) && !interface_exists('PHP_Typography\Settings\Dashes', false) && !trait_exists('PHP_Typography\Settings\Dashes', false)) {
    136     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Settings\Dashes');
    137 }
    138 if (!class_exists('PHP_Typography\Settings\Dash_Style', false) && !interface_exists('PHP_Typography\Settings\Dash_Style', false) && !trait_exists('PHP_Typography\Settings\Dash_Style', false)) {
    139     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Settings\Dash_Style');
    140 }
    141 if (!class_exists('PHP_Typography\U', false) && !interface_exists('PHP_Typography\U', false) && !trait_exists('PHP_Typography\U', false)) {
    142     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\U');
    143 }
    144 if (!class_exists('PHP_Typography\RE', false) && !interface_exists('PHP_Typography\RE', false) && !trait_exists('PHP_Typography\RE', false)) {
    145     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\RE');
    146 }
    147 if (!class_exists('PHP_Typography\PHP_Typography', false) && !interface_exists('PHP_Typography\PHP_Typography', false) && !trait_exists('PHP_Typography\PHP_Typography', false)) {
    148     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\PHP_Typography');
    149 }
    150 if (!class_exists('PHP_Typography\Text_Parser', false) && !interface_exists('PHP_Typography\Text_Parser', false) && !trait_exists('PHP_Typography\Text_Parser', false)) {
    151     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Text_Parser');
    152 }
    153 if (!class_exists('PHP_Typography\Strings', false) && !interface_exists('PHP_Typography\Strings', false) && !trait_exists('PHP_Typography\Strings', false)) {
    154     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Strings');
    155 }
    156 if (!class_exists('PHP_Typography\Hyphenator\Trie_Node', false) && !interface_exists('PHP_Typography\Hyphenator\Trie_Node', false) && !trait_exists('PHP_Typography\Hyphenator\Trie_Node', false)) {
    157     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Hyphenator\Trie_Node');
    158 }
    159 if (!class_exists('PHP_Typography\Hyphenator\Cache', false) && !interface_exists('PHP_Typography\Hyphenator\Cache', false) && !trait_exists('PHP_Typography\Hyphenator\Cache', false)) {
    160     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Hyphenator\Cache');
    161 }
    162 if (!class_exists('PHP_Typography\Settings', false) && !interface_exists('PHP_Typography\Settings', false) && !trait_exists('PHP_Typography\Settings', false)) {
    163     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Settings');
    164 }
    165 if (!class_exists('PHP_Typography\DOM', false) && !interface_exists('PHP_Typography\DOM', false) && !trait_exists('PHP_Typography\DOM', false)) {
    166     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\DOM');
    167 }
    168 if (!class_exists('PHP_Typography\Hyphenator', false) && !interface_exists('PHP_Typography\Hyphenator', false) && !trait_exists('PHP_Typography\Hyphenator', false)) {
    169     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Hyphenator');
    170 }
    171 if (!class_exists('PHP_Typography\Text_Parser\Token', false) && !interface_exists('PHP_Typography\Text_Parser\Token', false) && !trait_exists('PHP_Typography\Text_Parser\Token', false)) {
    172     spl_autoload_call('WP_Typography\Vendor\PHP_Typography\Text_Parser\Token');
    173 }
     32humbug_phpscoper_expose_class('PHP_Typography\Fixes\Token_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fix');
     33humbug_phpscoper_expose_class('PHP_Typography\Fixes\Default_Registry', 'WP_Typography\Vendor\PHP_Typography\Fixes\Default_Registry');
     34humbug_phpscoper_expose_class('PHP_Typography\Fixes\Token_Fixes\Hyphenate_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Hyphenate_Fix');
     35humbug_phpscoper_expose_class('PHP_Typography\Fixes\Token_Fixes\Hyphenate_Compounds_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Hyphenate_Compounds_Fix');
     36humbug_phpscoper_expose_class('PHP_Typography\Fixes\Token_Fixes\Smart_Dashes_Hyphen_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Smart_Dashes_Hyphen_Fix');
     37humbug_phpscoper_expose_class('PHP_Typography\Fixes\Token_Fixes\Abstract_Token_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Abstract_Token_Fix');
     38humbug_phpscoper_expose_class('PHP_Typography\Fixes\Token_Fixes\Wrap_URLs_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Wrap_URLs_Fix');
     39humbug_phpscoper_expose_class('PHP_Typography\Fixes\Token_Fixes\Wrap_Emails_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Wrap_Emails_Fix');
     40humbug_phpscoper_expose_class('PHP_Typography\Fixes\Token_Fixes\Wrap_Hard_Hyphens_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Wrap_Hard_Hyphens_Fix');
     41humbug_phpscoper_expose_class('PHP_Typography\Fixes\Registry', 'WP_Typography\Vendor\PHP_Typography\Fixes\Registry');
     42humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Space_Collapse_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Space_Collapse_Fix');
     43humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Smart_Fractions_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Fractions_Fix');
     44humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Dash_Spacing_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Dash_Spacing_Fix');
     45humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Dewidow_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Dewidow_Fix');
     46humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Style_Numbers_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Style_Numbers_Fix');
     47humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Smart_Maths_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Maths_Fix');
     48humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Smart_Diacritics_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Diacritics_Fix');
     49humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Smart_Ordinal_Suffix_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Ordinal_Suffix_Fix');
     50humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Process_Words_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Process_Words_Fix');
     51humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Smart_Area_Units_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Area_Units_Fix');
     52humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Style_Hanging_Punctuation_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Style_Hanging_Punctuation_Fix');
     53humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Simple_Style_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Simple_Style_Fix');
     54humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Smart_Quotes_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Quotes_Fix');
     55humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Smart_Exponents_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Exponents_Fix');
     56humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Style_Caps_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Style_Caps_Fix');
     57humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Single_Character_Word_Spacing_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Single_Character_Word_Spacing_Fix');
     58humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Numbered_Abbreviation_Spacing_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Numbered_Abbreviation_Spacing_Fix');
     59humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Abstract_Node_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Abstract_Node_Fix');
     60humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Unit_Spacing_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Unit_Spacing_Fix');
     61humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Smart_Dashes_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Dashes_Fix');
     62humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Style_Initial_Quotes_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Style_Initial_Quotes_Fix');
     63humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\French_Punctuation_Spacing_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\French_Punctuation_Spacing_Fix');
     64humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Smart_Marks_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Marks_Fix');
     65humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Style_Ampersands_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Style_Ampersands_Fix');
     66humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Simple_Regex_Replacement_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Simple_Regex_Replacement_Fix');
     67humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Classes_Dependent_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Classes_Dependent_Fix');
     68humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Smart_Ellipses_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Ellipses_Fix');
     69humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fix');
     70humbug_phpscoper_expose_class('PHP_Typography\Settings\Simple_Quotes', 'WP_Typography\Vendor\PHP_Typography\Settings\Simple_Quotes');
     71humbug_phpscoper_expose_class('PHP_Typography\Settings\Simple_Dashes', 'WP_Typography\Vendor\PHP_Typography\Settings\Simple_Dashes');
     72humbug_phpscoper_expose_class('PHP_Typography\Settings\Quote_Style', 'WP_Typography\Vendor\PHP_Typography\Settings\Quote_Style');
     73humbug_phpscoper_expose_class('PHP_Typography\Settings\Quotes', 'WP_Typography\Vendor\PHP_Typography\Settings\Quotes');
     74humbug_phpscoper_expose_class('PHP_Typography\Settings\Dashes', 'WP_Typography\Vendor\PHP_Typography\Settings\Dashes');
     75humbug_phpscoper_expose_class('PHP_Typography\Settings\Dash_Style', 'WP_Typography\Vendor\PHP_Typography\Settings\Dash_Style');
     76humbug_phpscoper_expose_class('PHP_Typography\U', 'WP_Typography\Vendor\PHP_Typography\U');
     77humbug_phpscoper_expose_class('PHP_Typography\RE', 'WP_Typography\Vendor\PHP_Typography\RE');
     78humbug_phpscoper_expose_class('PHP_Typography\PHP_Typography', 'WP_Typography\Vendor\PHP_Typography\PHP_Typography');
     79humbug_phpscoper_expose_class('PHP_Typography\Text_Parser', 'WP_Typography\Vendor\PHP_Typography\Text_Parser');
     80humbug_phpscoper_expose_class('PHP_Typography\Strings', 'WP_Typography\Vendor\PHP_Typography\Strings');
     81humbug_phpscoper_expose_class('PHP_Typography\Hyphenator\Trie_Node', 'WP_Typography\Vendor\PHP_Typography\Hyphenator\Trie_Node');
     82humbug_phpscoper_expose_class('PHP_Typography\Hyphenator\Cache', 'WP_Typography\Vendor\PHP_Typography\Hyphenator\Cache');
     83humbug_phpscoper_expose_class('PHP_Typography\Settings', 'WP_Typography\Vendor\PHP_Typography\Settings');
     84humbug_phpscoper_expose_class('PHP_Typography\DOM', 'WP_Typography\Vendor\PHP_Typography\DOM');
     85humbug_phpscoper_expose_class('PHP_Typography\Hyphenator', 'WP_Typography\Vendor\PHP_Typography\Hyphenator');
     86humbug_phpscoper_expose_class('PHP_Typography\Text_Parser\Token', 'WP_Typography\Vendor\PHP_Typography\Text_Parser\Token');
    17487
    17588return $loader;
  • wp-typography/trunk/wp-typography.php

    r2852644 r3208262  
    3030 *  Author: Peter Putzer
    3131 *  Author URI: https://code.mundschenk.at
    32  *  Version: 5.9.1
    33  *  Requires at least: 5.3
     32 *  Version: 5.10.0-alpha.2
     33 *  Requires at least: 6.6
    3434 *  Requires PHP: 7.4
    3535 *  License: GNU General Public License v2 or later
Note: See TracChangeset for help on using the changeset viewer.