Changeset 3208262
- Timestamp:
- 12/15/2024 08:22:01 PM (16 months ago)
- Location:
- wp-typography/trunk
- Files:
-
- 10 added
- 4 deleted
- 121 edited
-
CHANGELOG.md (modified) (1 diff)
-
admin/block-editor/js/blocks.asset.php (added)
-
admin/block-editor/js/blocks.js (added)
-
admin/block-editor/js/index.asset.php (deleted)
-
admin/block-editor/js/index.js (deleted)
-
admin/block-editor/js/plugins.asset.php (added)
-
admin/block-editor/js/plugins.js (added)
-
admin/block-editor/src/blocks/index.js (added)
-
admin/block-editor/src/blocks/typography/edit.js (modified) (3 diffs)
-
admin/block-editor/src/blocks/typography/index.js (modified) (4 diffs)
-
admin/block-editor/src/blocks/typography/save.js (modified) (2 diffs)
-
admin/block-editor/src/index.js (deleted)
-
admin/block-editor/src/plugins/index.js (added)
-
admin/block-editor/src/plugins/sidebar-post-toggle/index.js (modified) (5 diffs)
-
admin/block-editor/src/plugins/sidebar-post-toggle/toggle-control.js (modified) (2 diffs)
-
admin/partials/settings/settings-page.php (modified) (3 diffs)
-
includes/class-wp-typography.php (modified) (15 diffs)
-
includes/wp-typography/class-factory.php (modified) (10 diffs)
-
includes/wp-typography/class-implementation.php (modified) (24 diffs)
-
includes/wp-typography/class-plugin-controller.php (modified) (5 diffs)
-
includes/wp-typography/class-requirements.php (modified) (5 diffs)
-
includes/wp-typography/components/class-admin-interface.php (modified) (24 diffs)
-
includes/wp-typography/components/class-block-editor.php (modified) (7 diffs)
-
includes/wp-typography/components/class-common.php (modified) (7 diffs)
-
includes/wp-typography/components/class-multilingual-support.php (modified) (20 diffs)
-
includes/wp-typography/components/class-plugin-component.php (modified) (2 diffs)
-
includes/wp-typography/components/class-public-interface.php (modified) (11 diffs)
-
includes/wp-typography/components/class-rest-api.php (modified) (3 diffs)
-
includes/wp-typography/components/class-setup.php (modified) (18 diffs)
-
includes/wp-typography/data-storage/class-transients.php (modified) (3 diffs)
-
includes/wp-typography/integration/class-acf-integration.php (modified) (12 diffs)
-
includes/wp-typography/integration/class-container.php (modified) (3 diffs)
-
includes/wp-typography/integration/class-plugin-integration.php (modified) (5 diffs)
-
includes/wp-typography/integration/class-woocommerce-integration.php (modified) (6 diffs)
-
includes/wp-typography/settings/class-abstract-locale-settings.php (modified) (10 diffs)
-
includes/wp-typography/settings/class-basic-locale-settings.php (modified) (4 diffs)
-
includes/wp-typography/settings/class-locale-settings.php (modified) (8 diffs)
-
includes/wp-typography/settings/class-plugin-configuration.php (modified) (5 diffs)
-
includes/wp-typography/settings/class-tools.php (modified) (3 diffs)
-
includes/wp-typography/typography/class-custom-node-fix.php (modified) (3 diffs)
-
includes/wp-typography/typography/class-custom-registry.php (modified) (2 diffs)
-
includes/wp-typography/typography/class-custom-token-fix.php (modified) (5 diffs)
-
includes/wp-typography/ui/class-sections.php (modified) (2 diffs)
-
includes/wp-typography/ui/class-tabs.php (modified) (2 diffs)
-
includes/wp-typography/ui/class-template.php (added)
-
js/clean-clipboard.js (modified) (1 diff)
-
js/clean-clipboard.min.js (modified) (1 diff)
-
js/src/clean-clipboard.js (modified) (4 diffs)
-
readme.txt (modified) (3 diffs)
-
vendor-scoped/composer/ClassLoader.php (modified) (27 diffs)
-
vendor-scoped/composer/autoload_classmap.php (modified) (2 diffs)
-
vendor-scoped/composer/autoload_static.php (modified) (2 diffs)
-
vendor-scoped/level-2/dice/Dice.php (modified) (15 diffs)
-
vendor-scoped/masterminds/html5/README.md (modified) (2 diffs)
-
vendor-scoped/masterminds/html5/src/HTML5.php (modified) (8 diffs)
-
vendor-scoped/masterminds/html5/src/HTML5/Elements.php (modified) (6 diffs)
-
vendor-scoped/masterminds/html5/src/HTML5/Parser/CharacterReference.php (modified) (2 diffs)
-
vendor-scoped/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php (modified) (13 diffs)
-
vendor-scoped/masterminds/html5/src/HTML5/Parser/FileInputStream.php (modified) (1 diff)
-
vendor-scoped/masterminds/html5/src/HTML5/Parser/Scanner.php (modified) (10 diffs)
-
vendor-scoped/masterminds/html5/src/HTML5/Parser/StringInputStream.php (modified) (13 diffs)
-
vendor-scoped/masterminds/html5/src/HTML5/Parser/Tokenizer.php (modified) (19 diffs)
-
vendor-scoped/masterminds/html5/src/HTML5/Parser/TreeBuildingRules.php (modified) (1 diff)
-
vendor-scoped/masterminds/html5/src/HTML5/Parser/UTF8Utils.php (modified) (8 diffs)
-
vendor-scoped/masterminds/html5/src/HTML5/Serializer/OutputRules.php (modified) (8 diffs)
-
vendor-scoped/mundschenk-at/check-wp-requirements/README.md (modified) (3 diffs)
-
vendor-scoped/mundschenk-at/check-wp-requirements/class-wp-requirements.php (deleted)
-
vendor-scoped/mundschenk-at/check-wp-requirements/phpstan.neon (added)
-
vendor-scoped/mundschenk-at/check-wp-requirements/src (added)
-
vendor-scoped/mundschenk-at/check-wp-requirements/src/class-wp-requirements.php (added)
-
vendor-scoped/mundschenk-at/php-typography/src/IANA/tlds-alpha-by-domain.txt (modified) (36 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/class-dom.php (modified) (2 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/class-hyphenator.php (modified) (4 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/class-php-typography.php (modified) (4 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/class-re.php (modified) (4 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/class-settings.php (modified) (67 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/class-strings.php (modified) (3 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/class-text-parser.php (modified) (18 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/class-u.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/class-default-registry.php (modified) (2 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/class-node-fix.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/class-registry.php (modified) (5 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/class-token-fix.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-abstract-node-fix.php (modified) (2 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-classes-dependent-fix.php (modified) (3 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-dash-spacing-fix.php (modified) (3 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-dewidow-fix.php (modified) (5 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-french-punctuation-spacing-fix.php (modified) (2 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-numbered-abbreviation-spacing-fix.php (modified) (4 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-process-words-fix.php (modified) (3 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-simple-regex-replacement-fix.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-simple-style-fix.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-single-character-word-spacing-fix.php (modified) (2 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-smart-area-units-fix.php (modified) (2 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-smart-dashes-fix.php (modified) (6 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-smart-diacritics-fix.php (modified) (2 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-smart-ellipses-fix.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-smart-exponents-fix.php (modified) (2 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-smart-fractions-fix.php (modified) (5 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-smart-marks-fix.php (modified) (2 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-smart-maths-fix.php (modified) (5 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-smart-ordinal-suffix-fix.php (modified) (3 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-smart-quotes-fix.php (modified) (4 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-space-collapse-fix.php (modified) (2 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-style-ampersands-fix.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-style-caps-fix.php (modified) (4 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-style-hanging-punctuation-fix.php (modified) (2 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-style-initial-quotes-fix.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-style-numbers-fix.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/node-fixes/class-unit-spacing-fix.php (modified) (4 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/token-fixes/class-abstract-token-fix.php (modified) (2 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/token-fixes/class-hyphenate-compounds-fix.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/token-fixes/class-hyphenate-fix.php (modified) (2 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/token-fixes/class-smart-dashes-hyphen-fix.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/token-fixes/class-wrap-emails-fix.php (modified) (2 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/token-fixes/class-wrap-hard-hyphens-fix.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/php-typography/src/fixes/token-fixes/class-wrap-urls-fix.php (modified) (6 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/hyphenator/class-cache.php (modified) (2 diffs)
-
vendor-scoped/mundschenk-at/php-typography/src/hyphenator/class-trie-node.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/php-typography/src/settings/class-dash-style.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/php-typography/src/settings/class-dashes.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/php-typography/src/settings/class-quote-style.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/php-typography/src/settings/class-quotes.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/php-typography/src/settings/class-simple-dashes.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/php-typography/src/settings/class-simple-quotes.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/php-typography/src/text-parser/class-token.php (modified) (3 diffs)
-
vendor-scoped/mundschenk-at/wp-data-storage/src/class-abstract-cache.php (modified) (4 diffs)
-
vendor-scoped/mundschenk-at/wp-data-storage/src/class-cache.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/wp-data-storage/src/class-network-options.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/wp-data-storage/src/class-options.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/wp-data-storage/src/class-site-transients.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/wp-data-storage/src/class-transients.php (modified) (1 diff)
-
vendor-scoped/mundschenk-at/wp-settings-ui/src/ui/class-abstract-control.php (modified) (4 diffs)
-
vendor-scoped/scoper-autoload.php (modified) (1 diff)
-
wp-typography.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-typography/trunk/CHANGELOG.md
r2852622 r3208262 1 1 # 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. 2 11 3 12 ## 5.9.1 - January 22, 2023 -
wp-typography/trunk/admin/block-editor/src/blocks/typography/edit.js
r2310237 r3208262 4 4 * This file is part of wp-Typography. 5 5 * 6 * Copyright 2020 Peter Putzer.6 * Copyright 2020-2024 Peter Putzer. 7 7 * 8 8 * This program is free software; you can redistribute it and/or … … 25 25 * @author Peter Putzer <github@mundschenk.at> 26 26 * @since 5.7.0 27 * @requires Gutenberg 4.328 27 */ 29 28 … … 40 39 * 41 40 * @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 * } 45 44 * 46 45 * @return {Object} ECMAScript JSX Markup for the editor -
wp-typography/trunk/admin/block-editor/src/blocks/typography/index.js
r2310237 r3208262 4 4 * This file is part of wp-Typography. 5 5 * 6 * Copyright 2020 Peter Putzer.6 * Copyright 2020-2024 Peter Putzer. 7 7 * 8 8 * This program is free software; you can redistribute it and/or … … 25 25 * @author Peter Putzer <github@mundschenk.at> 26 26 * @since 5.7.0 27 * @requires Gutenberg 4.328 27 */ 29 28 … … 32 31 */ 33 32 import { __ } from '@wordpress/i18n'; 33 34 /** 35 * Type checking dependencies 36 */ 37 import PropTypes from 'prop-types'; 34 38 35 39 /** … … 52 56 }, 53 57 58 propTypes: { 59 className: PropTypes.string.isRequired, 60 }, 61 54 62 edit, 55 63 save, -
wp-typography/trunk/admin/block-editor/src/blocks/typography/save.js
r2310237 r3208262 4 4 * This file is part of wp-Typography. 5 5 * 6 * Copyright 2020 Peter Putzer.6 * Copyright 2020-2024 Peter Putzer. 7 7 * 8 8 * This program is free software; you can redistribute it and/or … … 25 25 * @author Peter Putzer <github@mundschenk.at> 26 26 * @since 5.7.0 27 * @requires Gutenberg 4.328 27 */ 29 28 -
wp-typography/trunk/admin/block-editor/src/plugins/sidebar-post-toggle/index.js
r2330235 r3208262 4 4 * This file is part of wp-Typography. 5 5 * 6 * Copyright 2020 Peter Putzer.6 * Copyright 2020-2024 Peter Putzer. 7 7 * 8 8 * This program is free software; you can redistribute it and/or … … 25 25 * @author Peter Putzer <github@mundschenk.at> 26 26 * @since 5.7.0 27 * @requires Gutenberg 4.328 27 */ 29 28 … … 31 30 * WordPress dependencies 32 31 */ 33 import { PluginDocumentSettingPanel } from '@wordpress/edit -post';32 import { PluginDocumentSettingPanel } from '@wordpress/editor'; 34 33 import { select } from '@wordpress/data'; 34 35 /** 36 * Type checking dependencies 37 */ 38 import PropTypes from 'prop-types'; 35 39 36 40 /** … … 44 48 export const name = 'wp-typography-sidebar'; 45 49 const icon = 'format-quote'; 50 51 /** 52 * Type checking. 53 */ 54 const propTypes = { 55 className: PropTypes.string.isRequired, 56 typographyEnabled: PropTypes.bool.isRequired, 57 setTypographyEnabled: PropTypes.func.isRequired, 58 }; 46 59 47 60 /** … … 71 84 72 85 // Export settings. 73 export const settings = { icon, render };86 export const settings = { icon, render, propTypes }; -
wp-typography/trunk/admin/block-editor/src/plugins/sidebar-post-toggle/toggle-control.js
r2310246 r3208262 2 2 3 3 /** 4 * wp-Typography4 * This file is part of wp-Typography. 5 5 * 6 * A toggle switch for disabling wp-Typography for specific posts.6 * Copyright 2020-2024 Peter Putzer. 7 7 * 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 9 27 */ 10 28 … … 34 52 withSelect( ( select ) => { 35 53 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, 39 57 }; 40 58 } ), -
wp-typography/trunk/admin/partials/settings/settings-page.php
r1941764 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2014-20 18Peter Putzer.5 * Copyright 2014-2023 Peter Putzer. 6 6 * Copyright 2009-2011 KINGdesk, LLC. 7 7 * … … 26 26 */ 27 27 28 use WP_Typography\Data_Storage\Options; 28 namespace 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 */ 29 42 30 43 ?><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> 36 45 <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 ) : ?> 38 47 <?php 39 $query_string = '?page=' . \strtolower( $ this->plugin_name ) . '&tab=' . $tab_id;48 $query_string = '?page=' . \strtolower( $plugin_name ) . '&tab=' . $tab_id; 40 49 $classes = 'nav-tab' . ( $tab_id === $active_tab ? ' nav-tab-active' : '' ); 41 50 ?> … … 45 54 46 55 <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 ); ?> 49 58 50 59 <p class="submit"> 51 60 <?php \submit_button( \__( 'Save Changes', 'wp-typography' ), 'primary', 'save_changes', false, [ 'tabindex' => 1 ] ); ?> 52 61 <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 ] ); ?> 54 63 <?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 ] ); ?> 56 65 </span> 57 66 </p><!-- .submit --> -
wp-typography/trunk/includes/class-wp-typography.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2014-202 2Peter Putzer.5 * Copyright 2014-2024 Peter Putzer. 6 6 * Copyright 2009-2011 KINGdesk, LLC. 7 7 * … … 26 26 */ 27 27 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;35 28 use PHP_Typography\Settings; 36 use PHP_Typography\Hyphenator\Cache as Hyphenator_Cache;37 29 38 30 /** … … 49 41 * @method void clear_cache() Retrieves the plugin's default option values. 50 42 * 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. 53 45 * @method void set_default_options($force_defaults = false) Initializes the options with default values. 54 46 * … … 57 49 * @method string process_feed_title($text, Settings $settings = null) Processes a heading text fragment as part of an RSS feed. 58 50 * @method string process_feed($text, $is_title = false, Settings $settings = null) Processes a content text fragment as part of an RSS feed. 59 * @method arrayprocess_title_parts($title_parts, Settings $settings = null) Processes title parts and strips ­ 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 ­ 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. 63 55 */ 64 56 abstract class WP_Typography { … … 82 74 * @throws BadMethodCallException Thrown when WP_Typography::set_instance after plugin initialization. 83 75 */ 84 public static function set_instance( WP_Typography $instance ) : void {76 public static function set_instance( WP_Typography $instance ): void { 85 77 if ( null === self::$instance ) { 86 78 self::$instance = $instance; … … 100 92 * @return WP_Typography 101 93 */ 102 public static function get_instance() {94 public static function get_instance(): WP_Typography { 103 95 if ( null === self::$instance ) { 104 96 throw new BadMethodCallException( 'WP_Typography::get_instance called without prior plugin intialization.' ); … … 119 111 * @return mixed 120 112 */ 121 public static function __callStatic( $name, array $arguments ) {113 public static function __callStatic( string $name, array $arguments ) { 122 114 if ( \method_exists( self::$instance, $name ) ) { 123 115 return self::$instance->$name( ...$arguments ); 124 116 } 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.' ); 126 118 } 127 119 } … … 134 126 * @return Settings 135 127 */ 136 public static function get_user_settings() {128 public static function get_user_settings(): Settings { 137 129 return clone self::get_instance()->get_settings(); 138 130 } … … 150 142 * @return string The processed $text. 151 143 */ 152 public static function filter( $text, Settings $settings = null ){144 public static function filter( string $text, ?Settings $settings = null ): string { 153 145 return self::get_instance()->process( $text, false, false, $settings ); 154 146 } … … 166 158 * @return string The processed $text. 167 159 */ 168 public static function filter_title( $text, Settings $settings = null ){160 public static function filter_title( string $text, ?Settings $settings = null ): string { 169 161 return self::get_instance()->process_title( $text, $settings ); 170 162 } … … 182 174 * @return string[] 183 175 */ 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 { 185 177 return self::get_instance()->process_title_parts( $title_parts, $settings ); 186 178 } … … 198 190 * @return string The processed $text. 199 191 */ 200 public static function filter_feed( $text, Settings $settings = null ){192 public static function filter_feed( string $text, ?Settings $settings = null ): string { 201 193 return self::get_instance()->process_feed( $text, false, $settings ); 202 194 } … … 214 206 * @return string The processed $text. 215 207 */ 216 public static function filter_feed_title( $text, Settings $settings = null ){208 public static function filter_feed_title( string $text, ?Settings $settings = null ): string { 217 209 return self::get_instance()->process_feed_title( $text, $settings ); 218 210 } … … 235 227 * @return string The hashed version (containing as few bytes as possible); 236 228 */ 237 private static function hash_version_string( $version ) {229 private static function hash_version_string( $version ): string { 238 230 $hash = ''; 239 231 … … 252 244 * @return string 253 245 */ 254 public function get_version_hash() {246 public function get_version_hash(): string { 255 247 return self::hash_version_string( self::get_instance()->get_version() ); 256 248 } -
wp-typography/trunk/includes/wp-typography/class-factory.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2017-202 2Peter Putzer.5 * Copyright 2017-2024 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 33 33 use WP_Typography\Data_Storage\Transients; 34 34 35 use WP_Typography\UI\Template; 36 35 37 use WP_Typography\Integration\Container as Integrations; 36 38 use WP_Typography\Settings\Basic_Locale_Settings; 37 use WP_Typography\Settings\Locale_Settings;38 39 39 40 use WP_Typography\Exceptions\Object_Factory_Exception; … … 62 63 * @var Factory 63 64 */ 64 private static $factory;65 private static Factory $factory; 65 66 66 67 /** … … 84 85 * be created. 85 86 */ 86 public static function get() : self {87 if ( ! self::$factory instanceof static) {87 public static function get(): self { 88 if ( ! isset( self::$factory ) ) { 88 89 89 90 // Create factory. … … 108 109 * @return mixed[] 109 110 */ 110 protected function get_rules() : array {111 protected function get_rules(): array { 111 112 return [ 112 113 // Shared helpers. … … 114 115 Transients::class => self::SHARED, 115 116 Options::class => self::SHARED, 117 Template::class => [ 118 'shared' => true, 119 'constructParams' => [ \WP_TYPOGRAPHY_PLUGIN_PATH ], 120 ], 116 121 117 122 // API implementation. … … 241 246 * @return string 242 247 */ 243 protected function get_plugin_version( $plugin_file ) : string {248 protected function get_plugin_version( $plugin_file ): string { 244 249 // Load version from plugin data. 245 250 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 247 252 } 248 253 … … 266 271 * @phpstan-return array<array<self::INSTANCE,class-string<Components\Plugin_Component>>> 267 272 */ 268 protected function get_components() : array {273 protected function get_components(): array { 269 274 return [ 270 275 [ self::INSTANCE => Components\Setup::class ], … … 293 298 * @phpstan-return array<array<self::INSTANCE,class-string<Integration\Plugin_Integration>>> 294 299 */ 295 protected function get_plugin_integrations() : array {300 protected function get_plugin_integrations(): array { 296 301 return [ 297 302 [ self::INSTANCE => Integration\ACF_Integration::class ], … … 313 318 * } 314 319 * 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 { 318 323 return [ 319 324 [ self::INSTANCE => '$LocaleSwitzerland' ], -
wp-typography/trunk/includes/wp-typography/class-implementation.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2014-202 2Peter Putzer.5 * Copyright 2014-2024 Peter Putzer. 6 6 * Copyright 2009-2011 KINGdesk, LLC. 7 7 * … … 156 156 * 157 157 * @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. 160 163 * 161 164 * @return string[] An array in the form of ( $language_code => $language ). 162 165 */ 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 ); 165 168 } 166 169 … … 169 172 * 170 173 * @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. 173 179 * 174 180 * @return string[] An array in the form of ( $language_code => $language ). 175 181 */ 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 ); 178 184 } 179 185 180 186 /** 181 187 * Load and cache given language list. 188 * 189 * @since 5.10.0 Optional parameter `$translate` added. 182 190 * 183 191 * @param string $cache_key A cache key. 184 192 * @param callable $get_language_list Retrieval function for the language list. 185 193 * @param string $type Either 'diacritic' or 'hyphenate'. 194 * @param bool $translate Optional. Determines whether language names need to be translated. Default true. 186 195 * 187 196 * @return string[] 188 197 */ 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 ); 192 243 193 244 // Dynamically generate the list of hyphenation language patterns. 194 245 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(); 207 250 208 251 // Cache translated hyphenation languages. 209 $this->cache->set( $cache_key , $languages, $duration );252 $this->cache->set( $cache_key_raw, $languages, $duration ); 210 253 } 211 254 … … 216 259 * Translate language list. 217 260 * 261 * @since 5.10.0 Changed into a protected method for easier unit testing. 262 * 218 263 * @param string[] $languages An array in the form [ LANGUAGE_CODE => LANGUAGE ]. 219 264 * 220 265 * @return string[] The same array with the language name translated. 221 266 */ 222 pr ivate static function translate_languages( array $languages ): array {267 protected function translate_languages( array $languages ): array { 223 268 \array_walk( 224 269 $languages, 225 function ( &$lang, $code) {270 function ( &$lang ) { 226 271 // The language names are made visible to GlotPress via the 227 272 // autogenerated source file `_language_names.php` (which is not … … 242 287 * @return array<string,string|int|bool> 243 288 */ 244 public function get_config() : array {289 public function get_config(): array { 245 290 if ( ! isset( $this->configuration ) ) { 246 291 $config = $this->options->get( Options::CONFIGURATION ); … … 281 326 * @return Settings 282 327 */ 283 public function get_settings() : Settings {328 public function get_settings(): Settings { 284 329 285 330 // Initialize Settings instance. … … 322 367 * @return string The processed `$text`. 323 368 */ 324 public function process_title( $text, Settings $settings = null ): string {369 public function process_title( $text, ?Settings $settings = null ): string { 325 370 return $this->process( $text, true, false, $settings ); 326 371 } … … 338 383 * @return string The processed `$text`. 339 384 */ 340 public function process_feed_title( $text, Settings $settings = null ): string {385 public function process_feed_title( $text, ?Settings $settings = null ): string { 341 386 return $this->process_feed( $text, true, $settings ); 342 387 } … … 357 402 * @return string The processed `$text`. 358 403 */ 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 { 360 405 return $this->process( $text, $is_title, true, $settings ); 361 406 } … … 373 418 * @return string[] 374 419 */ 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 { 376 421 foreach ( $title_parts as $index => $part ) { 377 422 // Remove "­" and "​" after processing title part. 378 423 $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 ) ) 380 425 ); 381 426 } … … 398 443 * @return string The processed `$text`. 399 444 */ 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 { 401 446 // Check if processing is disabled for this post. 402 447 $post_id = \get_the_ID(); … … 418 463 // Return original HTML fragment if processing has been disabled. 419 464 if ( $disable ) { 420 return $text;465 return (string) $text; 421 466 } 422 467 … … 451 496 * @return string The processed `$text`. 452 497 */ 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 { 454 499 // Construct cache key. 455 500 $key = 'frag_' . \md5( $text ) . '_' . $settings->get_hash( 32, false ) . '_' . ( $is_feed ? 'f' : '' ) . ( $is_title ? 't' : 's' ); … … 487 532 * @return string[] 488 533 */ 489 public function filter_body_class( array $classes ) : array {534 public function filter_body_class( array $classes ): array { 490 535 $this->body_classes = $classes; 491 536 … … 500 545 * @return PHP_Typography 501 546 */ 502 protected function get_typography_instance() : PHP_Typography {547 protected function get_typography_instance(): PHP_Typography { 503 548 504 549 // Retrieve options. … … 544 589 * Save hyphenator cache for the next request. 545 590 */ 546 public function save_hyphenator_cache_on_shutdown() : void {591 public function save_hyphenator_cache_on_shutdown(): void { 547 592 if ( isset( $this->hyphenator_cache ) && $this->hyphenator_cache->has_changed() ) { 548 593 $this->transients->cache_object( 'php_hyphenator_cache', $this->hyphenator_cache, 'hyphenator_cache' ); … … 556 601 * @param mixed[] $config The array of configuration entries. 557 602 */ 558 protected function init_settings_from_options( Settings $s, array $config ) : void {603 protected function init_settings_from_options( Settings $s, array $config ): void { 559 604 // Necessary for full Settings initialization. 560 605 $s->set_smart_dashes_style( $config[ Config::SMART_DASHES_STYLE ] ); … … 691 736 * key and sorted by descending key length. 692 737 */ 693 protected function prepare_smart_quotes_exceptions( $custom_exceptions ) : array {738 protected function prepare_smart_quotes_exceptions( $custom_exceptions ): array { 694 739 global $wp_cockneyreplace; 695 740 … … 729 774 ); 730 775 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. 732 777 } 733 778 … … 741 786 \uksort( 742 787 $exceptions, 743 function ( $a, $b ) {744 return ( \strlen( $b ) - \strlen( $a ) ) ?: \strcmp( $a, $b ); // phpcs:ignore WordPress.PHP.DisallowShortTernary788 function ( $a, $b ) { 789 return ( \strlen( $b ) - \strlen( $a ) ) ?: \strcmp( $a, $b ); // phpcs:ignore Universal.Operators.DisallowShortTernary 745 790 } 746 791 ); … … 754 799 * @param bool $force_defaults Optional. Default false. 755 800 */ 756 public function set_default_options( $force_defaults = false ) : void {801 public function set_default_options( $force_defaults = false ): void { 757 802 $update = $force_defaults; 758 803 … … 783 828 * @return array<string,string|int|bool> 784 829 */ 785 public function get_default_options() : array {830 public function get_default_options(): array { 786 831 if ( empty( $this->default_settings ) ) { 787 832 /** … … 801 846 * Clears all transients set by the plugin. 802 847 */ 803 public function clear_cache() : void {848 public function clear_cache(): void { 804 849 $this->transients->invalidate(); 805 850 $this->cache->invalidate(); … … 815 860 * @return string[] The filtered array. 816 861 */ 817 public function parser_errors_handler( $errors ) : array {862 public function parser_errors_handler( $errors ): array { 818 863 /** 819 864 * Filters the HTML parser errors (if there are any). -
wp-typography/trunk/includes/wp-typography/class-plugin-controller.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2018-202 2Peter Putzer.5 * Copyright 2018-2023 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 27 27 namespace WP_Typography; 28 28 29 use WP_Typography\Implementation;30 29 use WP_Typography\Components\Plugin_Component; 31 30 … … 41 40 * The plugin API implementation. 42 41 * 43 * @var \WP_Typography \Implementation42 * @var \WP_Typography 44 43 */ 45 private $api;44 private \WP_Typography $api; 46 45 47 46 /** … … 50 49 * @var Plugin_Component[] 51 50 */ 52 private $plugin_components = [];51 private array $plugin_components = []; 53 52 54 53 /** … … 68 67 * Starts the plugin for real. 69 68 */ 70 public function run() : void {69 public function run(): void { 71 70 // Set plugin singleton. 72 71 \WP_Typography::set_instance( $this->api ); -
wp-typography/trunk/includes/wp-typography/class-requirements.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2020-202 2Peter Putzer.5 * Copyright 2020-2024 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 40 40 41 41 const REQUIREMENTS = [ 42 'php' => '7. 2.0',42 'php' => '7.4.0', 43 43 'multibyte' => true, 44 44 'utf-8' => true, … … 70 70 * }> 71 71 */ 72 protected function get_requirements() : array {72 protected function get_requirements(): array { 73 73 $requirements = parent::get_requirements(); 74 74 $requirements[] = [ … … 86 86 * @return bool 87 87 */ 88 protected function check_dom_support() : bool {88 protected function check_dom_support(): bool { 89 89 return \class_exists( 'DOMDocument' ); 90 90 } … … 93 93 * Prints 'DOM extension missing' admin notice 94 94 */ 95 public function admin_notices_dom_disabled() : void {95 public function admin_notices_dom_disabled(): void { 96 96 $this->display_error_notice( 97 97 /* translators: 1: plugin name 2: GD documentation URL */ -
wp-typography/trunk/includes/wp-typography/components/class-admin-interface.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2014-202 2Peter Putzer.5 * Copyright 2014-2024 Peter Putzer. 6 6 * Copyright 2012-2013 Marie Hogebrandt. 7 7 * Copyright 2009-2011 KINGdesk, LLC. … … 72 72 * @var Options 73 73 */ 74 private $options; 74 private Options $options; 75 76 /** 77 * The template helper. 78 * 79 * @var UI\Template 80 */ 81 private UI\Template $template; 75 82 76 83 /** 77 84 * The user-visible name of the plugin. 78 85 * 79 * @todo Maybe we should translate the name?80 86 * @var string $plugin_name 81 87 */ 82 private $plugin_name = 'wp-Typography';88 private string $plugin_name = 'wp-Typography'; 83 89 84 90 /** … … 87 93 * @var string 88 94 */ 89 private $plugin_basename;95 private string $plugin_basename; 90 96 91 97 /** … … 94 100 * @var array<string,string> $admin_resource_links An array in the form of 'anchor text' => 'URL'. 95 101 */ 96 private $admin_resource_links;102 private array $admin_resource_links; 97 103 98 104 /** … … 142 148 * @var string 143 149 */ 144 private $active_tab;150 private string $active_tab; 145 151 146 152 /** … … 161 167 * Create a new instace of admin backend. 162 168 * 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; 173 181 } 174 182 … … 178 186 * @since 5.7.0 Parameter $plugin removed. 179 187 */ 180 public function run() : void {188 public function run(): void { 181 189 if ( \is_admin() ) { 182 183 190 // Cache the plugin basename. 184 191 $this->plugin_basename = \plugin_basename( \WP_TYPOGRAPHY_PLUGIN_FILE ); 185 192 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 196 193 // Add action hooks. 194 \add_action( 'init', [ $this, 'initialize_translated_properties' ] ); 197 195 \add_action( 'admin_menu', [ $this, 'add_options_page' ] ); 198 196 \add_action( 'admin_init', [ $this, 'register_the_settings' ] ); … … 205 203 206 204 /** 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 /** 207 223 * Initialize displayable strings for the plugin settings page. 208 224 * 209 225 * @return array<string,string> The array keys consist of the translated anchor text, their values of the linked URL. 210 226 */ 211 private function initialize_resource_links() : array {227 private function initialize_resource_links(): array { 212 228 return [ 213 229 \__( 'Plugin Home', 'wp-typography' ) => 'https://code.mundschenk.at/wp-typography/', … … 230 246 * @phpstan-return Help_Page[] 231 247 */ 232 private function initialize_help_pages() : array {248 private function initialize_help_pages(): array { 233 249 return [ 234 250 'help-intro' => [ … … 247 263 * Register admin settings. 248 264 */ 249 public function register_the_settings() : void {265 public function register_the_settings(): void { 250 266 $configuration_name = $this->options->get_name( Options::CONFIGURATION ); 251 267 $restore_defaults_name = $this->options->get_name( Options::RESTORE_DEFAULTS ); … … 299 315 * @return string 300 316 */ 301 protected function get_active_settings_tab() : string {317 protected function get_active_settings_tab(): string { 302 318 if ( empty( $this->active_tab ) ) { 303 319 // Check active tab. … … 321 337 * @return bool 322 338 */ 323 public function sanitize_restore_defaults( $input ) {339 public function sanitize_restore_defaults( $input ): bool { 324 340 return $this->trigger_admin_notice( Options::RESTORE_DEFAULTS, 'defaults-restored', \__( 'Settings reset to default values.', 'wp-typography' ), 'updated', $input ); 325 341 } … … 332 348 * @return bool 333 349 */ 334 public function sanitize_clear_cache( $input ) : bool {350 public function sanitize_clear_cache( $input ): bool { 335 351 return $this->trigger_admin_notice( Options::CLEAR_CACHE, 'cache-cleared', \__( 'Cached post content cleared.', 'wp-typography' ), 'notice-info', $input ); 336 352 } … … 343 359 * @return array<string,string|int|bool> The sanitized plugin settings. 344 360 */ 345 public function sanitize_settings( $input ) : array {361 public function sanitize_settings( $input ): array { 346 362 $current_tab = $this->get_active_settings_tab(); 347 363 … … 366 382 * @return bool The $input parameter cast to a boolean value. 367 383 */ 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 { 369 385 if ( 370 386 // phpcs:ignore WordPress.Security.NonceVerification.Missing -- we are only checking that the button was clicked. … … 384 400 * Add an options page for the plugin settings. 385 401 */ 386 public function add_options_page() : void {402 public function add_options_page(): void { 387 403 $page = \add_options_page( $this->plugin_name, $this->plugin_name, 'manage_options', \strtolower( $this->plugin_name ), [ $this, 'get_admin_page_content' ] ); 388 404 … … 412 428 * Add context-sensitive help to the settings page. 413 429 */ 414 public function add_context_help() : void {430 public function add_context_help(): void { 415 431 $screen = \get_current_screen(); 416 432 if ( empty( $screen ) ) { … … 446 462 * @phpstan-param array{id : string, title? : string, callback? : callable} $section 447 463 */ 448 public function print_settings_section( array $section ) : void {464 public function print_settings_section( array $section ): void { 449 465 $section_id = ! empty( $section['id'] ) ? $section['id'] : ''; 466 $args = []; 450 467 451 468 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']; 453 470 } 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']; 455 472 } 456 473 457 474 // 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 ); 459 476 } 460 477 … … 462 479 * Enqueue stylesheet for options page. 463 480 */ 464 public function print_admin_styles() : void {481 public function print_admin_styles(): void { 465 482 \wp_enqueue_style( 'wp-typography-settings', \plugins_url( 'admin/css/settings.css', $this->plugin_basename ), [], $this->api->get_version(), 'all' ); 466 483 } … … 473 490 * @return string[] An array of HTML link tags. 474 491 */ 475 public function plugin_action_links( array $links ) : array {492 public function plugin_action_links( array $links ): array { 476 493 $adminurl = \trailingslashit( \admin_url() ); 477 494 … … 486 503 * Display the plugin options page. 487 504 */ 488 public function get_admin_page_content() : void {505 public function get_admin_page_content(): void { 489 506 $this->load_language_options( $this->admin_form_controls[ Plugin_Configuration::HYPHENATE_LANGUAGES ], $this->api->get_hyphenation_languages() ); 490 507 $this->load_language_options( $this->admin_form_controls[ Plugin_Configuration::DIACRITIC_LANGUAGES ], $this->api->get_diacritic_languages() ); 491 508 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 492 519 // 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 ); 494 521 } 495 522 … … 498 525 * 499 526 * @since 5.9.0 527 * @since 5.10.0 Visibility changed to `protected`. 500 528 * 501 529 * @param Control $control The UI control (needs to be a Select element). … … 504 532 * @return bool Returns `true` on success. 505 533 */ 506 pr ivate function load_language_options( Control $control, array $languages ): bool {534 protected function load_language_options( Control $control, array $languages ): bool { 507 535 if ( $control instanceof Select ) { 508 536 $control->set_option_values( $languages ); … … 519 547 * @since 5.4.0 520 548 */ 521 public function maybe_add_privacy_notice_content() : void {549 public function maybe_add_privacy_notice_content(): void { 522 550 // Don't crash on older versions of WordPress. 523 551 if ( ! \function_exists( 'wp_add_privacy_policy_content' ) ) { -
wp-typography/trunk/includes/wp-typography/components/class-block-editor.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2020-202 2Peter Putzer.5 * Copyright 2020-2024 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 58 58 * Set up the various hooks for the block editor. 59 59 */ 60 public function run() : void {60 public function run(): void { 61 61 if ( ! \function_exists( 'register_block_type' ) ) { 62 62 // Block editor not installed. … … 66 66 // Register and enqueue sidebar. 67 67 \add_action( 'init', [ $this, 'register_sidebar_and_blocks' ] ); 68 \add_action( 'enqueue_block_editor_assets', [ $this, 'enqueue_blocks' ] ); 68 69 \add_action( 'enqueue_block_editor_assets', [ $this, 'enqueue_sidebar' ] ); 69 70 } 70 71 71 72 /** 72 * Registers the Gutenberg sidebar .73 * Registers the Gutenberg sidebar and blocks. 73 74 */ 74 public function register_sidebar_and_blocks() : void {75 public function register_sidebar_and_blocks(): void { 75 76 $suffix = ( \defined( 'SCRIPT_DEBUG' ) && \SCRIPT_DEBUG ) ? '' : '.min'; 76 77 $plugin_url = \plugins_url( '', \WP_TYPOGRAPHY_PLUGIN_FILE ); 77 78 78 79 // 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 ); 82 86 \wp_register_style( 'wp-typography-gutenberg-style', "{$plugin_url}/admin/css/blocks{$suffix}.css", [], $this->api->get_version() ); 83 87 … … 87 91 'wp-typography/typography', 88 92 [ 89 'editor_script' => 'wp-typography-gutenberg ',93 'editor_script' => 'wp-typography-gutenberg-blocks', 90 94 'editor_style' => 'wp-typography-gutenberg-style', 91 95 'render_callback' => [ $this, 'render_typography_block' ], … … 95 99 96 100 // 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' ); 98 103 } 99 104 … … 101 106 * Enqueues the block editor sidebar script. 102 107 */ 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' ); 105 126 } 106 127 … … 113 134 * @return string 114 135 */ 115 public function render_typography_block( array $attributes, $content ) : string {136 public function render_typography_block( array $attributes, $content ): string { 116 137 // Ensure that the inner blocks are processed. 117 138 \add_filter( 'typo_disable_processing_for_post', '__return_false', 999, 0 ); -
wp-typography/trunk/includes/wp-typography/components/class-common.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2017-202 2Peter Putzer.5 * Copyright 2017-2024 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 30 30 use WP_Typography\Implementation; 31 31 use WP_Typography\Integration\Container as Integrations; 32 use WP_Typography\Settings\Plugin_Configuration as Config;33 32 34 33 /** … … 46 45 * 47 46 * @since 5.7.0 Renamed to $api. 47 * @since 5.10.0 Type changed to \WP_Typography like other Plugin_Components. 48 48 * 49 * @var Implementation49 * @var \WP_Typography 50 50 */ 51 private $api;51 private \WP_Typography $api; 52 52 53 53 /** … … 56 56 * @var Options 57 57 */ 58 private $options;58 private Options $options; 59 59 60 60 /** … … 63 63 * @var Integrations 64 64 */ 65 private $integrations;65 private Integrations $integrations; 66 66 67 67 /** … … 85 85 * @since 5.7.0 Parameter $plugin removed. 86 86 */ 87 public function run() : void {87 public function run(): void { 88 88 // Load settings. 89 89 \add_action( 'init', [ $this, 'init' ] ); … … 97 97 * Restore default options or clear cache if requested. 98 98 */ 99 public function init() : void {99 public function init(): void { 100 100 101 101 // Restore defaults if necessary. -
wp-typography/trunk/includes/wp-typography/components/class-multilingual-support.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2017-202 2Peter Putzer.5 * Copyright 2017-2024 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 28 28 29 29 use WP_Typography\Implementation; 30 use WP_Typography\Settings\Basic_Locale_Settings;31 30 use WP_Typography\Settings\Locale_Settings; 32 31 use WP_Typography\Settings\Plugin_Configuration as Config; … … 73 72 * @var Locale_Settings[] 74 73 */ 75 protected $locales = [];74 protected array $locales = []; 76 75 77 76 /** … … 80 79 * @var string[] 81 80 */ 82 protected $hyphenation_languages;81 protected array $hyphenation_languages; 83 82 84 83 /** … … 87 86 * @var string[] 88 87 */ 89 protected $diacritic_languages;88 protected array $diacritic_languages; 90 89 91 90 /** … … 96 95 * @var \WP_Typography 97 96 */ 98 protected $api;97 protected \WP_Typography $api; 99 98 100 99 /** … … 120 119 * @since 5.7.0 Parameter $plugin removed. 121 120 */ 122 public function run() : void {121 public function run(): void { 123 122 // Enable multilingual support. 124 123 \add_action( 'plugins_loaded', [ $this, 'add_plugin_defaults_filter' ] ); … … 129 128 * Adds a filter for the plugin defaults. 130 129 */ 131 public function add_plugin_defaults_filter() : void {130 public function add_plugin_defaults_filter(): void { 132 131 // 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 ); 135 134 136 135 // Filter the defaults. … … 141 140 * Enable multilingual settings. 142 141 */ 143 public function enable_automatic_language_settings() : void {142 public function enable_automatic_language_settings(): void { 144 143 if ( $this->api->get_config()[ Config::ENABLE_MULTILINGUAL_SUPPORT ] ) { 145 144 \add_filter( 'typo_settings', [ $this, 'automatic_language_settings' ] ); … … 157 156 * first operand is greater, 1 if the second one is greater. 158 157 */ 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 { 160 159 $prio1 = $s1->priority(); 161 160 $prio2 = $s2->priority(); … … 178 177 * @return Settings 179 178 */ 180 public function automatic_language_settings( Settings $settings ) : Settings {179 public function automatic_language_settings( Settings $settings ): Settings { 181 180 182 181 // Ensure that default settings stay unmodified. … … 221 220 * @return array<string,string|int|bool> 222 221 */ 223 public function filter_defaults( array $defaults ) : array {222 public function filter_defaults( array $defaults ): array { 224 223 [ 'language' => $language, 'country' => $country, 'modifier' => $modifier ] = $this->get_current_locale(); 225 224 … … 255 254 * @param Locale_Settings|null $adjustment Locale-specific settings. 256 255 */ 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 { 258 257 259 258 if ( null === $adjustment ) { … … 279 278 * @param Locale_Settings|null $adjustment Locale-specific settings. 280 279 */ 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 { 282 281 283 282 if ( null === $adjustment ) { … … 307 306 * @param Locale_Settings|null $adjustment Locale-specific settings. 308 307 */ 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 { 310 309 311 310 if ( null === $adjustment ) { … … 353 352 * @return Locale_Settings|null 354 353 */ 355 protected function match_locale( $language, $country, $modifier = '' ) : ?Locale_Settings {354 protected function match_locale( $language, $country, $modifier = '' ): ?Locale_Settings { 356 355 357 356 foreach ( $this->locales as $locale_settings ) { … … 380 379 * @phpstan-return Locale 381 380 */ 382 protected function get_current_locale() : array {381 protected function get_current_locale(): array { 383 382 /** 384 383 * Filters the current locale for wp-Typography. … … 429 428 * @param string $type Either "hyphenation" or "diacritic". 430 429 * 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 { 434 433 /** 435 434 * Filters the matched language. … … 462 461 } 463 462 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. 466 481 $match_count = \count( $matches ); 467 482 468 483 if ( 1 === $match_count ) { 469 $result =\array_pop( $matches );484 return \array_pop( $matches ); 470 485 } elseif ( $match_count > 1 ) { 471 486 // 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. 473 488 $match_count = \count( $matches ); 474 489 475 490 if ( 1 === $match_count ) { 476 $result =\array_pop( $matches );491 return \array_pop( $matches ); 477 492 } 478 493 } 479 494 480 return $result;495 return ''; 481 496 } 482 497 … … 489 504 * @return string 490 505 */ 491 protected static function normalize( $key, array $aliases ) : string {506 protected static function normalize( $key, array $aliases ): string { 492 507 return isset( $aliases[ $key ] ) ? $aliases[ $key ] : $key; 493 508 } -
wp-typography/trunk/includes/wp-typography/components/class-plugin-component.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2017-202 2Peter Putzer.5 * Copyright 2017-2023 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 44 44 * @return void 45 45 */ 46 public function run() : void;46 public function run(): void; 47 47 } -
wp-typography/trunk/includes/wp-typography/components/class-public-interface.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2014-202 2Peter Putzer.5 * Copyright 2014-2024 Peter Putzer. 6 6 * Copyright 2009-2011 KINGdesk, LLC. 7 7 * … … 28 28 namespace WP_Typography\Components; 29 29 30 use WP_Typography\Data_Storage\Options;31 30 use WP_Typography\Implementation; 32 use WP_Typography\UI;33 31 use 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;38 32 39 33 /** … … 63 57 * @var int 64 58 */ 65 private $filter_priority = 9999;59 private int $filter_priority = 9999; 66 60 67 61 /** … … 112 106 * @since 5.7.0 Parameter $plugin removed. 113 107 */ 114 public function run() : void {108 public function run(): void { 115 109 // Do not run our filters on the admin side or during a WP-CLI command. 116 110 if ( ! \is_admin() && ! \defined( 'WP_CLI' ) ) { … … 122 116 * Sets up filters and actions. 123 117 */ 124 public function init() : void {118 public function init(): void { 125 119 $this->config = $this->api->get_config(); 126 120 … … 157 151 * Adds content filter handlers. 158 152 */ 159 public function add_content_filters() : void {153 public function add_content_filters(): void { 160 154 161 155 // Define the default filters. … … 211 205 * @param int $priority Filter priority. 212 206 */ 213 private function enable_content_filters( $priority ) : void {207 private function enable_content_filters( $priority ): void { 214 208 \add_filter( 'comment_author', [ $this->api, 'process' ], $priority ); 215 209 \add_filter( 'comment_text', [ $this->api, 'process' ], $priority ); … … 238 232 * @param int $priority Filter priority. 239 233 */ 240 private function enable_heading_filters( $priority ) : void {234 private function enable_heading_filters( $priority ): void { 241 235 \add_filter( 'the_title', [ $this->api, 'process_title' ], $priority ); 242 236 \add_filter( 'widget_title', [ $this->api, 'process_title' ], $priority ); … … 248 242 * @since 5.5.3 249 243 */ 250 public function enqueue_styles() : void {244 public function enqueue_styles(): void { 251 245 // 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 } 260 256 } 261 257 … … 274 270 * Enqueues frontend JavaScript files. 275 271 */ 276 public function enqueue_scripts() : void {272 public function enqueue_scripts(): void { 277 273 if ( $this->config[ Config::HYPHENATE_CLEAN_CLIPBOARD ] ) { 278 274 // Set up file suffix and plugin version. … … 295 291 * @return string Filtered string of CSS styles. 296 292 */ 297 protected function clean_styles( $css ) : string {293 protected function clean_styles( $css ): string { 298 294 $cleaned = (string) \preg_replace( self::CLEAN_CSS_PATTERNS, self::CLEAN_CSS_REPLACEMENTS, $css ); 299 295 $css = ''; -
wp-typography/trunk/includes/wp-typography/components/class-rest-api.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2020-202 2Peter Putzer.5 * Copyright 2020-2023 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 47 47 * Set up the various hooks for the REST API. 48 48 */ 49 public function run() : void {49 public function run(): void { 50 50 // Register and enqueue sidebar. 51 51 \add_action( 'init', [ $this, 'register_meta_fields' ] ); … … 55 55 * Registers necessary meta fields the the REST API. 56 56 */ 57 public function register_meta_fields() : void {57 public function register_meta_fields(): void { 58 58 \register_post_meta( 59 59 '', // Enable field for all post types. -
wp-typography/trunk/includes/wp-typography/components/class-setup.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2014-202 2Peter Putzer.5 * Copyright 2014-2024 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 29 29 use WP_Typography\Implementation; 30 30 use WP_Typography\Data_Storage\Options; 31 use WP_Typography\Settings\Plugin_Configuration as Config;32 31 33 32 /** … … 66 65 * @var \WP_Typography 67 66 */ 68 private $api;67 private \WP_Typography $api; 69 68 70 69 /** … … 75 74 * @var Options 76 75 */ 77 private $options;76 private Options $options; 78 77 79 78 /** … … 96 95 * @since 5.7.0 Parameter $plugin removed. 97 96 */ 98 public function run() : void {97 public function run(): void { 99 98 // Register various hooks. 100 99 \register_activation_hook( \WP_TYPOGRAPHY_PLUGIN_FILE, [ $this, 'activate' ] ); … … 111 110 * @since 3.1.0 112 111 */ 113 public function activate() : void {112 public function activate(): void { 114 113 // Load default values for any new options. 115 114 $this->api->get_config(); … … 124 123 * @since 5.1.0 125 124 */ 126 public function plugin_update_check() : void {125 public function plugin_update_check(): void { 127 126 // We can ignore errors here, just carry on as if for a new installation. 128 127 $installed_version = (string) $this->options->get( Options::INSTALLED_VERSION, '' ); … … 138 137 * @param string $previous_version The version we are upgrading from. 139 138 */ 140 protected function plugin_updated( $previous_version ) : void {139 protected function plugin_updated( $previous_version ): void { 141 140 // Upgrade from version 3.0.0 or lower. 142 141 if ( \version_compare( $previous_version, '3.1.0-beta.2', '<' ) ) { … … 170 169 * @since 5.1.0 171 170 */ 172 protected function upgrade_options_3_1() : void {171 protected function upgrade_options_3_1(): void { 173 172 foreach ( $this->api->get_default_options() as $option_name => $option ) { 174 173 $old_option = $this->get_old_option_name( self::LEGACY_OPTIONS_PREFIX . "_{$option_name}" ); … … 188 187 * @since 5.1.0 189 188 */ 190 protected function upgrade_options_3_2() : void {189 protected function upgrade_options_3_2(): void { 191 190 $this->options->delete( 'typo_disable_caching', true ); 192 191 } … … 197 196 * @since 5.1.0 198 197 */ 199 protected function upgrade_options_3_3() : void {198 protected function upgrade_options_3_3(): void { 200 199 $this->options->delete( 'typo_remove_ie6', true ); 201 200 } … … 206 205 * @since 5.1.0 207 206 */ 208 protected function upgrade_options_3_5() : void {207 protected function upgrade_options_3_5(): void { 209 208 $this->options->delete( 'typo_enable_caching', true ); 210 209 $this->options->delete( 'typo_caching_limit', true ); … … 216 215 * @since 5.1.0 217 216 */ 218 protected function upgrade_options_5_1() : void {217 protected function upgrade_options_5_1(): void { 219 218 $this->options->delete( 'typo_transient_keys', true ); 220 219 $this->options->delete( 'typo_cache_keys', true ); … … 228 227 * @since 5.1.0 229 228 */ 230 protected function upgrade_options_to_array() : void {229 protected function upgrade_options_to_array(): void { 231 230 $config = $this->api->get_default_options(); 232 231 … … 249 248 * @since 5.1.0 250 249 */ 251 protected function set_installed_version() : void {250 protected function set_installed_version(): void { 252 251 $this->options->set( Options::INSTALLED_VERSION, $this->api->get_version() ); 253 252 } … … 261 260 * @return string An old-style option name, e.g. 'MyOldOption'. 262 261 */ 263 protected function get_old_option_name( $option ) : string {262 protected function get_old_option_name( $option ): string { 264 263 $parts = \explode( '_', $option ); 265 264 $oldname = \array_shift( $parts ); … … 289 288 * @since 3.1.0 290 289 */ 291 public function deactivate() : void {290 public function deactivate(): void { 292 291 } 293 292 … … 297 296 * @since 3.1.0 298 297 */ 299 public static function uninstall() : void {298 public static function uninstall(): void { 300 299 301 300 // Delete all our transients. -
wp-typography/trunk/includes/wp-typography/data-storage/class-transients.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2017-202 2Peter Putzer.5 * Copyright 2017-2024 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 49 49 * Cache the given object under the transient name. 50 50 * 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. 54 57 */ 55 public function cache_object( $transient, $ object, $handle = '' ): void {58 public function cache_object( $transient, $large_object, $handle = '' ): void { 56 59 /** 57 60 * Filters whether the PHP_Typography engine state should be cached. … … 75 78 $duration = \apply_filters( 'typo_php_typography_caching_duration', 0, $handle ); 76 79 77 $this->set_large_object( $transient, $ object, $duration );80 $this->set_large_object( $transient, $large_object, $duration ); 78 81 } 79 82 } -
wp-typography/trunk/includes/wp-typography/integration/class-acf-integration.php
r2852622 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2017-202 3Peter Putzer.5 * Copyright 2017-2024 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 84 84 * @var \WP_Typography 85 85 */ 86 private $api;86 private \WP_Typography $api; 87 87 88 88 /** … … 91 91 * @var int 92 92 */ 93 private $api_version;93 private int $api_version; 94 94 95 95 /** … … 109 109 * @return bool 110 110 */ 111 public function check() : bool {111 public function check(): bool { 112 112 return \class_exists( 'acf' ); 113 113 } … … 118 118 * @since 5.7.0 Parameter $plugin removed. 119 119 */ 120 public function run() : void {120 public function run(): void { 121 121 $this->api_version = $this->get_acf_version(); 122 122 … … 131 131 * @return string 132 132 */ 133 public function get_filter_tag() : string {133 public function get_filter_tag(): string { 134 134 return 'acf'; 135 135 } … … 138 138 * Initializes the "Typography" field setting for all available field types. 139 139 */ 140 public function initialize_field_settings() : void {140 public function initialize_field_settings(): void { 141 141 /** 142 142 * Retrieve the used field types. … … 156 156 * @param int $priority The filter priority. 157 157 */ 158 public function enable_content_filters( $priority ): void {158 public function enable_content_filters( int $priority ): void { 159 159 if ( $this->api_version >= 5 ) { 160 160 // Advanced Custom Fields (version 5 and above). … … 173 173 * @param mixed[] $field The field settings. 174 174 */ 175 public function add_field_setting( array $field ) : void {175 public function add_field_setting( array $field ): void { 176 176 $default = self::DO_NOT_FILTER; 177 177 … … 220 220 * @return int 221 221 */ 222 protected function get_acf_version() : int {222 protected function get_acf_version(): int { 223 223 // We assume version 4 by default. 224 224 $acf_version = 4; … … 249 249 $supported_subfields = self::SUPPORTED_ARRAY_TYPES[ $field['type'] ] ?? []; 250 250 251 if ( ! \is_array( $supported_subfields ) && '*' === $supported_subfields ) { 251 if ( ! \is_array( $supported_subfields ) && '*' === $supported_subfields ) { // @phpstan-ignore identical.alwaysTrue 252 252 $supported_subfields = \array_keys( $content ); 253 253 } … … 277 277 * @return string 278 278 */ 279 protected function process_acf_content( string $content, array $field ) : string {279 protected function process_acf_content( string $content, array $field ): string { 280 280 281 281 switch ( isset( $field[ self::FILTER_SETTING ] ) ? $field[ self::FILTER_SETTING ] : '' ) { -
wp-typography/trunk/includes/wp-typography/integration/class-container.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2018-202 2Peter Putzer.5 * Copyright 2018-2023 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 64 64 * Activate all applicable plugin integrations. 65 65 */ 66 public function activate() : void {66 public function activate(): void { 67 67 foreach ( $this->integrations as $integration ) { 68 68 if ( $integration->check() ) { … … 83 83 * @return array<string,callable> 84 84 */ 85 public function get_content_filters( array $filters ) : array {85 public function get_content_filters( array $filters ): array { 86 86 foreach ( $this->active_integrations as $integration ) { 87 87 $filters[ $integration->get_filter_tag() ] = [ $integration, 'enable_content_filters' ]; -
wp-typography/trunk/includes/wp-typography/integration/class-plugin-integration.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2018-202 2Peter Putzer.5 * Copyright 2018-2024 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 42 42 * @return bool 43 43 */ 44 public function check() : bool;44 public function check(): bool; 45 45 46 46 /** … … 49 49 * @since 5.7.0 Parameter $plugin removed. 50 50 */ 51 public function run() : void;51 public function run(): void; 52 52 53 53 /** … … 56 56 * @return string 57 57 */ 58 public function get_filter_tag() : string;58 public function get_filter_tag(): string; 59 59 60 60 /** … … 63 63 * @param int $priority The filter priority. 64 64 */ 65 public function enable_content_filters( $priority ): void;65 public function enable_content_filters( int $priority ): void; 66 66 } -
wp-typography/trunk/includes/wp-typography/integration/class-woocommerce-integration.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2017-202 2Peter Putzer.5 * Copyright 2017-2024 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 46 46 * @var \WP_Typography 47 47 */ 48 private $api;48 private \WP_Typography $api; 49 49 50 50 /** … … 64 64 * @return bool 65 65 */ 66 public function check() : bool {66 public function check(): bool { 67 67 return \class_exists( 'WooCommerce' ); 68 68 } … … 73 73 * @since 5.7.0 Parameter $plugin removed. 74 74 */ 75 public function run() : void {75 public function run(): void { 76 76 // Nothing to do. 77 77 } … … 82 82 * @return string 83 83 */ 84 public function get_filter_tag() : string {84 public function get_filter_tag(): string { 85 85 return 'woocommerce'; 86 86 } … … 91 91 * @param int $priority The filter priority. 92 92 */ 93 public function enable_content_filters( $priority ): void {93 public function enable_content_filters( int $priority ): void { 94 94 95 95 // Page descriptions. -
wp-typography/trunk/includes/wp-typography/settings/class-abstract-locale-settings.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2017-202 2Peter Putzer.5 * Copyright 2017-2024 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 28 28 29 29 use WP_Typography\Settings\Plugin_Configuration as Config; 30 31 use PHP_Typography\Settings;32 30 33 31 /** … … 84 82 * @param bool $french_punctuation True if French punctuation spacing should be enabled. 85 83 */ 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 ) { 87 85 $this->priority = $priority; 88 86 $this->dash_style = $dash; … … 101 99 * @return bool True if the default is applicable to this locale, false otherwise. 102 100 */ 103 abstract public function match( $language, $country, $modifier = '' ): bool;101 abstract public function match( string $language, string $country, string $modifier = '' ): bool; 104 102 105 103 /** … … 108 106 * @return int 109 107 */ 110 public function priority() : int {108 public function priority(): int { 111 109 return $this->priority; 112 110 } … … 119 117 * @return array<string,string|int|bool> 120 118 */ 121 public function adjust_defaults( array $defaults ) : array {119 public function adjust_defaults( array $defaults ): array { 122 120 $defaults[ Config::SMART_DASHES_STYLE ] = $this->dash_style; 123 121 $defaults[ Config::SMART_QUOTES_PRIMARY ] = $this->primary_quote_style; … … 133 131 * @return string A Quote_Style constant. 134 132 */ 135 public function primary_quote_style() : string {133 public function primary_quote_style(): string { 136 134 return $this->primary_quote_style; 137 135 } … … 142 140 * @return string A Quote_Style constant. 143 141 */ 144 public function secondary_quote_style() : string {142 public function secondary_quote_style(): string { 145 143 return $this->secondary_quote_style; 146 144 } … … 151 149 * @return string A Dash_Style constant. 152 150 */ 153 public function dash_style() : string {151 public function dash_style(): string { 154 152 return $this->dash_style; 155 153 } … … 160 158 * @return bool 161 159 */ 162 public function use_french_punctuation_spacing() : bool {160 public function use_french_punctuation_spacing(): bool { 163 161 return $this->french_punctuation; 164 162 } -
wp-typography/trunk/includes/wp-typography/settings/class-basic-locale-settings.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2017-202 2Peter Putzer.5 * Copyright 2017-2024 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 26 26 27 27 namespace WP_Typography\Settings; 28 29 use PHP_Typography\Settings;30 28 31 29 /** … … 75 73 * @param bool $french_punctuation True if French punctuation spacing should be enabled. 76 74 */ 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 ) { 78 76 parent::__construct( 79 77 self::LANGUAGE_PRIORITY * \count( $languages ) + self::COUNTRY_PRIORITY * \count( $countries ) + self::MODIFIER_PRIORITY * \count( $modifiers ), … … 98 96 * @return bool True if the default is applicable to this locale, false otherwise. 99 97 */ 100 public function match( $language, $country, $modifier = '' ): bool {98 public function match( string $language, string $country, string $modifier = '' ): bool { 101 99 return ( empty( $this->valid_languages ) || isset( $this->valid_languages[ $language ] ) ) 102 100 && ( empty( $this->valid_countries ) || isset( $this->valid_countries[ $country ] ) ) -
wp-typography/trunk/includes/wp-typography/settings/class-locale-settings.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2017-202 2Peter Putzer.5 * Copyright 2017-2024 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 46 46 * @return bool True if the default is applicable to this locale, false otherwise. 47 47 */ 48 public function match( $language, $country, $modifier = '' ): bool;48 public function match( string $language, string $country, string $modifier = '' ): bool; 49 49 50 50 /** … … 53 53 * @return int 54 54 */ 55 public function priority() : int;55 public function priority(): int; 56 56 57 57 /** … … 62 62 * @return array<string,string|int|bool> 63 63 */ 64 public function adjust_defaults( array $defaults ) : array;64 public function adjust_defaults( array $defaults ): array; 65 65 66 66 /** … … 69 69 * @return string A Quote_Style constant. 70 70 */ 71 public function primary_quote_style() : string;71 public function primary_quote_style(): string; 72 72 73 73 /** … … 76 76 * @return string A Quote_Style constant. 77 77 */ 78 public function secondary_quote_style() : string;78 public function secondary_quote_style(): string; 79 79 80 80 /** … … 83 83 * @return string A Dash_Style constant. 84 84 */ 85 public function dash_style() : string;85 public function dash_style(): string; 86 86 87 87 /** … … 90 90 * @return bool 91 91 */ 92 public function use_french_punctuation_spacing() : bool;92 public function use_french_punctuation_spacing(): bool; 93 93 } -
wp-typography/trunk/includes/wp-typography/settings/class-plugin-configuration.php
r2852338 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2017-202 3Peter Putzer.5 * Copyright 2017-2024 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 27 27 namespace WP_Typography\Settings; 28 28 29 use WP_Typography;30 29 use WP_Typography\UI\Sections; 31 30 use WP_Typography\UI\Tabs; … … 133 132 * @return array<string,Config> 134 133 */ 135 public static function get_defaults() : array {134 public static function get_defaults(): array { 136 135 if ( empty( self::$defaults ) ) { 137 136 self::$defaults = [ // @codeCoverageIgnore … … 689 688 * @return array<int,int> 690 689 */ 691 private static function get_numeric_option_values( array $values ) : array {690 private static function get_numeric_option_values( array $values ): array { 692 691 return \array_combine( $values, $values ); 693 692 } … … 698 697 * @return array<string,string> 699 698 */ 700 private static function get_quote_style_option_values() : array {699 private static function get_quote_style_option_values(): array { 701 700 return [ 702 701 Quote_Style::DOUBLE_CURLED => '“foo”', -
wp-typography/trunk/includes/wp-typography/settings/class-tools.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2019-202 2Peter Putzer.5 * Copyright 2019-2024 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 46 46 * quotes (prime marks) are treated as apostrophes. 47 47 * 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. 49 50 * 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. 51 54 */ 52 public static function parse_smart_quote_exceptions_string( $string ): array {55 public static function parse_smart_quote_exceptions_string( string $exceptions ): array { 53 56 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 ) { 56 59 $key = \trim( \strip_tags( $replacement ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.strip_tags_strip_tags -- no need for WordPress' version here. 57 60 $replacement = \str_replace( "'", U::APOSTROPHE, $key ); … … 75 78 * @deprecated 5.8.0 76 79 * 80 * @since 5.9.0 Parameter `$array` renamed to `$arr` to prevent conflict with reserved keywords. 81 * 77 82 * @template T 78 83 * 79 84 * @param callable $callback A callback function that needs to return [ $key => $value ] pairs. 80 * @param array<T> $arr ayThe array.85 * @param array<T> $arr The array. 81 86 * 82 87 * @return array<T> 83 88 */ 84 public static function array_map_assoc( callable $callback, array $arr ay ): array {89 public static function array_map_assoc( callable $callback, array $arr ): array { 85 90 \_deprecated_function( __FUNCTION__, '5.8.0' ); 86 91 87 92 $new = []; 88 93 89 foreach ( $arr ayas $k => $v ) {94 foreach ( $arr as $k => $v ) { 90 95 $u = $callback( $k, $v ); 91 96 -
wp-typography/trunk/includes/wp-typography/typography/class-custom-node-fix.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2018-202 2Peter Putzer.5 * Copyright 2018-2024 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 45 45 * @var string 46 46 */ 47 private $group;47 private string $group; 48 48 49 49 /** … … 68 68 * @return void 69 69 */ 70 public function apply( \DOMText $textnode, Settings $settings, $is_title = false ) : void {70 public function apply( \DOMText $textnode, Settings $settings, $is_title = false ): void { 71 71 /** 72 72 * Filters the text node content for the given group. -
wp-typography/trunk/includes/wp-typography/typography/class-custom-registry.php
r1938183 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2018 Peter Putzer.5 * Copyright 2018-2024 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 28 28 29 29 use PHP_Typography\Fixes\Default_Registry; 30 use PHP_Typography\Hyphenator\Cache;31 30 32 31 /** -
wp-typography/trunk/includes/wp-typography/typography/class-custom-token-fix.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2018-202 2Peter Putzer.5 * Copyright 2018-2024 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 28 28 29 29 use PHP_Typography\Settings; 30 31 30 use PHP_Typography\Text_Parser\Token; 32 33 31 use PHP_Typography\Fixes\Token_Fixes\Abstract_Token_Fix; 34 32 … … 57 55 * @throws \InvalidArgumentException The exception is thrown if `$type` is any other string. 58 56 */ 59 public function __construct( $type ) {57 public function __construct( string $type ) { 60 58 $valid_types = [ 61 59 'mixed_words' => self::MIXED_WORDS, … … 66 64 67 65 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.' ); 69 67 } 70 68 … … 85 83 * @return Token[] An array of tokens. 86 84 */ 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 { 88 86 89 87 /** -
wp-typography/trunk/includes/wp-typography/ui/class-sections.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2017-202 2Peter Putzer.5 * Copyright 2017-2023 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 70 70 * @phpstan-return Section[] 71 71 */ 72 public static function get_sections() : array {72 public static function get_sections(): array { 73 73 if ( empty( self::$sections ) ) { 74 74 self::$sections = [ // @codeCoverageIgnore -
wp-typography/trunk/includes/wp-typography/ui/class-tabs.php
r2848497 r3208262 3 3 * This file is part of wp-Typography. 4 4 * 5 * Copyright 2017-202 2Peter Putzer.5 * Copyright 2017-2023 Peter Putzer. 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 70 70 * @phpstan-return Tab[] 71 71 */ 72 public static function get_tabs() : array {72 public static function get_tabs(): array { 73 73 if ( empty( self::$tabs ) ) { 74 74 self::$tabs = [ // @codeCoverageIgnore -
wp-typography/trunk/js/clean-clipboard.js
r2819294 r3208262 2 2 * This file is part of wp-Typography. 3 3 * 4 * Copyright 2016-202 1Peter Putzer.4 * Copyright 2016-2024 Peter Putzer. 5 5 * 6 6 * 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 202 3-01-22 10:23:33PM */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 */ 2 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)}}); -
wp-typography/trunk/js/src/clean-clipboard.js
r2664026 r3208262 2 2 * This file is part of wp-Typography. 3 3 * 4 * Copyright 2016-202 1Peter Putzer.4 * Copyright 2016-2024 Peter Putzer. 5 5 * 6 6 * This program is free software; you can redistribute it and/or … … 32 32 * @author Peter Putzer <github@mundschenk.at> 33 33 */ 34 ( function() {34 ( function() { 35 35 'use strict'; 36 36 37 if ( window.getSelection) {38 document.addEventListener( 'copy', function() {37 if ( window.getSelection ) { 38 document.addEventListener( 'copy', function() { 39 39 // Make sure we have an un-collapsed selection. 40 40 const sel = window.getSelection(); 41 if ( sel.isCollapsed) {41 if ( sel.isCollapsed ) { 42 42 // This is probably a form field selection, no way to access it. 43 43 return; … … 50 50 51 51 // 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 ); 54 54 } 55 55 56 56 // 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() ); 59 59 shadow.style.position = 'absolute'; 60 60 shadow.style.left = '-99999px'; 61 61 shadow.innerHTML = shadow.innerHTML 62 62 // Remove soft hyphens. 63 .replace( /\u00AD/gi, '')63 .replace( /\u00AD/gi, '' ) 64 64 // Also remove zero-width spaces. 65 .replace( /\u200B/gi, '');65 .replace( /\u200B/gi, '' ); 66 66 67 67 // 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 ); 70 70 71 71 // Clean up after copying. 72 window.setTimeout( function() {72 window.setTimeout( function() { 73 73 // Remove <div>. 74 74 shadow.remove(); … … 76 76 // Restore real selection. 77 77 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 ] ); 80 80 } 81 }, 0 );82 } );81 }, 0 ); 82 } ); 83 83 } 84 } )();84 }() ); -
wp-typography/trunk/readme.txt
r2852644 r3208262 2 2 Contributors: pputzer, kingjeffrey 3 3 Tags: typography, hyphenation, smart quotes, formatting, widows, orphans, typogrify, quotes, prettify, small caps, diacritics 4 Tested up to: 6. 15 Stable tag: 5. 9.14 Tested up to: 6.7 5 Stable tag: 5.10.0 6 6 7 7 Improve your web typography with: hyphenation, space control, intelligent character replacement, and CSS hooks. … … 78 78 == Changelog == 79 79 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 80 87 = 5.9.1 - January 22, 2023 = 81 88 * _Bugfix_: Only apply filters to ACF fields returning strings to preserve type expectations for downstream code. … … 91 98 = 5.8.1 - January 25, 2022 = 92 99 * _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 46 46 private static $includeFile; 47 47 48 /** @var ?string*/48 /** @var string|null */ 49 49 private $vendorDir; 50 50 51 51 // PSR-4 52 52 /** 53 * @var array[] 54 * @psalm-var array<string, array<string, int>> 53 * @var array<string, array<string, int>> 55 54 */ 56 55 private $prefixLengthsPsr4 = array(); 57 56 /** 58 * @var array[] 59 * @psalm-var array<string, array<int, string>> 57 * @var array<string, list<string>> 60 58 */ 61 59 private $prefixDirsPsr4 = array(); 62 60 /** 63 * @var array[] 64 * @psalm-var array<string, string> 61 * @var list<string> 65 62 */ 66 63 private $fallbackDirsPsr4 = array(); … … 68 65 // PSR-0 69 66 /** 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>>> 72 72 */ 73 73 private $prefixesPsr0 = array(); 74 74 /** 75 * @var array[] 76 * @psalm-var array<string, string> 75 * @var list<string> 77 76 */ 78 77 private $fallbackDirsPsr0 = array(); … … 82 81 83 82 /** 84 * @var string[] 85 * @psalm-var array<string, string> 83 * @var array<string, string> 86 84 */ 87 85 private $classMap = array(); … … 91 89 92 90 /** 93 * @var bool[] 94 * @psalm-var array<string, bool> 91 * @var array<string, bool> 95 92 */ 96 93 private $missingClasses = array(); 97 94 98 /** @var ?string*/95 /** @var string|null */ 99 96 private $apcuPrefix; 100 97 101 98 /** 102 * @var self[]99 * @var array<string, self> 103 100 */ 104 101 private static $registeredLoaders = array(); 105 102 106 103 /** 107 * @param ?string$vendorDir104 * @param string|null $vendorDir 108 105 */ 109 106 public function __construct($vendorDir = null) … … 114 111 115 112 /** 116 * @return string[]113 * @return array<string, list<string>> 117 114 */ 118 115 public function getPrefixes() … … 126 123 127 124 /** 128 * @return array[] 129 * @psalm-return array<string, array<int, string>> 125 * @return array<string, list<string>> 130 126 */ 131 127 public function getPrefixesPsr4() … … 135 131 136 132 /** 137 * @return array[] 138 * @psalm-return array<string, string> 133 * @return list<string> 139 134 */ 140 135 public function getFallbackDirs() … … 144 139 145 140 /** 146 * @return array[] 147 * @psalm-return array<string, string> 141 * @return list<string> 148 142 */ 149 143 public function getFallbackDirsPsr4() … … 153 147 154 148 /** 155 * @return string[] Array of classname => path 156 * @psalm-return array<string, string> 149 * @return array<string, string> Array of classname => path 157 150 */ 158 151 public function getClassMap() … … 162 155 163 156 /** 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 166 158 * 167 159 * @return void … … 180 172 * appending or prepending to the ones previously set for this prefix. 181 173 * 182 * @param string $prefix The prefix183 * @param string[]|string $paths The PSR-0 root directories184 * @param bool $prepend Whether to prepend the directories174 * @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 185 177 * 186 178 * @return void … … 188 180 public function add($prefix, $paths, $prepend = false) 189 181 { 182 $paths = (array) $paths; 190 183 if (!$prefix) { 191 184 if ($prepend) { 192 185 $this->fallbackDirsPsr0 = array_merge( 193 (array)$paths,186 $paths, 194 187 $this->fallbackDirsPsr0 195 188 ); … … 197 190 $this->fallbackDirsPsr0 = array_merge( 198 191 $this->fallbackDirsPsr0, 199 (array)$paths192 $paths 200 193 ); 201 194 } … … 206 199 $first = $prefix[0]; 207 200 if (!isset($this->prefixesPsr0[$first][$prefix])) { 208 $this->prefixesPsr0[$first][$prefix] = (array)$paths;201 $this->prefixesPsr0[$first][$prefix] = $paths; 209 202 210 203 return; … … 212 205 if ($prepend) { 213 206 $this->prefixesPsr0[$first][$prefix] = array_merge( 214 (array)$paths,207 $paths, 215 208 $this->prefixesPsr0[$first][$prefix] 216 209 ); … … 218 211 $this->prefixesPsr0[$first][$prefix] = array_merge( 219 212 $this->prefixesPsr0[$first][$prefix], 220 (array)$paths213 $paths 221 214 ); 222 215 } … … 227 220 * appending or prepending to the ones previously set for this namespace. 228 221 * 229 * @param string $prefix The prefix/namespace, with trailing '\\'230 * @param string[]|string $paths The PSR-4 base directories231 * @param bool $prepend Whether to prepend the directories222 * @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 232 225 * 233 226 * @throws \InvalidArgumentException … … 237 230 public function addPsr4($prefix, $paths, $prepend = false) 238 231 { 232 $paths = (array) $paths; 239 233 if (!$prefix) { 240 234 // Register directories for the root namespace. 241 235 if ($prepend) { 242 236 $this->fallbackDirsPsr4 = array_merge( 243 (array)$paths,237 $paths, 244 238 $this->fallbackDirsPsr4 245 239 ); … … 247 241 $this->fallbackDirsPsr4 = array_merge( 248 242 $this->fallbackDirsPsr4, 249 (array)$paths243 $paths 250 244 ); 251 245 } … … 257 251 } 258 252 $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; 259 $this->prefixDirsPsr4[$prefix] = (array)$paths;253 $this->prefixDirsPsr4[$prefix] = $paths; 260 254 } elseif ($prepend) { 261 255 // Prepend directories for an already registered namespace. 262 256 $this->prefixDirsPsr4[$prefix] = array_merge( 263 (array)$paths,257 $paths, 264 258 $this->prefixDirsPsr4[$prefix] 265 259 ); … … 268 262 $this->prefixDirsPsr4[$prefix] = array_merge( 269 263 $this->prefixDirsPsr4[$prefix], 270 (array)$paths264 $paths 271 265 ); 272 266 } … … 277 271 * replacing any others previously set for this prefix. 278 272 * 279 * @param string $prefix The prefix280 * @param string[]|string $paths The PSR-0 base directories273 * @param string $prefix The prefix 274 * @param list<string>|string $paths The PSR-0 base directories 281 275 * 282 276 * @return void … … 295 289 * replacing any others previously set for this namespace. 296 290 * 297 * @param string $prefix The prefix/namespace, with trailing '\\'298 * @param string[]|string $paths The PSR-4 base directories291 * @param string $prefix The prefix/namespace, with trailing '\\' 292 * @param list<string>|string $paths The PSR-4 base directories 299 293 * 300 294 * @throws \InvalidArgumentException … … 430 424 { 431 425 if ($file = $this->findFile($class)) { 432 (self::$includeFile)($file); 426 $includeFile = self::$includeFile; 427 $includeFile($file); 433 428 434 429 return true; … … 481 476 482 477 /** 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> 486 481 */ 487 482 public static function getRegisteredLoaders() … … 561 556 } 562 557 563 private static function initializeIncludeClosure(): void 558 /** 559 * @return void 560 */ 561 private static function initializeIncludeClosure() 564 562 { 565 563 if (self::$includeFile !== null) { … … 575 573 * @return void 576 574 */ 577 self::$includeFile = static function($file) {575 self::$includeFile = \Closure::bind(static function($file) { 578 576 include $file; 579 } ;577 }, null, null); 580 578 } 581 579 } -
wp-typography/trunk/vendor-scoped/composer/autoload_classmap.php
r2819294 r3208262 38 38 'WP_Typography\\UI\\Sections' => $baseDir . '/includes/wp-typography/ui/class-sections.php', 39 39 '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', 40 41 'WP_Typography\\Vendor\\Dice\\Dice' => $vendorDir . '/level-2/dice/Dice.php', 41 42 'WP_Typography\\Vendor\\Masterminds\\HTML5' => $vendorDir . '/masterminds/html5/src/HTML5.php', … … 77 78 'WP_Typography\\Vendor\\Mundschenk\\UI\\Controls\\Text_Input' => $vendorDir . '/mundschenk-at/wp-settings-ui/src/ui/controls/class-text-input.php', 78 79 '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', 80 81 'WP_Typography\\Vendor\\PHP_Typography\\DOM' => $vendorDir . '/mundschenk-at/php-typography/src/class-dom.php', 81 82 '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 64 64 'WP_Typography\\UI\\Sections' => __DIR__ . '/../..' . '/includes/wp-typography/ui/class-sections.php', 65 65 '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', 66 67 'WP_Typography\\Vendor\\Dice\\Dice' => __DIR__ . '/..' . '/level-2/dice/Dice.php', 67 68 'WP_Typography\\Vendor\\Masterminds\\HTML5' => __DIR__ . '/..' . '/masterminds/html5/src/HTML5.php', … … 103 104 'WP_Typography\\Vendor\\Mundschenk\\UI\\Controls\\Text_Input' => __DIR__ . '/..' . '/mundschenk-at/wp-settings-ui/src/ui/controls/class-text-input.php', 104 105 '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', 106 107 'WP_Typography\\Vendor\\PHP_Typography\\DOM' => __DIR__ . '/..' . '/mundschenk-at/php-typography/src/class-dom.php', 107 108 '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 32 32 * @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. 33 33 */ 34 public function addRule(string $name, array $rule) : self34 public function addRule(string $name, array $rule): self 35 35 { 36 36 $dice = clone $this; … … 42 42 * @param array Rules in a single array [name => $rule] format 43 43 */ 44 public function addRules($rules) : self45 { 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); 48 48 } 49 49 $dice = clone $this; … … 55 55 private function addRuleTo(Dice $dice, string $name, array $rule) 56 56 { 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); 59 59 } 60 60 //Allow substitutions rules to be defined with a leading a slash 61 61 if (isset($rule['substitutions'])) { 62 62 foreach ($rule['substitutions'] as $key => $value) { 63 $rule['substitutions'][ \ltrim($key, '\\')] = $value;63 $rule['substitutions'][ltrim($key, '\\')] = $value; 64 64 } 65 65 } 66 66 //Clear any existing instance or cache for this class 67 67 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); 69 69 } 70 70 /** … … 73 73 * @return array The rules for the specified class 74 74 */ 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, '\\')); 78 79 if (isset($this->rules[$lcName])) { 79 80 return $this->rules[$lcName]; … … 81 82 foreach ($this->rules as $key => $rule) { 82 83 // 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)) { 84 85 // And that rule should be inherited to subclasses 85 86 return $rule; … … 104 105 // Create a closure for creating the object if there isn't one already 105 106 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)); 107 108 } 108 109 // Call the cached closure which will return a fully constructed object of type $name … … 127 128 throw new \InvalidArgumentException('Cannot instantiate interface'); 128 129 }; 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 }; 129 135 } 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 }; 141 140 } 142 141 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) { 144 143 //Internal classes may not be able to be constructed without calling the constructor and will not suffer from #7, construct them normally. 145 144 if ($class->isInternal()) { … … 158 157 // If there are shared instances, create them and merge them with shared instances higher up the object graph 159 158 if (isset($rule['shareInstances'])) { 160 $closure = function (array $args, array $share) use ($closure, $rule) {159 $closure = function (array $args, array $share) use ($closure, $rule) { 161 160 foreach ($rule['shareInstances'] as $instance) { 162 161 $share[] = $this->create($instance, [], $share); … … 167 166 // When $rule['call'] is set, wrap the closure in another closure which will call the required methods after constructing the object 168 167 // 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) { 170 169 // Construct the object using the original closure 171 170 $object = $closure($args, $share); … … 179 178 $this->instances[$name] = $return; 180 179 } 181 if ( \is_object($return)) {182 $class = new \ReflectionClass( \get_class($return));180 if (is_object($return)) { 181 $class = new \ReflectionClass(get_class($return)); 183 182 } 184 183 $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); 189 186 } 190 187 } … … 202 199 private function expand($param, array $share = [], bool $createFromString = \false) 203 200 { 204 if ( \is_array($param)) {201 if (is_array($param)) { 205 202 //if a rule specifies Dice::INSTANCE, look up the relevant instance 206 203 if (isset($param[self::INSTANCE])) { … … 212 209 $args = isset($param['params']) ? $this->expand($param['params']) : []; 213 210 //Support Dice::INSTANCE by creating/fetching the specified instance 214 if ( \is_array($param[self::INSTANCE])) {211 if (is_array($param[self::INSTANCE])) { 215 212 $param[self::INSTANCE][0] = $this->expand($param[self::INSTANCE][0], $share, \true); 216 213 } 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); 219 216 } 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]); 222 223 } 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; 237 230 } 238 231 /** … … 245 238 if ($class && ($arg instanceof $class || $arg === null && $param->allowsNull())) { 246 239 // 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]; 248 241 } 249 242 } … … 263 256 $type = $param->getType(); 264 257 $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'])]; 266 259 } 267 260 // 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) { 269 262 // If the rule has construtParams set, construct any classes reference and use them as $args 270 263 if (isset($rule['constructParams'])) { 271 $args = \array_merge($args, $this->expand($rule['constructParams'], $share));264 $args = array_merge($args, $this->expand($rule['constructParams'], $share)); 272 265 } 273 266 // Array of matched parameters … … 278 271 if ($args && ($match = $this->matchParam($param, $class, $args)) !== \false) { 279 272 $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); 293 279 } 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; 312 289 } 313 290 } 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; 314 297 } 315 298 } -
wp-typography/trunk/vendor-scoped/masterminds/html5/README.md
r2819294 r3208262 31 31 - Runs on **PHP** 5.3.0 or newer 32 32 33 [](https://travis-ci.org/Masterminds/html5-php)33 [](https://github.com/Masterminds/html5-php/actions/workflows/ci.yaml) 34 34 [](https://packagist.org/packages/masterminds/html5) 35 35 [](https://scrutinizer-ci.com/g/Masterminds/html5-php/?branch=master) … … 190 190 interpreter. While one may be supplied, not all features will be 191 191 supported. 192 - Re ntrance: The current parser is not re-entrant. (Thus you can't pause192 - Reentrance: The current parser is not re-entrant. (Thus you can't pause 193 193 the parser to modify the HTML string mid-parse.) 194 194 - Validation: The current tree builder is **not** a validating parser. -
wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5.php
r2663994 r3208262 28 28 public function __construct(array $defaultOptions = array()) 29 29 { 30 $this->defaultOptions = \array_merge($this->defaultOptions, $defaultOptions);30 $this->defaultOptions = array_merge($this->defaultOptions, $defaultOptions); 31 31 } 32 32 /** … … 60 60 { 61 61 // 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); 64 64 } 65 return $this->parse( \file_get_contents($file), $options);65 return $this->parse(file_get_contents($file), $options); 66 66 } 67 67 /** … … 128 128 public function hasErrors() 129 129 { 130 return \count($this->errors) > 0;130 return count($this->errors) > 0; 131 131 } 132 132 /** … … 141 141 { 142 142 $this->errors = array(); 143 $options = \array_merge($this->defaultOptions, $options);143 $options = array_merge($this->defaultOptions, $options); 144 144 $events = new DOMTreeBuilder(\false, $options); 145 145 $scanner = new Scanner($input, !empty($options['encoding']) ? $options['encoding'] : 'UTF-8'); … … 162 162 public function parseFragment($input, array $options = array()) 163 163 { 164 $options = \array_merge($this->defaultOptions, $options);164 $options = array_merge($this->defaultOptions, $options); 165 165 $events = new DOMTreeBuilder(\true, $options); 166 166 $scanner = new Scanner($input, !empty($options['encoding']) ? $options['encoding'] : 'UTF-8'); … … 183 183 { 184 184 $close = \true; 185 if ( \is_resource($file)) {185 if (is_resource($file)) { 186 186 $stream = $file; 187 187 $close = \false; 188 188 } else { 189 $stream = \fopen($file, 'wb');189 $stream = fopen($file, 'wb'); 190 190 } 191 $options = \array_merge($this->defaultOptions, $options);191 $options = array_merge($this->defaultOptions, $options); 192 192 $rules = new OutputRules($stream, $options); 193 193 $trav = new Traverser($dom, $stream, $rules, $options); … … 198 198 $rules->unsetTraverser(); 199 199 if ($close) { 200 \fclose($stream);200 fclose($stream); 201 201 } 202 202 } … … 214 214 public function saveHTML($dom, $options = array()) 215 215 { 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); 220 220 return $html; 221 221 } -
wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5/Elements.php
r2207810 r3208262 65 65 const BLOCK_ONLY_INLINE = 128; 66 66 /** 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 /** 67 78 * The HTML5 elements as defined in http://dev.w3.org/html5/markup/elements.html. 68 79 * … … 234 245 // NORMAL | AUTOCLOSE_P | BLOCK_TAG 235 246 'var' => 1, 236 'video' => 65, 237 // NORMAL | BLOCK_TAG 247 'video' => 1, 238 248 'wbr' => 9, 239 249 // NORMAL | VOID_TAG … … 412 422 // html5 element names are case insensitive. Forcing lowercase for the check. 413 423 // 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)]); 415 425 } 416 426 /** … … 480 490 public static function normalizeSvgElement($name) 481 491 { 482 $name = \strtolower($name);492 $name = strtolower($name); 483 493 if (isset(static::$svgCaseSensitiveElementMap[$name])) { 484 494 $name = static::$svgCaseSensitiveElementMap[$name]; … … 495 505 public static function normalizeSvgAttribute($name) 496 506 { 497 $name = \strtolower($name);507 $name = strtolower($name); 498 508 if (isset(static::$svgCaseSensitiveAttributeMap[$name])) { 499 509 $name = static::$svgCaseSensitiveAttributeMap[$name]; … … 511 521 public static function normalizeMathMlAttribute($name) 512 522 { 513 $name = \strtolower($name);523 $name = strtolower($name); 514 524 // Only one attribute has a mixed case form for MathML. 515 525 if ('definitionurl' === $name) { -
wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5/Parser/CharacterReference.php
r2663994 r3208262 36 36 // UNTESTED: This may fail on some planes. Couldn't find full documentation 37 37 // 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'); 39 39 } 40 40 /** … … 47 47 public static function lookupHex($hexdec) 48 48 { 49 return static::lookupDecimal( \hexdec($hexdec));49 return static::lookupDecimal(hexdec($hexdec)); 50 50 } 51 51 } -
wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php
r2663994 r3208262 136 136 } 137 137 // 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); 139 139 if ($isFragment) { 140 140 $this->insertMode = static::IM_IN_BODY; … … 256 256 // when we found a tag thats appears inside $nsRoots, we have to switch the defalut namespace 257 257 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]); 259 259 ++$pushes; 260 260 } … … 265 265 if ('xmlns' === $aName) { 266 266 $needsWorkaround = $aVal; 267 \array_unshift($this->nsStack, array('' => $aVal) + $this->nsStack[0]);267 array_unshift($this->nsStack, array('' => $aVal) + $this->nsStack[0]); 268 268 ++$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]); 271 271 ++$pushes; 272 272 } … … 277 277 $this->onlyInline = null; 278 278 } 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 } 279 288 try { 280 $prefix = ($pos = \strpos($lname, ':')) ? \substr($lname, 0, $pos) : '';289 $prefix = ($pos = strpos($lname, ':')) ? substr($lname, 0, $pos) : ''; 281 290 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] . '"' : '') . '/>'; 283 292 $frag = new \DOMDocument('1.0', 'UTF-8'); 284 293 $frag->loadXML($xml); 285 294 $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); 286 297 } 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); 292 299 } 293 300 } catch (\DOMException $e) { … … 304 311 // to avoid spl_object_hash collisions whe have to avoid garbage collection of $ele storing it into $pushes 305 312 // 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); 307 314 } 308 315 foreach ($attributes as $aName => $aVal) { … … 318 325 $aVal = (string) $aVal; 319 326 try { 320 $prefix = ($pos = \strpos($aName, ':')) ? \substr($aName, 0, $pos) : \false;327 $prefix = ($pos = strpos($aName, ':')) ? substr($aName, 0, $pos) : \false; 321 328 if ('xmlns' === $prefix) { 322 329 $ele->setAttributeNS(self::NAMESPACE_XMLNS, $aName, $aVal); … … 361 368 // remove the namespaced definded by current node 362 369 for ($i = 0; $i < $pushes; ++$i) { 363 \array_shift($this->nsStack);370 array_shift($this->nsStack); 364 371 } 365 372 } … … 383 390 if ($this->insertMode <= static::IM_BEFORE_HTML) { 384 391 // 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'))) { 386 393 $this->startTag('html'); 387 394 $this->endTag($name); … … 397 404 $lname = Elements::normalizeSvgElement($lname); 398 405 } 399 $cid = \spl_object_hash($this->current);406 $cid = spl_object_hash($this->current); 400 407 // XXX: HTML has no parent. What do we do, though, 401 408 // if this element appears in the wrong place? … … 406 413 if (isset($this->pushes[$cid])) { 407 414 for ($i = 0; $i < $this->pushes[$cid][0]; ++$i) { 408 \array_shift($this->nsStack);415 array_shift($this->nsStack); 409 416 } 410 417 unset($this->pushes[$cid]); … … 440 447 // practical as most documents contain these characters. Other text is not 441 448 // 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"); 443 450 if (!empty($dataTmp)) { 444 451 // fprintf(STDOUT, "Unexpected insert mode: %d", $this->insertMode); … … 457 464 public function parseError($msg, $line = 0, $col = 0) 458 465 { 459 $this->errors[] = \sprintf('Line %d, Col %d: %s', $line, $col, $msg);466 $this->errors[] = sprintf('Line %d, Col %d: %s', $line, $col, $msg); 460 467 } 461 468 public function getErrors() … … 471 478 { 472 479 // 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)) { 474 481 return; 475 482 } -
wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5/Parser/FileInputStream.php
r2663994 r3208262 27 27 { 28 28 // Get the contents of the file. 29 $content = \file_get_contents($data);29 $content = file_get_contents($data); 30 30 parent::__construct($content, $encoding, $debug); 31 31 } -
wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5/Parser/Scanner.php
r2819294 r3208262 39 39 { 40 40 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); 42 42 $data = (string) $data; 43 43 } … … 50 50 $this->data = $data; 51 51 $this->char = 0; 52 $this->EOF = \strlen($data);52 $this->EOF = strlen($data); 53 53 } 54 54 /** … … 72 72 public function sequenceMatches($sequence, $caseSensitive = \true) 73 73 { 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); 76 76 } 77 77 /** … … 199 199 return \false; 200 200 } 201 $len = \strspn($this->data, "\n\t\f ", $this->char);201 $len = strspn($this->data, "\n\t\f ", $this->char); 202 202 $this->char += $len; 203 203 return $len; … … 215 215 // Add one to $this->char because we want the number for the next 216 216 // 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; 218 218 } 219 219 /** … … 257 257 // position of) added to it because strrpos's behaviour includes the 258 258 // 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); 261 261 // However, for here we want the length up until the next byte to be 262 262 // processed, so add one to the current byte ($this->char). 263 263 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); 265 265 } else { 266 266 // After a newline. 267 $findLengthOf = \substr($this->data, 0, $this->char);267 $findLengthOf = substr($this->data, 0, $this->char); 268 268 } 269 269 return UTF8Utils::countChars($findLengthOf); … … 279 279 { 280 280 if ($this->char < $this->EOF) { 281 $data = \substr($this->data, $this->char);281 $data = substr($this->data, $this->char); 282 282 $this->char = $this->EOF; 283 283 return $data; … … 303 303 */ 304 304 $crlfTable = array("\x00" => "�", "\r\n" => "\n", "\r" => "\n"); 305 return \strtr($data, $crlfTable);305 return strtr($data, $crlfTable); 306 306 } 307 307 /** … … 325 325 } 326 326 if (0 === $max || $max) { 327 $len = \strcspn($this->data, $bytes, $this->char, $max);327 $len = strcspn($this->data, $bytes, $this->char, $max); 328 328 } 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); 332 332 $this->char += $len; 333 333 return $string; … … 352 352 } 353 353 if (0 === $max || $max) { 354 $len = \strspn($this->data, $bytes, $this->char, $max);354 $len = strspn($this->data, $bytes, $this->char, $max); 355 355 } 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); 359 359 $this->char += $len; 360 360 return $string; -
wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5/Parser/StringInputStream.php
r2663994 r3208262 66 66 $data = UTF8Utils::convertToUTF8($data, $encoding); 67 67 if ($debug) { 68 \fprintf(\STDOUT, $debug, $data, \strlen($data));68 fprintf(\STDOUT, $debug, $data, strlen($data)); 69 69 } 70 70 // There is good reason to question whether it makes sense to … … 75 75 $this->data = $data; 76 76 $this->char = 0; 77 $this->EOF = \strlen($data);77 $this->EOF = strlen($data); 78 78 } 79 79 public function __toString() … … 94 94 */ 95 95 $crlfTable = array("\x00" => "�", "\r\n" => "\n", "\r" => "\n"); 96 return \strtr($data, $crlfTable);96 return strtr($data, $crlfTable); 97 97 } 98 98 /** … … 106 106 // Add one to $this->char because we want the number for the next 107 107 // 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; 109 109 } 110 110 /** … … 132 132 // position of) added to it because strrpos's behaviour includes the 133 133 // 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); 136 136 // However, for here we want the length up until the next byte to be 137 137 // processed, so add one to the current byte ($this->char). 138 138 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); 140 140 } else { 141 141 // After a newline. 142 $findLengthOf = \substr($this->data, 0, $this->char);142 $findLengthOf = substr($this->data, 0, $this->char); 143 143 } 144 144 return UTF8Utils::countChars($findLengthOf); … … 156 156 * @return string The current character. 157 157 */ 158 #[\ReturnTypeWillChange] 158 159 public function current() 159 160 { … … 164 165 * This is part of the Iterator interface. 165 166 */ 167 #[\ReturnTypeWillChange] 166 168 public function next() 167 169 { … … 171 173 * Rewind to the start of the string. 172 174 */ 175 #[\ReturnTypeWillChange] 173 176 public function rewind() 174 177 { … … 180 183 * @return bool Whether the current pointer location is valid. 181 184 */ 185 #[\ReturnTypeWillChange] 182 186 public function valid() 183 187 { … … 198 202 { 199 203 if ($this->char < $this->EOF) { 200 $data = \substr($this->data, $this->char);204 $data = substr($this->data, $this->char); 201 205 $this->char = $this->EOF; 202 206 return $data; … … 225 229 } 226 230 if (0 === $max || $max) { 227 $len = \strcspn($this->data, $bytes, $this->char, $max);231 $len = strcspn($this->data, $bytes, $this->char, $max); 228 232 } 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); 232 236 $this->char += $len; 233 237 return $string; … … 252 256 } 253 257 if (0 === $max || $max) { 254 $len = \strspn($this->data, $bytes, $this->char, $max);258 $len = strspn($this->data, $bytes, $this->char, $max); 255 259 } 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); 259 263 $this->char += $len; 260 264 return $string; … … 281 285 return \false; 282 286 } 287 #[\ReturnTypeWillChange] 283 288 public function key() 284 289 { -
wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5/Parser/Tokenizer.php
r2819294 r3208262 117 117 $this->flushBuffer(); 118 118 $tok = $this->scanner->next(); 119 if ('!' === $tok) { 119 if (\false === $tok) { 120 // end of string 121 $this->parseError('Illegal tag opening'); 122 } elseif ('!' === $tok) { 120 123 $this->markupDeclaration(); 121 124 } elseif ('/' === $tok) { … … 123 126 } elseif ('?' === $tok) { 124 127 $this->processingInstruction(); 125 } elseif ( \ctype_alpha($tok)) {128 } elseif ($this->is_alpha($tok)) { 126 129 $this->tagName(); 127 130 } else { … … 215 218 protected function rawText($tok) 216 219 { 217 if ( \is_null($this->untilTag)) {220 if (is_null($this->untilTag)) { 218 221 return $this->text($tok); 219 222 } … … 233 236 protected function rcdata($tok) 234 237 { 235 if ( \is_null($this->untilTag)) {238 if (is_null($this->untilTag)) { 236 239 return $this->text($tok); 237 240 } … … 248 251 } 249 252 } 250 $len = \strlen($sequence);253 $len = strlen($sequence); 251 254 $this->scanner->consume($len); 252 255 $len += $this->scanner->whitespace(); … … 304 307 // EOF -> parse error 305 308 // -> parse error 306 if (! \ctype_alpha($tok)) {309 if (!$this->is_alpha($tok)) { 307 310 $this->parseError("Expected tag name, got '%s'", $tok); 308 311 if ("\x00" == $tok || \false === $tok) { … … 312 315 } 313 316 $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); 315 318 // Trash whitespace. 316 319 $this->scanner->whitespace(); … … 332 335 // We know this is at least one char. 333 336 $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); 335 338 $attributes = array(); 336 339 $selfClose = \false; … … 346 349 } 347 350 $mode = $this->events->startTag($name, $attributes, $selfClose); 348 if ( \is_int($mode)) {351 if (is_int($mode)) { 349 352 $this->setTextMode($mode, $name); 350 353 } … … 406 409 throw new ParseError('Start tag inside of attribute.'); 407 410 } 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)) { 410 413 $tok = $this->scanner->current(); 411 414 $this->parseError('Expected an attribute name, got %s.', $tok); … … 421 424 // see issue #23: https://github.com/Masterminds/html5-php/issues/23 422 425 // 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)) { 424 427 $this->parseError('Unexpected characters in attribute name: %s', $name); 425 428 $isValidAttribute = \false; 426 } elseif ( \preg_match('/^[0-9.-]/u', $name)) {429 } elseif (preg_match('/^[0-9.-]/u', $name)) { 427 430 $this->parseError('Unexpected character at the begining of attribute name: %s', $name); 428 431 $isValidAttribute = \false; … … 664 667 $doctypeName = $this->scanner->charsUntil($stop); 665 668 // Lowercase ASCII, replace \0 with FFFD 666 $doctypeName = \strtolower(\strtr($doctypeName, "\x00", UTF8Utils::FFFD));669 $doctypeName = strtolower(strtr($doctypeName, "\x00", UTF8Utils::FFFD)); 667 670 $tok = $this->scanner->current(); 668 671 // If false, emit a parse error, DOCTYPE, and return. … … 675 678 if ('>' == $tok) { 676 679 // DOCTYPE without a name. 677 if (0 == \strlen($doctypeName)) {680 if (0 == strlen($doctypeName)) { 678 681 $this->parseError('Expected a DOCTYPE name. Got nothing.'); 679 682 $this->events->doctype($doctypeName, 0, null, \true); … … 686 689 } 687 690 $this->scanner->whitespace(); 688 $pub = \strtoupper($this->scanner->getAsciiAlpha());691 $pub = strtoupper($this->scanner->getAsciiAlpha()); 689 692 $white = $this->scanner->whitespace(); 690 693 // Get ID, and flag it as pub or system. … … 801 804 $white = $this->scanner->whitespace(); 802 805 // 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()) { 804 807 $this->parseError("Expected processing instruction name, got {$tok}"); 805 808 $this->bogusComment('<?' . $tok . $procName); … … 837 840 $buffer = ''; 838 841 // Optimization for reading larger blocks faster. 839 $first = \substr($sequence, 0, 1);842 $first = substr($sequence, 0, 1); 840 843 while (\false !== $this->scanner->current()) { 841 844 $buffer .= $this->scanner->charsUntil($first); … … 871 874 protected function sequenceMatches($sequence, $caseSensitive = \true) 872 875 { 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); 874 877 return $this->scanner->sequenceMatches($sequence, $caseSensitive); 875 878 } … … 912 915 protected function parseError($msg) 913 916 { 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); 918 921 } 919 922 $line = $this->scanner->currentLine(); … … 1013 1016 return '&'; 1014 1017 } 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 } 1015 1030 } -
wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5/Parser/TreeBuildingRules.php
r2207810 r3208262 74 74 protected function closeIfCurrentMatches($ele, $current, $match) 75 75 { 76 if ( \in_array($current->tagName, $match, \true)) {76 if (in_array($current->tagName, $match, \true)) { 77 77 $current->parentNode->appendChild($ele); 78 78 } else { -
wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5/Parser/UTF8Utils.php
r2663994 r3208262 36 36 /** 37 37 * 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. 39 39 * 40 40 * @param string $string … … 45 45 { 46 46 // 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'); 49 49 } 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'); 52 52 } 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); 59 54 // 0x80 = 0x7F - 0 + 1 (one added to get inclusive range) 60 55 // 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)); 62 57 } 63 58 /** … … 86 81 // which contains links to the actual but reports as well as work around 87 82 // details. 88 if ( \function_exists('mb_convert_encoding')) {83 if (function_exists('mb_convert_encoding')) { 89 84 // mb library has the following behaviors: 90 85 // - UTF-16 surrogates result in false. … … 95 90 // to our needs, and then change it back when we are done. This feels 96 91 // 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) { 102 97 // fprintf(STDOUT, "iconv found\n"); 103 98 // iconv has the following behaviors: … … 105 100 // - Beyond Plane 16 is replaced with a lower char. 106 101 // - Incomplete sequences generate a warning. 107 $data = @ \iconv($encoding, 'UTF-8//IGNORE', $data);102 $data = @iconv($encoding, 'UTF-8//IGNORE', $data); 108 103 } else { 109 104 throw new Exception('Not implemented, please install mbstring or iconv'); … … 112 107 * One leading U+FEFF BYTE ORDER MARK character must be ignored if any are present. 113 108 */ 114 if ("" === \substr($data, 0, 3)) {115 $data = \substr($data, 3);109 if ("" === substr($data, 0, 3)) { 110 $data = substr($data, 3); 116 111 } 117 112 return $data; … … 132 127 * Any occurrences of such characters is a parse error. 133 128 */ 134 for ($i = 0, $count = \substr_count($data, "\x00"); $i < $count; ++$i) {129 for ($i = 0, $count = substr_count($data, "\x00"); $i < $count; ++$i) { 135 130 $errors[] = 'null-character'; 136 131 } … … 144 139 */ 145 140 // 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+007F141 $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 148 143 | 149 \ \xC2[\\x80-\\x9F] # U+0080 to U+009F144 \xC2[\x80-\x9F] # U+0080 to U+009F 150 145 | 151 \ \xED(?:\\xA0[\\x80-\\xFF]|[\\xA1-\\xBE][\\x00-\\xFF]|\\xBF[\\x00-\\xBF]) # U+D800 to U+DFFFF146 \xED(?:\xA0[\x80-\xFF]|[\xA1-\xBE][\x00-\xFF]|\xBF[\x00-\xBF]) # U+D800 to U+DFFFF 152 147 | 153 \ \xEF\\xB7[\\x90-\\xAF] # U+FDD0 to U+FDEF148 \xEF\xB7[\x90-\xAF] # U+FDD0 to U+FDEF 154 149 | 155 \ \xEF\\xBF[\\xBE\\xBF] # U+FFFE and U+FFFF150 \xEF\xBF[\xBE\xBF] # U+FFFE and U+FFFF 156 151 | 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}) 158 153 )/x', $data, $matches); 159 154 for ($i = 0; $i < $count; ++$i) { -
wp-typography/trunk/vendor-scoped/masterminds/html5/src/HTML5/Serializer/OutputRules.php
r2663994 r3208262 66 66 $this->outputMode = static::IM_IN_HTML; 67 67 $this->out = $output; 68 $this->hasHTML5 = \defined('ENT_HTML5');68 $this->hasHTML5 = defined('ENT_HTML5'); 69 69 } 70 70 public function addRule(array $rule) … … 178 178 } 179 179 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)) { 181 181 $this->wr(' ')->wr($nsNode->nodeName)->wr('="')->wr($nsNode->nodeValue)->wr('"'); 182 182 } … … 198 198 if ($this->outputMode == static::IM_IN_HTML) { 199 199 $this->wr('>'); 200 } else if ($ele->hasChildNodes()) { 201 $this->wr('>'); 200 202 } else { 201 if ($ele->hasChildNodes()) { 202 $this->wr('>'); 203 } else { 204 $this->wr(' />'); 205 } 203 $this->wr(' />'); 206 204 } 207 205 } … … 247 245 continue; 248 246 } 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)) { 259 257 continue; 260 258 } … … 304 302 protected function wr($text) 305 303 { 306 \fwrite($this->out, $text);304 fwrite($this->out, $text); 307 305 return $this; 308 306 } … … 314 312 protected function nl() 315 313 { 316 \fwrite($this->out, \PHP_EOL);314 fwrite($this->out, \PHP_EOL); 317 315 return $this; 318 316 } … … 353 351 // convert the named character references. 354 352 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); 356 354 } else { 357 return \strtr($text, HTML5Entities::$map);355 return strtr($text, HTML5Entities::$map); 358 356 } 359 357 } … … 385 383 $replace = array('<' => '<', '>' => '>', '&' => '&', " " => ' '); 386 384 } 387 return \strtr($text, $replace);385 return strtr($text, $replace); 388 386 } 389 387 } -
wp-typography/trunk/vendor-scoped/mundschenk-at/check-wp-requirements/README.md
r2663994 r3208262 1 1 # check-wp-requirements 2 2 3 [](https://travis-ci.com/mundschenk-at/check-wp-requirements)3  4 4 [](https://packagist.org/packages/mundschenk-at/check-wp-requirements) 5 [](https://scrutinizer-ci.com/g/mundschenk-at/check-wp-requirements/?branch=master) 6 [](https://scrutinizer-ci.com/g/mundschenk-at/check-wp-requirements/?branch=master) 5 [](https://sonarcloud.io/dashboard?id=mundschenk-at_check-wp-requirements) 7 6 [](https://packagist.org/packages/mundschenk-at/check-wp-requirements) 8 7 … … 11 10 ## Requirements 12 11 13 * PHP 5.6.0 or above12 * PHP 7.4.0 or above 14 13 * WordPress 5.2 or higher. 15 14 … … 40 39 41 40 $requirements = new \Mundschenk\WP_Requirements( 'Your Plugin Name', __FILE__, 'your-textdomain', [ 42 'php' => ' 5.6.0',41 'php' => '8.1.0', 43 42 'multibyte' => true, 44 43 'utf-8' => false, -
wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/IANA/tlds-alpha-by-domain.txt
r2852644 r3208262 1 # Version 202 3012200, Last Updated Sun Jan 22 07:07:02 2023UTC1 # Version 2024121500, Last Updated Sun Dec 15 07:07:01 2024 UTC 2 2 AAA 3 3 AARP 4 ABARTH5 4 ABB 6 5 ABBOTT … … 37 36 AKDN 38 37 AL 39 ALFAROMEO40 38 ALIBABA 41 39 ALIPAY … … 88 86 AUTO 89 87 AUTOS 90 AVIANCA91 88 AW 92 89 AWS … … 99 96 BAIDU 100 97 BANAMEX 101 BANANAREPUBLIC102 98 BAND 103 99 BANK … … 216 212 CBN 217 213 CBRE 218 CBS219 214 CC 220 215 CD … … 245 240 CITIC 246 241 CITY 247 CITYEATS248 242 CK 249 243 CL … … 266 260 COLOGNE 267 261 COM 268 COMCAST269 262 COMMBANK 270 263 COMMUNITY … … 279 272 CONTRACTORS 280 273 COOKING 281 COOKINGCHANNEL282 274 COOL 283 275 COOP … … 306 298 CYOU 307 299 CZ 308 DABUR309 300 DAD 310 301 DANCE … … 385 376 ESTATE 386 377 ET 387 ETISALAT388 378 EU 389 379 EUROVISION … … 411 401 FERRERO 412 402 FI 413 FIAT414 403 FIDELITY 415 404 FIDO … … 437 426 FOO 438 427 FOOD 439 FOODNETWORK440 428 FOOTBALL 441 429 FORD … … 450 438 FRL 451 439 FROGANS 452 FRONTDOOR453 440 FRONTIER 454 441 FTR … … 522 509 GT 523 510 GU 524 GUARDIAN525 511 GUCCI 526 512 GUGE … … 543 529 HERE 544 530 HERMES 545 HGTV546 531 HIPHOP 547 532 HISAMITSU … … 565 550 HOSTING 566 551 HOT 567 HOTELES568 552 HOTELS 569 553 HOTMAIL … … 653 637 KIDS 654 638 KIM 655 KINDER656 639 KINDLE 657 640 KITCHEN … … 678 661 LAMER 679 662 LANCASTER 680 LANCIA681 663 LAND 682 664 LANDROVER … … 709 691 LIMO 710 692 LINCOLN 711 LINDE712 693 LINK 713 694 LIPSY … … 740 721 LY 741 722 MA 742 MACYS743 723 MADRID 744 724 MAIF … … 754 734 MARRIOTT 755 735 MARSHALLS 756 MASERATI757 736 MATTEL 758 737 MBA … … 814 793 MUSEUM 815 794 MUSIC 816 MUTUAL817 795 MV 818 796 MW … … 824 802 NAGOYA 825 803 NAME 826 NATURA827 804 NAVY 828 805 NBA … … 855 832 NO 856 833 NOKIA 857 NORTHWESTERNMUTUAL858 834 NORTON 859 835 NOW … … 874 850 OLAYAN 875 851 OLAYANGROUP 876 OLDNAVY877 852 OLLO 878 853 OM … … 901 876 PARTS 902 877 PARTY 903 PASSAGENS904 878 PAY 905 879 PCCW … … 1002 976 RIP 1003 977 RO 1004 ROCHER1005 978 ROCKS 1006 979 RODEO … … 1037 1010 SBS 1038 1011 SC 1039 SCA1040 1012 SCB 1041 1013 SCHAEFFLER … … 1066 1038 SHANGRILA 1067 1039 SHARP 1068 SHAW1069 1040 SHELL 1070 1041 SHIA … … 1075 1046 SHOUJI 1076 1047 SHOW 1077 SHOWTIME1078 1048 SI 1079 1049 SILK … … 1173 1143 TICKETS 1174 1144 TIENDA 1175 TIFFANY1176 1145 TIPS 1177 1146 TIRES … … 1203 1172 TRAINING 1204 1173 TRAVEL 1205 TRAVELCHANNEL1206 1174 TRAVELERS 1207 1175 TRAVELERSINSURANCE … … 1258 1226 VN 1259 1227 VODKA 1260 VOLKSWAGEN1261 1228 VOLVO 1262 1229 VOTE … … 1265 1232 VOYAGE 1266 1233 VU 1267 VUELOS1268 1234 WALES 1269 1235 WALMART … … 1303 1269 XBOX 1304 1270 XEROX 1305 XFINITY1306 1271 XIHUAN 1307 1272 XIN … … 1394 1359 XN--MGBA3A4F16A 1395 1360 XN--MGBA7C0BBN0A 1396 XN--MGBAAKC7DVF1397 1361 XN--MGBAAM7A8H 1398 1362 XN--MGBAB2BD -
wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/class-dom.php
r2819294 r3208262 195 195 $func = Strings::functions($textnode->data); 196 196 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)); 198 198 } 199 199 } … … 392 392 * @since 4.2.0 393 393 */ 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); 395 395 /** 396 396 * Initialize block tags on load. -
wp-typography/trunk/vendor-scoped/mundschenk-at/php-typography/src/class-hyphenator.php
r2819294 r3208262 103 103 * @param array<string,string> $exceptions Optional. An array of words with all hyphenation points marked with a hard hyphen. Default empty array. 104 104 */ 105 public function set_custom_exceptions(array $exceptions = []) : void105 public function set_custom_exceptions(array $exceptions = []): void 106 106 { 107 107 if (empty($exceptions) && empty($this->custom_exceptions)) { … … 298 298 $value = $pattern_offset[0]; 299 299 $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; 301 301 } 302 302 } … … 308 308 * generates patterns for all of them. 309 309 */ 310 protected function merge_hyphenation_exceptions() : void310 protected function merge_hyphenation_exceptions(): void 311 311 { 312 312 $exceptions = []; 313 313 // Merge custom and language specific word hyphenations. 314 314 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); 316 316 } elseif (!empty($this->pattern_exceptions)) { 317 317 $exceptions = $this->pattern_exceptions; … … 378 378 * @since 3.4.0 379 379 */ 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 164 164 * @param bool $is_title A flag indicating whether the HTML fragment in the DOM is a title. 165 165 */ 166 private function process_textnodes_internal(\DOMNode $body_node, callable $fixer, Settings $settings, bool $is_title) : void166 private function process_textnodes_internal(\DOMNode $body_node, callable $fixer, Settings $settings, bool $is_title): void 167 167 { 168 168 // Get the list of tags that should be ignored. … … 393 393 * @param Hyphenator\Cache $cache A hyphenator cache instance. 394 394 */ 395 public function set_hyphenator_cache(Hyphenator\Cache $cache) : void395 public function set_hyphenator_cache(Hyphenator\Cache $cache): void 396 396 { 397 397 $this->hyphenator_cache = $cache; … … 424 424 if ('.json' === \substr($file, -5)) { 425 425 $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)) { 427 427 $language_name = \substr($matches[1], 1, -1); 428 428 $language_code = \substr($file, 0, -5); … … 476 476 * @author Peter Putzer <github@mundschenk.at> 477 477 */ 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 49 49 */ 50 50 const HTML_SPACES = ' 51 \ \x{00a0} # no-break space51 \x{00a0} # no-break space 52 52 | 53 \ \x{1361} # ethiopic wordspace53 \x{1361} # ethiopic wordspace 54 54 | 55 \ \x{2000} # en quad-space55 \x{2000} # en quad-space 56 56 | 57 \ \x{2001} # em quad-space57 \x{2001} # em quad-space 58 58 | 59 \ \x{2002} # en space59 \x{2002} # en space 60 60 | 61 \ \x{2003} # em space61 \x{2003} # em space 62 62 | 63 \ \x{2004} # three-per-em space63 \x{2004} # three-per-em space 64 64 | 65 \ \x{2005} # four-per-em space65 \x{2005} # four-per-em space 66 66 | 67 \ \x{2006} # six-per-em space67 \x{2006} # six-per-em space 68 68 | 69 \ \x{2007} # figure space69 \x{2007} # figure space 70 70 | 71 \ \x{2008} # punctuation space71 \x{2008} # punctuation space 72 72 | 73 \ \x{2009} # thin space73 \x{2009} # thin space 74 74 | 75 \ \x{200a} # hair space75 \x{200a} # hair space 76 76 | 77 \ \x{200b} # zero-width space77 \x{200b} # zero-width space 78 78 | 79 \ \x{200c} # zero-width joiner79 \x{200c} # zero-width joiner 80 80 | 81 \ \x{200d} # zero-width non-joiner81 \x{200d} # zero-width non-joiner 82 82 | 83 \ \x{202f} # narrow no-break space83 \x{202f} # narrow no-break space 84 84 | 85 \ \x{205f} # medium mathematical space85 \x{205f} # medium mathematical space 86 86 | 87 \ \x{3000} # ideographic space87 \x{3000} # ideographic space 88 88 '; 89 89 // required modifiers: x (multiline pattern) i (case insensitive) u (utf8). … … 152 152 public static function escape_tags($tags) 153 153 { 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); 155 155 } 156 156 /** … … 163 163 public static function unescape_tags($tags) 164 164 { 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); 166 166 } 167 167 } … … 171 171 * @since 5.0.0 172 172 */ 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 199 199 * @param mixed $value The settings value. 200 200 */ 201 public function __set($key, $value) : void201 public function __set($key, $value): void 202 202 { 203 203 $this->data[$key] = $value; … … 219 219 * @param string $key The settings key. 220 220 */ 221 public function __unset($key) : void221 public function __unset($key): void 222 222 { 223 223 unset($this->data[$key]); … … 229 229 * @param mixed $value The settings value. 230 230 */ 231 public function offsetSet($offset, $value) : void231 public function offsetSet($offset, $value): void 232 232 { 233 233 if (!empty($offset)) { … … 240 240 * @param string $offset The settings key. 241 241 */ 242 public function offsetExists($offset) : bool242 public function offsetExists($offset): bool 243 243 { 244 244 return isset($this->data[$offset]); … … 249 249 * @param string $offset The settings key. 250 250 */ 251 public function offsetUnset($offset) : void251 public function offsetUnset($offset): void 252 252 { 253 253 unset($this->data[$offset]); … … 283 283 * @param string $new_char The character to actually use. 284 284 */ 285 public function remap_character($char, $new_char) : void285 public function remap_character($char, $new_char): void 286 286 { 287 287 if ($char !== $new_char) { … … 371 371 * (Re)set various options to their default values. 372 372 */ 373 public function set_defaults() : void373 public function set_defaults(): void 374 374 { 375 375 // General attributes. … … 438 438 * @param bool $on Optional. Default false. 439 439 */ 440 public function set_ignore_parser_errors($on = \false) : void440 public function set_ignore_parser_errors($on = \false): void 441 441 { 442 442 $this->data[self::PARSER_ERRORS_IGNORE] = $on; … … 449 449 * @param callable|null $handler Optional. A callable that takes an array of error strings as its parameter. Default null. 450 450 */ 451 public function set_parser_errors_handler(callable $handler = null) : void451 public function set_parser_errors_handler(callable $handler = null): void 452 452 { 453 453 $this->data[self::PARSER_ERRORS_HANDLER] = $handler; … … 460 460 * @param bool $on Optional. Default false. 461 461 */ 462 public function set_true_no_break_narrow_space($on = \false) : void462 public function set_true_no_break_narrow_space($on = \false): void 463 463 { 464 464 if ($on) { … … 473 473 * @param string|string[] $tags A comma separated list or an array of tag names. 474 474 */ 475 public function set_tags_to_ignore($tags = ['code', 'head', 'kbd', 'object', 'option', 'pre', 'samp', 'script', 'noscript', 'noembed', 'select', 'style', 'textarea', 'title', 'var', 'math']) : void475 public function set_tags_to_ignore($tags = ['code', 'head', 'kbd', 'object', 'option', 'pre', 'samp', 'script', 'noscript', 'noembed', 'select', 'style', 'textarea', 'title', 'var', 'math']): void 476 476 { 477 477 // 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()))); 480 480 } 481 481 /** … … 484 484 * @param string|string[] $classes A comma separated list or an array of class names. 485 485 */ 486 public function set_classes_to_ignore($classes = ['vcard', 'noTypo']) : void486 public function set_classes_to_ignore($classes = ['vcard', 'noTypo']): void 487 487 { 488 488 $this->data[self::IGNORE_CLASSES] = Strings::maybe_split_parameters($classes); … … 493 493 * @param string|string[] $ids A comma separated list or an array of tag names. 494 494 */ 495 public function set_ids_to_ignore($ids = []) : void495 public function set_ids_to_ignore($ids = []): void 496 496 { 497 497 $this->data[self::IGNORE_IDS] = Strings::maybe_split_parameters($ids); … … 502 502 * @param bool $on Optional. Default true. 503 503 */ 504 public function set_smart_quotes($on = \true) : void504 public function set_smart_quotes($on = \true): void 505 505 { 506 506 $this->data[self::SMART_QUOTES] = $on; … … 530 530 * @throws \DomainException Thrown if $style constant is invalid. 531 531 */ 532 public function set_smart_quotes_primary($style = Quote_Style::DOUBLE_CURLED) : void532 public function set_smart_quotes_primary($style = Quote_Style::DOUBLE_CURLED): void 533 533 { 534 534 $this->primary_quote_style = $this->get_quote_style($style); … … 558 558 * @throws \DomainException Thrown if $style constant is invalid. 559 559 */ 560 public function set_smart_quotes_secondary($style = Quote_Style::SINGLE_CURLED) : void560 public function set_smart_quotes_secondary($style = Quote_Style::SINGLE_CURLED): void 561 561 { 562 562 $this->secondary_quote_style = $this->get_quote_style($style); … … 582 582 * Default a list of English words beginning with an apostrophy. 583 583 */ 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']) : void584 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 585 585 { 586 586 $this->data[self::SMART_QUOTES_EXCEPTIONS] = ['patterns' => \array_keys($exceptions), 'replacements' => \array_values($exceptions)]; … … 618 618 * @param bool $on Optional. Default true. 619 619 */ 620 public function set_smart_dashes($on = \true) : void620 public function set_smart_dashes($on = \true): void 621 621 { 622 622 $this->data[self::SMART_DASHES] = $on; … … 633 633 * @throws \DomainException Thrown if $style constant is invalid. 634 634 */ 635 public function set_smart_dashes_style($style = Dash_Style::TRADITIONAL_US) : void635 public function set_smart_dashes_style($style = Dash_Style::TRADITIONAL_US): void 636 636 { 637 637 $this->dash_style = $this->get_style($style, Settings\Dashes::class, [Dash_Style::class, 'get_styled_dashes'], 'dash'); … … 642 642 * @param bool $on Optional. Default true. 643 643 */ 644 public function set_smart_ellipses($on = \true) : void644 public function set_smart_ellipses($on = \true): void 645 645 { 646 646 $this->data[self::SMART_ELLIPSES] = $on; … … 651 651 * @param bool $on Optional. Default true. 652 652 */ 653 public function set_smart_diacritics($on = \true) : void653 public function set_smart_diacritics($on = \true): void 654 654 { 655 655 $this->data[self::SMART_DIACRITICS] = $on; … … 660 660 * @param string $lang Has to correspond to a filename in 'diacritics'. Optional. Default 'en-US'. 661 661 */ 662 public function set_diacritic_language($lang = 'en-US') : void662 public function set_diacritic_language($lang = 'en-US'): void 663 663 { 664 664 if (isset($this->data[self::DIACRITIC_LANGUAGE]) && $this->data[self::DIACRITIC_LANGUAGE] === $lang) { … … 684 684 * or a string formatted `"needle"=>"replacement","needle"=>"replacement",... 685 685 */ 686 public function set_diacritic_custom_replacements($custom_replacements = []) : void686 public function set_diacritic_custom_replacements($custom_replacements = []): void 687 687 { 688 688 if (!\is_array($custom_replacements)) { … … 711 711 foreach (\preg_split('/,/', $custom_replacements, -1, \PREG_SPLIT_NO_EMPTY) ?: [] as $replacement) { 712 712 // 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)) { 714 714 $replacements[$match['key']] = $match['replacement']; 715 715 } … … 732 732 * @return array<T> 733 733 */ 734 protected static function array_map_assoc(callable $callback, array $array) : array734 protected static function array_map_assoc(callable $callback, array $array): array 735 735 { 736 736 $new = []; … … 749 749 * when the custom replacements are updated. 750 750 */ 751 private function update_diacritics_replacement_arrays() : void751 private function update_diacritics_replacement_arrays(): void 752 752 { 753 753 $patterns = []; … … 768 768 * @param array<string,string> $replacements Resulting replacements. Passed by reference. 769 769 */ 770 private function parse_diacritics_rules(array $diacritics_rules, array &$patterns, array &$replacements) : void770 private function parse_diacritics_rules(array $diacritics_rules, array &$patterns, array &$replacements): void 771 771 { 772 772 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'; 774 774 $replacements[$needle] = $replacement; 775 775 } … … 780 780 * @param bool $on Optional. Default true. 781 781 */ 782 public function set_smart_marks($on = \true) : void782 public function set_smart_marks($on = \true): void 783 783 { 784 784 $this->data[self::SMART_MARKS] = $on; … … 789 789 * @param bool $on Optional. Default true. 790 790 */ 791 public function set_smart_math($on = \true) : void791 public function set_smart_math($on = \true): void 792 792 { 793 793 $this->data[self::SMART_MATH] = $on; … … 798 798 * @param bool $on Optional. Default true. 799 799 */ 800 public function set_smart_exponents($on = \true) : void800 public function set_smart_exponents($on = \true): void 801 801 { 802 802 $this->data[self::SMART_EXPONENTS] = $on; … … 807 807 * @param bool $on Optional. Default true. 808 808 */ 809 public function set_smart_fractions($on = \true) : void809 public function set_smart_fractions($on = \true): void 810 810 { 811 811 $this->data[self::SMART_FRACTIONS] = $on; … … 816 816 * @param bool $on Optional. Default true. 817 817 */ 818 public function set_smart_ordinal_suffix($on = \true) : void818 public function set_smart_ordinal_suffix($on = \true): void 819 819 { 820 820 $this->data[self::SMART_ORDINAL_SUFFIX] = $on; … … 827 827 * @param bool $on Optional. Default false. 828 828 */ 829 public function set_smart_ordinal_suffix_match_roman_numerals($on = \false) : void829 public function set_smart_ordinal_suffix_match_roman_numerals($on = \false): void 830 830 { 831 831 $this->data[self::SMART_ORDINAL_SUFFIX_ROMAN_NUMERALS] = $on; … … 836 836 * @param bool $on Optional. Default true. 837 837 */ 838 public function set_smart_area_units($on = \true) : void838 public function set_smart_area_units($on = \true): void 839 839 { 840 840 $this->data[self::SMART_AREA_UNITS] = $on; … … 845 845 * @param bool $on Optional. Default true. 846 846 */ 847 public function set_single_character_word_spacing($on = \true) : void847 public function set_single_character_word_spacing($on = \true): void 848 848 { 849 849 $this->data[self::SINGLE_CHARACTER_WORD_SPACING] = $on; … … 854 854 * @param bool $on Optional. Default true. 855 855 */ 856 public function set_fraction_spacing($on = \true) : void856 public function set_fraction_spacing($on = \true): void 857 857 { 858 858 $this->data[self::FRACTION_SPACING] = $on; … … 863 863 * @param bool $on Optional. Default true. 864 864 */ 865 public function set_unit_spacing($on = \true) : void865 public function set_unit_spacing($on = \true): void 866 866 { 867 867 $this->data[self::UNIT_SPACING] = $on; … … 872 872 * @param bool $on Optional. Default true. 873 873 */ 874 public function set_numbered_abbreviation_spacing($on = \true) : void874 public function set_numbered_abbreviation_spacing($on = \true): void 875 875 { 876 876 $this->data[self::NUMBERED_ABBREVIATION_SPACING] = $on; … … 883 883 * @param bool $on Optional. Default false. 884 884 */ 885 public function set_french_punctuation_spacing($on = \false) : void885 public function set_french_punctuation_spacing($on = \false): void 886 886 { 887 887 $this->data[self::FRENCH_PUNCTUATION_SPACING] = $on; … … 892 892 * @param string|string[] $units A comma separated list or an array of units. 893 893 */ 894 public function set_units($units = []) : void894 public function set_units($units = []): void 895 895 { 896 896 $this->data[self::UNITS] = Strings::maybe_split_parameters($units); … … 921 921 * @param bool $on Optional. Default true. 922 922 */ 923 public function set_dash_spacing($on = \true) : void923 public function set_dash_spacing($on = \true): void 924 924 { 925 925 $this->data[self::DASH_SPACING] = $on; … … 930 930 * @param bool $on Optional. Default true. 931 931 */ 932 public function set_space_collapse($on = \true) : void932 public function set_space_collapse($on = \true): void 933 933 { 934 934 $this->data[self::SPACE_COLLAPSE] = $on; … … 939 939 * @param bool $on Optional. Default true. 940 940 */ 941 public function set_dewidow($on = \true) : void941 public function set_dewidow($on = \true): void 942 942 { 943 943 $this->data[self::DEWIDOW] = $on; … … 948 948 * @param int $length Defaults to 5. Trying to set the value to less than 2 resets the length to the default. 949 949 */ 950 public function set_max_dewidow_length($length = 5) : void950 public function set_max_dewidow_length($length = 5): void 951 951 { 952 952 $length = $length > 1 ? $length : 5; … … 958 958 * @param int $number Defaults to 1. Only 1, 2 and 3 are valid. 959 959 */ 960 public function set_dewidow_word_number($number = 1) : void960 public function set_dewidow_word_number($number = 1): void 961 961 { 962 962 $number = $number > 3 || $number < 1 ? 1 : $number; … … 968 968 * @param int $length Defaults to 5. Trying to set the value to less than 2 resets the length to the default. 969 969 */ 970 public function set_max_dewidow_pull($length = 5) : void970 public function set_max_dewidow_pull($length = 5): void 971 971 { 972 972 $length = $length > 1 ? $length : 5; … … 978 978 * @param bool $on Optional. Default true. 979 979 */ 980 public function set_wrap_hard_hyphens($on = \true) : void980 public function set_wrap_hard_hyphens($on = \true): void 981 981 { 982 982 $this->data[self::HYPHEN_HARD_WRAP] = $on; … … 987 987 * @param bool $on Optional. Default true. 988 988 */ 989 public function set_url_wrap($on = \true) : void989 public function set_url_wrap($on = \true): void 990 990 { 991 991 $this->data[self::URL_WRAP] = $on; … … 996 996 * @param bool $on Optional. Default true. 997 997 */ 998 public function set_email_wrap($on = \true) : void998 public function set_email_wrap($on = \true): void 999 999 { 1000 1000 $this->data[self::EMAIL_WRAP] = $on; … … 1005 1005 * @param int $length Defaults to 5. Trying to set the value to less than 1 resets the length to the default. 1006 1006 */ 1007 public function set_min_after_url_wrap($length = 5) : void1007 public function set_min_after_url_wrap($length = 5): void 1008 1008 { 1009 1009 $length = $length > 0 ? $length : 5; … … 1015 1015 * @param bool $on Optional. Default true. 1016 1016 */ 1017 public function set_style_ampersands($on = \true) : void1017 public function set_style_ampersands($on = \true): void 1018 1018 { 1019 1019 $this->data[self::STYLE_AMPERSANDS] = $on; … … 1024 1024 * @param bool $on Optional. Default true. 1025 1025 */ 1026 public function set_style_caps($on = \true) : void1026 public function set_style_caps($on = \true): void 1027 1027 { 1028 1028 $this->data[self::STYLE_CAPS] = $on; … … 1033 1033 * @param bool $on Optional. Default true. 1034 1034 */ 1035 public function set_style_initial_quotes($on = \true) : void1035 public function set_style_initial_quotes($on = \true): void 1036 1036 { 1037 1037 $this->data[self::STYLE_INITIAL_QUOTES] = $on; … … 1042 1042 * @param bool $on Optional. Default true. 1043 1043 */ 1044 public function set_style_numbers($on = \true) : void1044 public function set_style_numbers($on = \true): void 1045 1045 { 1046 1046 $this->data[self::STYLE_NUMBERS] = $on; … … 1051 1051 * @param bool $on Optional. Default true. 1052 1052 */ 1053 public function set_style_hanging_punctuation($on = \true) : void1053 public function set_style_hanging_punctuation($on = \true): void 1054 1054 { 1055 1055 $this->data[self::STYLE_HANGING_PUNCTUATION] = $on; … … 1060 1060 * @param string|string[] $tags A comma separated list or an array of tag names. 1061 1061 */ 1062 public function set_initial_quote_tags($tags = ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'li', 'dd', 'dt']) : void1062 public function set_initial_quote_tags($tags = ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'li', 'dd', 'dt']): void 1063 1063 { 1064 1064 // Make array if handed a list of tags as a string. … … 1075 1075 * @param bool $on Optional. Default true. 1076 1076 */ 1077 public function set_hyphenation($on = \true) : void1077 public function set_hyphenation($on = \true): void 1078 1078 { 1079 1079 $this->data[self::HYPHENATION] = $on; … … 1084 1084 * @param string $lang Has to correspond to a filename in 'lang'. Optional. Default 'en-US'. 1085 1085 */ 1086 public function set_hyphenation_language($lang = 'en-US') : void1086 public function set_hyphenation_language($lang = 'en-US'): void 1087 1087 { 1088 1088 if (isset($this->data[self::HYPHENATION_LANGUAGE]) && $this->data[self::HYPHENATION_LANGUAGE] === $lang) { … … 1097 1097 * @param int $length Defaults to 5. Trying to set the value to less than 2 resets the length to the default. 1098 1098 */ 1099 public function set_min_length_hyphenation($length = 5) : void1099 public function set_min_length_hyphenation($length = 5): void 1100 1100 { 1101 1101 $length = $length > 1 ? $length : 5; … … 1107 1107 * @param int $length Defaults to 3. Trying to set the value to less than 1 resets the length to the default. 1108 1108 */ 1109 public function set_min_before_hyphenation($length = 3) : void1109 public function set_min_before_hyphenation($length = 3): void 1110 1110 { 1111 1111 $length = $length > 0 ? $length : 3; … … 1117 1117 * @param int $length Defaults to 2. Trying to set the value to less than 1 resets the length to the default. 1118 1118 */ 1119 public function set_min_after_hyphenation($length = 2) : void1119 public function set_min_after_hyphenation($length = 2): void 1120 1120 { 1121 1121 $length = $length > 0 ? $length : 2; … … 1127 1127 * @param bool $on Optional. Default true. 1128 1128 */ 1129 public function set_hyphenate_headings($on = \true) : void1129 public function set_hyphenate_headings($on = \true): void 1130 1130 { 1131 1131 $this->data[self::HYPHENATE_HEADINGS] = $on; … … 1136 1136 * @param bool $on Optional. Default true. 1137 1137 */ 1138 public function set_hyphenate_all_caps($on = \true) : void1138 public function set_hyphenate_all_caps($on = \true): void 1139 1139 { 1140 1140 $this->data[self::HYPHENATE_ALL_CAPS] = $on; … … 1145 1145 * @param bool $on Optional. Default true. 1146 1146 */ 1147 public function set_hyphenate_title_case($on = \true) : void1147 public function set_hyphenate_title_case($on = \true): void 1148 1148 { 1149 1149 $this->data[self::HYPHENATE_TITLE_CASE] = $on; … … 1154 1154 * @param bool $on Optional. Default true. 1155 1155 */ 1156 public function set_hyphenate_compounds($on = \true) : void1156 public function set_hyphenate_compounds($on = \true): void 1157 1157 { 1158 1158 $this->data[self::HYPHENATE_COMPOUNDS] = $on; … … 1164 1164 * In the latter case, only alphanumeric characters and hyphens are recognized. The default is empty. 1165 1165 */ 1166 public function set_hyphenation_exceptions($exceptions = []) : void1166 public function set_hyphenation_exceptions($exceptions = []): void 1167 1167 { 1168 1168 $this->data[self::HYPHENATION_CUSTOM_EXCEPTIONS] = Strings::maybe_split_parameters($exceptions); … … 1197 1197 * @implements \ArrayAccess<string,mixed> 1198 1198 */ 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 51 51 * @var string 52 52 */ 53 const RE_PARAMETER_SPLITTING = '/[\ \s,]+/S';53 const RE_PARAMETER_SPLITTING = '/[\s,]+/S'; 54 54 /** 55 55 * An array of encodings in detection order. … … 131 131 $json = '"'; 132 132 foreach ($codes as $code) { 133 $json .= \sprintf('\ \u%04x', $code);133 $json .= \sprintf('\u%04x', $code); 134 134 } 135 135 $json .= '"'; … … 167 167 * } 168 168 */ 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 71 71 | 72 72 (?: # decimal matches 73 &\ \#73 &\# 74 74 (?: 09|1[03]|32|160|4961|5760|819[2-9]|820[0-2]|8239|8287|12288 ) 75 75 ; … … 77 77 | 78 78 (?: # hexidecimal matches 79 &\ \#x79 &\#x 80 80 (?: 000[9ad]|0020|00a0|1361|1680|200[0-9a]|202f|205f|3000 ) 81 81 ; … … 83 83 | 84 84 (?: # 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} 87 87 ) 88 88 ) 89 89 '; 90 90 // 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 . ')+'; 92 92 // required modifiers: x (multiline pattern) i (case insensitive) $utf8. 93 93 /** … … 115 115 | 116 116 (?: # decimal matches 117 &\ \#117 &\# 118 118 (?: 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] ) 119 119 ; … … 121 121 | 122 122 (?: # hexidecimal matches 123 &\ \#x123 &\#x 124 124 (?: 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] ) 125 125 ; … … 131 131 (?: 132 132 (?: 133 [^\ \w\\s\\&\\/\\@] # assume characters that are not word spaces or whitespace are punctuation133 [^\w\s\&\/\@] # assume characters that are not word spaces or whitespace are punctuation 134 134 # 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 URL135 # exclude slash \/as to not include the last slash in a URL 136 136 # exclude @ as to keep twitter names together 137 137 | … … 158 158 | 159 159 (?: # decimal matches 160 &\ \#160 &\# 161 161 (?: 45|95|173|820[3-589]|8210 ) 162 162 ; … … 164 164 | 165 165 (?: # hexidecimal matches 166 &\ \#x166 &\#x 167 167 (?: 002d|005f|00ad|200[b-d]|201[0-2] ) 168 168 ; … … 170 170 | 171 171 (?: # 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} 173 173 ) 174 174 ) … … 190 190 | 191 191 (?: # decimal matches 192 &\ \#192 &\# 193 193 (?: 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] ) 194 194 ; … … 197 197 (?: # hexidecimal matches 198 198 (?: 199 &\ \#x00199 &\#x00 200 200 (?: 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] ) 201 201 ; … … 203 203 | 204 204 (?: 205 &\ \#x01[0-7][0-9a-f];205 &\#x01[0-7][0-9a-f]; 206 206 ) 207 207 ) 208 208 | 209 209 (?: # 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} 228 228 ) 229 229 ) … … 232 232 private const WORD = ' 233 233 (?: 234 (?<![\ \w\\&]) # negative lookbehind to ensure234 (?<![\w\&]) # negative lookbehind to ensure 235 235 # 1) we are proceeded by a non-word-character, and 236 236 # 2) we are not inside an HTML character def 237 237 (?: 238 [\ \w\\-\\_\\/]238 [\w\-\_\/] 239 239 | 240 240 ' . self::HTML_LETTERS . ' … … 250 250 // Regular expressions. 251 251 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'; 257 257 /** 258 258 * The current strtoupper function to use (either 'strtoupper' or 'mb_strtoupper'). … … 338 338 * @param int $index The current index. Passed by reference. 339 339 */ 340 protected static function parse_ambiguous_token($expected_type, $part, array &$tokens, &$index) : void340 protected static function parse_ambiguous_token($expected_type, $part, array &$tokens, &$index): void 341 341 { 342 342 // Make sure that things like email addresses and URLs are not broken up incorrectly. … … 413 413 * Clears the currently set text from the parser. 414 414 */ 415 public function clear() : void415 public function clear(): void 416 416 { 417 417 $this->text = []; … … 422 422 * @param Token[] $tokens An array of tokens. 423 423 */ 424 public function update($tokens) : void424 public function update($tokens): void 425 425 { 426 426 foreach ($tokens as $index => $token) { … … 574 574 * If multibyte characters are passed, they must be encoded as UTF-8. 575 575 */ 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 86 86 * @since 5.0.0 87 87 */ 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 66 66 $arguments = []; 67 67 if (!empty($params['classes'])) { 68 $arguments += \array_map(function ($index) use ($css_classes) {68 $arguments += \array_map(function ($index) use ($css_classes) { 69 69 return $css_classes[$index]; 70 70 }, $params['classes']); … … 164 164 * @since 6.0.0 165 165 */ 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 61 61 * @since 5.0.0 62 62 */ 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 87 87 * @throws \InvalidArgumentException Group is invalid. 88 88 */ 89 public function register_node_fix(Node_Fix $fix, $group) : void89 public function register_node_fix(Node_Fix $fix, $group): void 90 90 { 91 91 if (isset($this->node_fixes[$group])) { … … 100 100 * @param Token_Fix $fix Required. 101 101 */ 102 public function register_token_fix(Token_Fix $fix) : void102 public function register_token_fix(Token_Fix $fix): void 103 103 { 104 104 $this->process_words_fix->register_token_fix($fix); … … 109 109 * @param Cache $cache A hyphenator cache instance. 110 110 */ 111 public function update_hyphenator_cache(Cache $cache) : void111 public function update_hyphenator_cache(Cache $cache): void 112 112 { 113 113 $this->process_words_fix->update_hyphenator_cache($cache); … … 121 121 * @param bool $is_feed Check for feed compatibility if true. 122 122 */ 123 public function apply_fixes(\DOMText $textnode, Settings $settings, $is_title, $is_feed) : void123 public function apply_fixes(\DOMText $textnode, Settings $settings, $is_title, $is_feed): void 124 124 { 125 125 foreach ($this->node_fixes as $fix_group) { … … 139 139 * @since 6.0.0 140 140 */ 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 73 73 * @since 5.0.0 74 74 */ 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 63 63 * @return void 64 64 */ 65 public abstractfunction apply(\DOMText $textnode, Settings $settings, $is_title = \false);65 abstract public function apply(\DOMText $textnode, Settings $settings, $is_title = \false); 66 66 /** 67 67 * Determines whether the fix should be applied to (RSS) feeds. … … 109 109 * @since 5.0.0 110 110 */ 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 53 53 { 54 54 parent::__construct($feed_compatible); 55 if (! \is_array($classes)) {55 if (!is_array($classes)) { 56 56 $classes = [$classes]; 57 57 } … … 84 84 * @return void 85 85 */ 86 protected abstractfunction apply_internal(\DOMText $textnode, Settings $settings, $is_title = \false);86 abstract protected function apply_internal(\DOMText $textnode, Settings $settings, $is_title = \false); 87 87 } 88 88 /** … … 93 93 * @since 5.0.0 94 94 */ 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 43 43 const EM_DASH_SPACING = '/ 44 44 (?: 45 \ \s45 \s 46 46 (' . U::EM_DASH . ') 47 \ \s47 \s 48 48 ) 49 49 | 50 50 (?: 51 (?<=\ \S) # lookbehind assertion51 (?<=\S) # lookbehind assertion 52 52 (' . U::EM_DASH . ') 53 (?=\ \S) # lookahead assertion53 (?=\S) # lookahead assertion 54 54 ) 55 55 /xu'; … … 125 125 * @param string $interval_space The space character used around interval dashes. 126 126 */ 127 private function update_dash_spacing_regex($parenthetical, $parenthetical_space, $interval, $interval_space) : void127 private function update_dash_spacing_regex($parenthetical, $parenthetical_space, $interval, $interval_space): void 128 128 { 129 129 // Mandatory UTF-8 modifier. … … 144 144 * @since 5.0.0 145 145 */ 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 42 42 class Dewidow_Fix extends Abstract_Node_Fix 43 43 { 44 const SPACE_BETWEEN = '[\ \s]+';44 const SPACE_BETWEEN = '[\s]+'; 45 45 // \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 . ']+?'; 47 47 // \w includes all alphanumeric Unicode characters but not composed characters. 48 48 // Mandatory UTF-8 modifer. 49 49 const REGEX_START = '/ 50 50 (?: 51 \ \A51 \A 52 52 | 53 53 (?: 54 54 (?<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 . ']+ 56 56 ) 57 57 (?<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 . ']+? 59 59 ) 60 60 ) … … 71 71 const REGEX_END = '}) 72 72 (?<trailing> # subpattern 5: any trailing punctuation or spaces 73 [^\ \w\\p{M}]*73 [^\w\p{M}]* 74 74 ) 75 \ \Z75 \Z 76 76 /Sxu'; 77 77 const MASKED_NARROW_SPACE = '__NO_BREAK_NARROW_SPACE__'; … … 116 116 } 117 117 // 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) { 119 119 // If we are here, we know that widows are being protected in some fashion 120 120 // with that, we will assert that widows should never be hyphenated or wrapped … … 166 166 protected static function make_space_nonbreaking($string, $deprecated, $u) 167 167 { 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); 169 169 } 170 170 } … … 176 176 * @since 5.0.0 177 177 */ 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 47 47 { 48 48 // 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'; 53 53 /** 54 54 * Apply the fix to a given textnode. … … 95 95 * @since 5.0.0 96 96 */ 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 42 42 class Numbered_Abbreviation_Spacing_Fix extends Simple_Regex_Replacement_Fix 43 43 { 44 private const ISO = 'ISO(?:\ \/(?:IEC|TR|TS))?';44 private const ISO = 'ISO(?:\/(?:IEC|TR|TS))?'; 45 45 private const ABBREVIATIONS = ' 46 46 ### Internationl standards … … 53 53 DIN[ ]' . self::ISO . '| 54 54 DIN[ ]IEC| 55 DIN[ ]CEN\ \/TS|56 DIN[ ]CLC\ \/TS|55 DIN[ ]CEN\/TS| 56 DIN[ ]CLC\/TS| 57 57 DIN[ ]CWA| 58 58 DIN[ ]VDE| … … 73 73 // required modifiers: x (multiline pattern). 74 74 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'; 76 76 /** 77 77 * Creates a new fix object. … … 93 93 * @since 5.0.0 94 94 */ 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 112 112 * @param Token_Fix $fix Required. 113 113 */ 114 public function register_token_fix(Token_Fix $fix) : void114 public function register_token_fix(Token_Fix $fix): void 115 115 { 116 116 $this->token_fixes[] = $fix; … … 121 121 * @param Cache $cache A hyphenator cache instance. 122 122 */ 123 public function update_hyphenator_cache(Cache $cache) : void123 public function update_hyphenator_cache(Cache $cache): void 124 124 { 125 125 foreach ($this->token_fixes as $fix) { … … 143 143 * @since 5.0.0 144 144 */ 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 96 96 * @since 5.0.0 97 97 */ 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 97 97 * @since 5.0.0 98 98 */ 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 44 44 const REGEX = '/ 45 45 (?: 46 (\ \s)47 (\ \w|&)46 (\s) 47 (\w|&) 48 48 [' . RE::NORMAL_SPACES . '] 49 (?=\ \w)49 (?=\w) 50 50 ) 51 51 /x'; … … 85 85 * @since 6.0.0 The replacement now assumes decoded ampersands (i.e. plain "&" instead of "&"). 86 86 */ 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 41 41 const LENGTH_UNITS = '(?:p|µ|[mcdhkMGT])?m'; 42 42 // 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'; 47 47 /** 48 48 * Apply the fix to a given textnode. … … 67 67 * @since 5.0.0 68 68 */ 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 42 42 { 43 43 // 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'; 45 45 // ' -- '. 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'; 47 47 // ' - '. 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'; 49 49 const EN_DASH_NUMBERS = "/(\\b\\d+(\\.?))\\-(\\d+\\2)/S"; 50 50 const EN_DASH_PHONE_NUMBERS = "/(\\b\\d{3})" . U::EN_DASH . "(\\d{4}\\b)/S"; … … 53 53 const DATE_YYYY_MM_DD = '/ 54 54 ( 55 (?<=\ \s|\\A|' . U::NO_BREAK_SPACE . ')55 (?<=\s|\A|' . U::NO_BREAK_SPACE . ') 56 56 [12][0-9]{3} 57 57 ) 58 [\ \-' . U::EN_DASH . ']58 [\-' . U::EN_DASH . '] 59 59 ( 60 60 (?:[0][1-9]|[1][0-2]) 61 61 ) 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 . ') 63 63 ) 64 64 /xu'; … … 67 67 (?: 68 68 ( 69 (?<=\ \s|\\A|' . U::NO_BREAK_SPACE . ')69 (?<=\s|\A|' . U::NO_BREAK_SPACE . ') 70 70 (?:[0]?[1-9]|[1][0-2]) 71 71 ) 72 [\ \-' . U::EN_DASH . ']72 [\-' . U::EN_DASH . '] 73 73 ( 74 74 (?:[0]?[1-9]|[12][0-9]|[3][0-1]) … … 78 78 (?: 79 79 ( 80 (?<=\ \s|\\A|' . U::NO_BREAK_SPACE . ')80 (?<=\s|\A|' . U::NO_BREAK_SPACE . ') 81 81 (?:[0]?[1-9]|[12][0-9]|[3][0-1]) 82 82 ) 83 [\ \-' . U::EN_DASH . ']83 [\-' . U::EN_DASH . '] 84 84 ( 85 85 (?:[0]?[1-9]|[1][0-2]) … … 87 87 ) 88 88 ) 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 . ') 90 90 ) 91 91 /xu'; 92 92 const DATE_YYYY_MM = '/ 93 93 ( 94 (?<=\ \s|\\A|' . U::NO_BREAK_SPACE . ')94 (?<=\s|\A|' . U::NO_BREAK_SPACE . ') 95 95 [12][0-9]{3} 96 96 ) 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 . ') 98 98 ) 99 99 /xu'; … … 139 139 * @since 5.0.0 140 140 */ 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 54 54 // Uses "word" => "replacement" pairs from an array to make fast preg_* replacements. 55 55 $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) { 57 57 if (isset($replacements[$match[0]])) { 58 58 return $replacements[$match[0]]; … … 71 71 * @since 5.0.0 72 72 */ 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 66 66 * @since 5.0.0 67 67 */ 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 48 48 public function __construct($feed_compatible = \false) 49 49 { 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); 51 51 } 52 52 } … … 59 59 * @since 5.0.0 60 60 */ 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 43 43 class Smart_Fractions_Fix extends Abstract_Node_Fix 44 44 { 45 const SPACING = '/\ \b(\\d+)\\s(\\d+\\s?\\/\\s?\\d+)\\b/';45 const SPACING = '/\b(\d+)\s(\d+\s?\/\s?\d+)\b/'; 46 46 const FRACTION_MATCHING = '/ 47 47 # 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 . ') 49 49 50 (\ \d+)50 (\d+) 51 51 52 52 # 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 . '?) 54 54 55 55 ( … … 57 57 (?: 58 58 # ignore x:x where x > 1 59 (?!\ \1(?:[^0-9]|\\Z)) |59 (?!\1(?:[^0-9]|\Z)) | 60 60 61 61 # but allow 1:1 62 (?=\ \1)(?=1(?:[^0-9]|\\Z))62 (?=\1)(?=1(?:[^0-9]|\Z)) 63 63 ) 64 64 65 65 # Any numbers, except those above 66 \ \d+66 \d+ 67 67 ) 68 68 ( … … 71 71 72 72 # handle ordinals after fractions 73 (?:\ \<sup\\>(?:st|nd|rd|th)<\\/sup\\>)?73 (?:\<sup\>(?:st|nd|rd|th)<\/sup\>)? 74 74 75 75 # 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 . '|\.|,|\!|\?|\)|\;|\:|\'|") 77 77 ) 78 78 /Sxu'; 79 79 const ESCAPE_DATE_MM_YYYY = '/ 80 80 # capture valid one- or two-digit months 81 ( \ \b (?: 0?[1-9] | 1[0-2] ) )81 ( \b (?: 0?[1-9] | 1[0-2] ) ) 82 82 83 83 # capture any zero-width spaces inserted by wrap_hard_hyphens 84 (\ \s?\\/\\s?' . U::ZERO_WIDTH_SPACE . '?)84 (\s?\/\s?' . U::ZERO_WIDTH_SPACE . '?) 85 85 86 86 # handle 4-decimal years 87 ( [12][0-9]{3}\ \b )87 ( [12][0-9]{3}\b ) 88 88 89 89 /Sxu'; … … 115 115 $year_regex[] = "(?: ( {$year} ) (\\s?\\/\\s?" . U::ZERO_WIDTH_SPACE . '?) ( ' . ($year + 1) . ' ) )'; 116 116 } 117 $this->escape_consecutive_years = '/\ \b (?| ' . \implode('|', $year_regex) . ' ) \\b/Sxu';117 $this->escape_consecutive_years = '/\b (?| ' . implode('|', $year_regex) . ' ) \b/Sxu'; 118 118 // Replace fractions. 119 119 $numerator_css = empty($css_numerator) ? '' : ' class="' . $css_numerator . '"'; … … 165 165 * @since 5.0.0 166 166 */ 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 39 39 class Smart_Marks_Fix extends Abstract_Node_Fix 40 40 { 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'; 42 42 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]; 43 43 /** … … 97 97 * @since 5.0.0 98 98 */ 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 40 40 { 41 41 // Lookbehind assertion: preceded by beginning of string or space. 42 const INITIAL_LOOKBEHIND = '(?<=\ \s|\\A)';42 const INITIAL_LOOKBEHIND = '(?<=\s|\A)'; 43 43 // Needs u modifier. 44 44 // 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|\)|\]|\.|\,|\?|\;|\:|\'|\"|\!)'; 46 46 // Needs u modifier. 47 47 // Common date components. … … 54 54 const YEAR_2_OR_4_DIGITS = '(?:' . self::YEAR_2_DIGITS . '|' . self::YEAR_4_DIGITS . ')'; 55 55 // Maths components. 56 const DECIMAL_SEPARATOR = '[\ \.,]';56 const DECIMAL_SEPARATOR = '[\.,]'; 57 57 const DECIMAL_NUMBER = '[0-9]+(?:' . self::DECIMAL_SEPARATOR . '[0-9]+)?'; 58 58 // First, let's find math equations. 59 59 const MATH_EQUATION = '/ 60 60 ' . 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 . ']* 62 62 # allowed preceding punctuation 63 [\ \-\\(' . U::MINUS . ']* # optionally preceded by dash, minus sign or open parenthesis63 [\-\(' . U::MINUS . ']* # optionally preceded by dash, minus sign or open parenthesis 64 64 ' . self::DECIMAL_NUMBER . ' # must begin with a number, optional decimal values after first integer 65 65 ( # followed by a math symbol and a number 66 [\ \/\\*x\\-+=\\^' . U::MINUS . U::MULTIPLICATION . U::DIVISION . ']66 [\/\*x\-+=\^' . U::MINUS . U::MULTIPLICATION . U::DIVISION . '] 67 67 # allowed math symbols 68 [\ \-\\(' . U::MINUS . ']* # optionally preceded by dash, minus sign or open parenthesis68 [\-\(' . U::MINUS . ']* # optionally preceded by dash, minus sign or open parenthesis 69 69 ' . self::DECIMAL_NUMBER . ' # must begin with a number, optional decimal values after first integer 70 [\ \-\\(\\)' . U::MINUS . ']* # optionally followed by dash, minus sign or parenthesis70 [\-\(\)' . U::MINUS . ']* # optionally followed by dash, minus sign or parenthesis 71 71 )+ 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 . ']* 73 73 # allowed trailing punctuation 74 (?=\ \Z|\\s) # lookahead assertion: followed by end of string or space74 (?=\Z|\s) # lookahead assertion: followed by end of string or space 75 75 /Sxu'; 76 76 // Revert 4-4 to plain minus-hyphen so as to not mess with ranges of numbers (i.e. pp. 46-50). … … 78 78 ' . self::INITIAL_LOOKBEHIND . ' 79 79 80 (\ \d+)' . U::MINUS . '(\\d+)80 (\d+)' . U::MINUS . '(\d+) 81 81 82 82 ' . self::FINAL_LOOKAHEAD . ' # lookahead assertion: most punctuation marks are allowd … … 86 86 const REVERT_FRACTION = "/\n\t\t(?<=\\s|\\A|\\'|\"|" . U::NO_BREAK_SPACE . ') 87 87 ( 88 \ \d+88 \d+ 89 89 ) 90 90 ' . U::DIVISION . ' 91 91 ( 92 \ \d+92 \d+ 93 93 (?:st|nd|rd|th)? 94 94 ) … … 200 200 * @since 5.0.0 201 201 */ 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 49 49 // Ordinals with arabic numerals. 50 50 const RE_ARABIC_ORDINALS = '/' . self::WORD_BOUNDARY_START . ' 51 (\ \d+)51 (\d+) 52 52 (' . self::ENGLISH_SUFFIXES . '|' . self::FRENCH_SUFFIXES . '|' . self::LATIN_SUFFIXES . ' 53 53 )' . self::WORD_BOUNDARY_END . ' … … 68 68 const ROMAN_NUMERALS = '[MDCLXVI]'; 69 69 // 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 . '])'; 72 72 /** 73 73 * The replacement expression (depends on CSS class). … … 118 118 * @since 5.0.0 119 119 */ 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 42 42 class Smart_Quotes_Fix extends Abstract_Node_Fix 43 43 { 44 const NUMBERS_BEFORE_PRIME = '\ \b(?:\\d+\\/)?\\d{1,3}';44 const NUMBERS_BEFORE_PRIME = '\b(?:\d+\/)?\d{1,3}'; 45 45 const DOUBLE_PRIME = '/(' . self::NUMBERS_BEFORE_PRIME . ")(?:''|\")(?=\\W|\\Z|-\\w)/S"; 46 46 const SINGLE_PRIME = '/(' . self::NUMBERS_BEFORE_PRIME . ")'(?=\\W|\\Z|-\\w)/S"; 47 47 const SINGLE_DOUBLE_PRIME = '/(' . self::NUMBERS_BEFORE_PRIME . ")'(\\s*)(\\b(?:\\d+\\/)?\\d+)(?:''|\")(?=\\W|\\Z)/S"; 48 48 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'; 51 51 const APOSTROPHE_WORDS = "/(?<=\\w)'(?=\\w)/S"; 52 52 const APOSTROPHE_DECADES = "/'(\\d\\d(s|er)?\\b)/S"; … … 55 55 // Alternative is for expressions like _'¿hola?'_. 56 56 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'; 59 59 /** 60 60 * Cached primary quote style. … … 205 205 * @param string $secondary_close Secondary quote style close. 206 206 */ 207 private function update_smart_quotes_brackets($primary_open, $primary_close, $secondary_open, $secondary_close) : void207 private function update_smart_quotes_brackets($primary_open, $primary_close, $secondary_open, $secondary_close): void 208 208 { 209 209 $brackets = [ … … 237 237 * @since 5.0.0 238 238 */ 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 45 45 const COLLAPSE_NON_BREAKABLE_SPACES = '/(?:[' . RE::NORMAL_SPACES . ']|' . RE::HTML_SPACES . ')*' . U::NO_BREAK_SPACE . '(?:[' . RE::NORMAL_SPACES . ']|' . RE::HTML_SPACES . ')*/Sxu'; 46 46 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'; 48 48 /** 49 49 * Apply the fix to a given textnode. … … 94 94 * @since 5.0.0 95 95 */ 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 64 64 * @since 6.0.0 The replacement now assumes decoded ampersands (i.e. plain "&" instead of "&"). 65 65 */ 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 44 44 // PCRE needs to be compiled with "--enable-unicode-properties", but we already depend on that elsehwere. 45 45 const REGEX = '/ 46 (?<![\ \w' . self::COMBINING_MARKS . ']) # negative lookbehind assertion46 (?<![\w' . self::COMBINING_MARKS . ']) # negative lookbehind assertion 47 47 ( 48 48 (?: # CASE 1: " 9A " … … 50 50 (?:[' . self::COMBINING_MARKS . '])* 51 51 # may contain hyphens, underscores, zero width spaces, or soft hyphens, 52 \ \p{Lu} # but must contain at least one capital letter53 (?:\ \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 . '])* 54 54 # may be followed by any number of numbers capital letters, hyphens, 55 55 # underscores, zero width spaces, or soft hyphens … … 57 57 | 58 58 (?: # CASE 2: " A9 " 59 \ \p{Lu} # starts with capital letter60 (?:\ \p{Lu}|[0-9]) # must be followed a number or capital letter61 (?:\ \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 . '])* 62 62 # may be followed by any number of numbers capital letters, hyphens, 63 63 # underscores, zero width spaces, or soft hyphens 64 64 ) 65 65 ) 66 (?![\ \w' . self::COMBINING_MARKS . ']) # negative lookahead assertion66 (?![\w' . self::COMBINING_MARKS . ']) # negative lookahead assertion 67 67 /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; 69 69 // Needs to be part of character class. 70 70 /** … … 89 89 * @since 5.0.0 90 90 */ 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 85 85 // requires modifiers: x (multiline pattern) u (utf8). 86 86 // 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'; 91 91 /** 92 92 * Creates a new classes dependent fix. … … 165 165 * @since 5.0.0 166 166 */ 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 130 130 * @since 5.0.0 131 131 */ 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 66 66 * @since 5.0.0 67 67 */ 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 41 41 { 42 42 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'; 44 44 private const STANDARD_UNITS = ' 45 45 ### Temporal units 46 (?:ms|s|secs?|mins?|hrs?)\ \.?|46 (?:ms|s|secs?|mins?|hrs?)\.?| 47 47 milliseconds?|seconds?|minutes?|hours?|days?|years?|decades?|century|centuries|millennium|millennia| 48 48 49 49 ### 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| 53 53 inch|inches|foot|feet|yards?|miles?|acres?|hectares?|ounces?|pints?|quarts?|gallons?|pounds?|stones?| 54 54 … … 63 63 64 64 ### Money 65 ¢|M?(?:£|¥|€|\ \$)|65 ¢|M?(?:£|¥|€|\$)| 66 66 67 67 ### Other units … … 71 71 // required modifiers: x (multiline pattern), u (unicode). 72 72 // (?=\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)'; 74 74 /** 75 75 * Creates a new fix object. … … 102 102 * @since 5.0.0 103 103 */ 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 72 72 * @return Token[] An array of tokens. 73 73 */ 74 public abstractfunction 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); 75 75 /** 76 76 * Determines whether the fix should be applied to (RSS) feeds. … … 99 99 * @since 5.0.0 100 100 */ 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 93 93 * @since 5.0.0 94 94 */ 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 143 143 * @param Hyphenator\Cache $cache Required. 144 144 */ 145 public function set_hyphenator_cache(Hyphenator\Cache $cache) : void145 public function set_hyphenator_cache(Hyphenator\Cache $cache): void 146 146 { 147 147 $this->cache = $cache; … … 155 155 * @since 5.0.0 156 156 */ 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 77 77 * @since 6.3.0 78 78 */ 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 57 57 $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() . ' 58 58 ) 59 \ \Z59 \Z 60 60 )/Sxi'; 61 61 // required modifiers: x (multiline pattern) i (case insensitive). … … 93 93 * @since 5.0.0 94 94 */ 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 98 98 * @since 5.0.0 99 99 */ 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 46 46 // Valid URL schemes. 47 47 const URL_SCHEME = '(?:https?|ftps?|file|nfs|feed|itms|itpc)'; 48 const WRAP_URLS_DOMAIN_PARTS = '#(\ \-|\\.)#';48 const WRAP_URLS_DOMAIN_PARTS = '#(\-|\.)#'; 49 49 /** 50 50 * The URL matching regular expression. … … 64 64 // Combined URL pattern. 65 65 $this->url_pattern = '`(?: 66 \ \A67 (?<scheme>' . self::URL_SCHEME . ':\ \/\\/)? # Subpattern 1: contains _http://_ if it exists66 \A 67 (?<scheme>' . self::URL_SCHEME . ':\/\/)? # Subpattern 1: contains _http://_ if it exists 68 68 (?<domain> # Subpattern 2: contains subdomains.domain.tld 69 69 (?: 70 70 [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; 72 72 # limit qty of middle chrs so total domain does not exceed 63 chrs 73 73 [a-z0-9] # last chr of (sub)domain can not be a hyphen 74 \ \. # dot separator74 \. # dot separator 75 75 )+ 76 76 (?: … … 86 86 (?<path> # Subpattern 3: contains path following domain 87 87 (?: 88 \ \/ # marks nested directory89 [a-z0-9\ \"\\$\\-_\\.\\+!\\*\'\\(\\),;\\?:@=&\\#]+ # valid characters within directory structure88 \/ # marks nested directory 89 [a-z0-9\"\$\-_\.\+!\*\'\(\),;\?:@=&\#]+ # valid characters within directory structure 90 90 )* 91 [\ \/]? # trailing slash if any91 [\/]? # trailing slash if any 92 92 ) 93 \ \Z93 \Z 94 94 )`xi'; 95 95 // required modifiers: x (multiline pattern) i (case insensitive). … … 139 139 * @return string The hyphenated domain name. 140 140 */ 141 private function split_domain(string $domain, Settings $settings) : string141 private function split_domain(string $domain, Settings $settings): string 142 142 { 143 143 $domain_parts = \preg_split(self::WRAP_URLS_DOMAIN_PARTS, $domain, -1, \PREG_SPLIT_DELIM_CAPTURE); … … 177 177 * @return string The hyphenated domain name. 178 178 */ 179 private function split_path(string $path, Settings $settings) : string179 private function split_path(string $path, Settings $settings): string 180 180 { 181 181 // Break up the URL path to individual characters. … … 201 201 * @since 5.0.0 202 202 */ 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 64 64 * @param Hyphenator $hyphenator The object to cache. 65 65 */ 66 public function set_hyphenator($lang, Hyphenator $hyphenator) : void66 public function set_hyphenator($lang, Hyphenator $hyphenator): void 67 67 { 68 68 $this->cache[$lang] = $hyphenator; … … 101 101 * @author Peter Putzer <github@mundschenk.at> 102 102 */ 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 126 126 * @since 5.0.0 127 127 */ 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 113 113 * @since 5.0.0 114 114 */ 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 68 68 * @since 5.0.0 69 69 */ 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 101 101 * @since 5.0.0 102 102 */ 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 56 56 * @since 5.0.0 57 57 */ 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 119 119 * @since 5.0.0 120 120 */ 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 85 85 * @since 5.0.0 86 86 */ 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 127 127 public function __set($id, $val) 128 128 { 129 throw new \BadMethodCallException('Object of class Text_Parser\ \Token is immutable.');129 throw new \BadMethodCallException('Object of class Text_Parser\Token is immutable.'); 130 130 } 131 131 /** … … 139 139 public function __unset($id) 140 140 { 141 throw new \BadMethodCallException('Object of class Text_Parser\ \Token is immutable.');141 throw new \BadMethodCallException('Object of class Text_Parser\Token is immutable.'); 142 142 } 143 143 /** … … 176 176 * @property-read bool $mutable Wether the properties of the object can be modified. 177 177 */ 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 63 63 * @return void 64 64 */ 65 public abstractfunction invalidate();65 abstract public function invalidate(); 66 66 /** 67 67 * Retrieves a cached value. … … 71 71 * @return mixed 72 72 */ 73 public abstractfunction get($key);73 abstract public function get($key); 74 74 /** 75 75 * Sets an entry in the cache and stores the key. … … 81 81 * @return bool True if the cache could be set successfully. 82 82 */ 83 public abstractfunction set($key, $value, $duration = 0);83 abstract public function set($key, $value, $duration = 0); 84 84 /** 85 85 * Deletes an entry from the cache. … … 89 89 * @return bool True on successful removal, false on failure. 90 90 */ 91 public abstractfunction delete($key);91 abstract public function delete($key); 92 92 /** 93 93 * Retrieves the complete key to use. -
wp-typography/trunk/vendor-scoped/mundschenk-at/wp-data-storage/src/class-cache.php
r2663994 r3208262 64 64 public function invalidate() 65 65 { 66 $this->incrementor = \time();66 $this->incrementor = time(); 67 67 \wp_cache_set($this->incrementor_key, $this->incrementor, $this->group, 0); 68 68 } -
wp-typography/trunk/vendor-scoped/mundschenk-at/wp-data-storage/src/class-network-options.php
r2663994 r3208262 63 63 { 64 64 $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) { 66 66 $value = []; 67 67 } -
wp-typography/trunk/vendor-scoped/mundschenk-at/wp-data-storage/src/class-options.php
r2207810 r3208262 61 61 { 62 62 $value = \get_option($raw ? $option : $this->get_name($option), $default); 63 if ( \is_array($default) && '' === $value) {63 if (is_array($default) && '' === $value) { 64 64 $value = []; 65 65 } -
wp-typography/trunk/vendor-scoped/mundschenk-at/wp-data-storage/src/class-site-transients.php
r2819294 r3208262 43 43 { 44 44 // If we are not running on multisite, fall back to the parent implementation. 45 if (! \is_multisite()) {45 if (!is_multisite()) { 46 46 return parent::get_keys_from_database(); 47 47 } -
wp-typography/trunk/vendor-scoped/mundschenk-at/wp-data-storage/src/class-transients.php
r2819294 r3208262 64 64 } 65 65 // Update incrementor. 66 $this->incrementor = \time();66 $this->incrementor = time(); 67 67 $this->set($this->incrementor_key, $this->incrementor, 0, \true); 68 68 } -
wp-typography/trunk/vendor-scoped/mundschenk-at/wp-settings-ui/src/ui/class-abstract-control.php
r2663994 r3208262 188 188 $this->settings_args = $settings_args; 189 189 $this->sanitize_callback = $sanitize_callback; 190 $this->base_path = \dirname(\dirname(__DIR__));190 $this->base_path = dirname(dirname(__DIR__)); 191 191 } 192 192 /** … … 247 247 * @return string 248 248 */ 249 protected abstractfunction get_element_markup();249 abstract protected function get_element_markup(); 250 250 /** 251 251 * Render the HTML representation of the control. … … 334 334 protected function label_has_placeholder() 335 335 { 336 return \false !== \strpos($this->label, '%1$s');336 return \false !== strpos($this->label, '%1$s'); 337 337 } 338 338 /** … … 354 354 { 355 355 if ($this->label_has_placeholder()) { 356 return \sprintf($this->label, $this->get_element_markup());356 return sprintf($this->label, $this->get_element_markup()); 357 357 } else { 358 358 return $this->label; -
wp-typography/trunk/vendor-scoped/scoper-autoload.php
r2852338 r3208262 3 3 // scoper-autoload.php @generated by PhpScoper 4 4 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'] : []; 6 8 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 25 if (!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 } 11 31 } 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 } 32 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Token_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fix'); 33 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Default_Registry', 'WP_Typography\Vendor\PHP_Typography\Fixes\Default_Registry'); 34 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Token_Fixes\Hyphenate_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Hyphenate_Fix'); 35 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Token_Fixes\Hyphenate_Compounds_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Hyphenate_Compounds_Fix'); 36 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Token_Fixes\Smart_Dashes_Hyphen_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Smart_Dashes_Hyphen_Fix'); 37 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Token_Fixes\Abstract_Token_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Abstract_Token_Fix'); 38 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Token_Fixes\Wrap_URLs_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Wrap_URLs_Fix'); 39 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Token_Fixes\Wrap_Emails_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Wrap_Emails_Fix'); 40 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Token_Fixes\Wrap_Hard_Hyphens_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Token_Fixes\Wrap_Hard_Hyphens_Fix'); 41 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Registry', 'WP_Typography\Vendor\PHP_Typography\Fixes\Registry'); 42 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Space_Collapse_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Space_Collapse_Fix'); 43 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Smart_Fractions_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Fractions_Fix'); 44 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Dash_Spacing_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Dash_Spacing_Fix'); 45 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Dewidow_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Dewidow_Fix'); 46 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Style_Numbers_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Style_Numbers_Fix'); 47 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Smart_Maths_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Maths_Fix'); 48 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Smart_Diacritics_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Diacritics_Fix'); 49 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Smart_Ordinal_Suffix_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Ordinal_Suffix_Fix'); 50 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Process_Words_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Process_Words_Fix'); 51 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Smart_Area_Units_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Area_Units_Fix'); 52 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Style_Hanging_Punctuation_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Style_Hanging_Punctuation_Fix'); 53 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Simple_Style_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Simple_Style_Fix'); 54 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Smart_Quotes_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Quotes_Fix'); 55 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Smart_Exponents_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Exponents_Fix'); 56 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Style_Caps_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Style_Caps_Fix'); 57 humbug_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'); 58 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Numbered_Abbreviation_Spacing_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Numbered_Abbreviation_Spacing_Fix'); 59 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Abstract_Node_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Abstract_Node_Fix'); 60 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Unit_Spacing_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Unit_Spacing_Fix'); 61 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Smart_Dashes_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Dashes_Fix'); 62 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Style_Initial_Quotes_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Style_Initial_Quotes_Fix'); 63 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\French_Punctuation_Spacing_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\French_Punctuation_Spacing_Fix'); 64 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Smart_Marks_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Marks_Fix'); 65 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Style_Ampersands_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Style_Ampersands_Fix'); 66 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Simple_Regex_Replacement_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Simple_Regex_Replacement_Fix'); 67 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Classes_Dependent_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Classes_Dependent_Fix'); 68 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fixes\Smart_Ellipses_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fixes\Smart_Ellipses_Fix'); 69 humbug_phpscoper_expose_class('PHP_Typography\Fixes\Node_Fix', 'WP_Typography\Vendor\PHP_Typography\Fixes\Node_Fix'); 70 humbug_phpscoper_expose_class('PHP_Typography\Settings\Simple_Quotes', 'WP_Typography\Vendor\PHP_Typography\Settings\Simple_Quotes'); 71 humbug_phpscoper_expose_class('PHP_Typography\Settings\Simple_Dashes', 'WP_Typography\Vendor\PHP_Typography\Settings\Simple_Dashes'); 72 humbug_phpscoper_expose_class('PHP_Typography\Settings\Quote_Style', 'WP_Typography\Vendor\PHP_Typography\Settings\Quote_Style'); 73 humbug_phpscoper_expose_class('PHP_Typography\Settings\Quotes', 'WP_Typography\Vendor\PHP_Typography\Settings\Quotes'); 74 humbug_phpscoper_expose_class('PHP_Typography\Settings\Dashes', 'WP_Typography\Vendor\PHP_Typography\Settings\Dashes'); 75 humbug_phpscoper_expose_class('PHP_Typography\Settings\Dash_Style', 'WP_Typography\Vendor\PHP_Typography\Settings\Dash_Style'); 76 humbug_phpscoper_expose_class('PHP_Typography\U', 'WP_Typography\Vendor\PHP_Typography\U'); 77 humbug_phpscoper_expose_class('PHP_Typography\RE', 'WP_Typography\Vendor\PHP_Typography\RE'); 78 humbug_phpscoper_expose_class('PHP_Typography\PHP_Typography', 'WP_Typography\Vendor\PHP_Typography\PHP_Typography'); 79 humbug_phpscoper_expose_class('PHP_Typography\Text_Parser', 'WP_Typography\Vendor\PHP_Typography\Text_Parser'); 80 humbug_phpscoper_expose_class('PHP_Typography\Strings', 'WP_Typography\Vendor\PHP_Typography\Strings'); 81 humbug_phpscoper_expose_class('PHP_Typography\Hyphenator\Trie_Node', 'WP_Typography\Vendor\PHP_Typography\Hyphenator\Trie_Node'); 82 humbug_phpscoper_expose_class('PHP_Typography\Hyphenator\Cache', 'WP_Typography\Vendor\PHP_Typography\Hyphenator\Cache'); 83 humbug_phpscoper_expose_class('PHP_Typography\Settings', 'WP_Typography\Vendor\PHP_Typography\Settings'); 84 humbug_phpscoper_expose_class('PHP_Typography\DOM', 'WP_Typography\Vendor\PHP_Typography\DOM'); 85 humbug_phpscoper_expose_class('PHP_Typography\Hyphenator', 'WP_Typography\Vendor\PHP_Typography\Hyphenator'); 86 humbug_phpscoper_expose_class('PHP_Typography\Text_Parser\Token', 'WP_Typography\Vendor\PHP_Typography\Text_Parser\Token'); 174 87 175 88 return $loader; -
wp-typography/trunk/wp-typography.php
r2852644 r3208262 30 30 * Author: Peter Putzer 31 31 * Author URI: https://code.mundschenk.at 32 * Version: 5. 9.133 * Requires at least: 5.332 * Version: 5.10.0-alpha.2 33 * Requires at least: 6.6 34 34 * Requires PHP: 7.4 35 35 * License: GNU General Public License v2 or later
Note: See TracChangeset
for help on using the changeset viewer.