We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 44 | class Registry { |
||
| 45 | |||
| 46 | const CHARACTERS = 10; |
||
| 47 | const SPACING_PRE_WORDS = 20; |
||
| 48 | const PROCESS_WORDS = 30; |
||
| 49 | const SPACING_POST_WORDS = 40; |
||
| 50 | const HTML_INSERTION = 50; |
||
| 51 | |||
| 52 | const GROUPS = [ self::CHARACTERS, self::SPACING_PRE_WORDS, self::PROCESS_WORDS, self::SPACING_POST_WORDS, self::HTML_INSERTION ]; |
||
| 53 | |||
| 54 | /** |
||
| 55 | * An array of CSS classes that are added for ampersands, numbers etc. |
||
| 56 | */ |
||
| 57 | const DEFAULT_CSS_CLASSES = [ |
||
| 58 | 'caps' => 'caps', |
||
| 59 | 'numbers' => 'numbers', |
||
| 60 | 'amp' => 'amp', |
||
| 61 | 'quo' => 'quo', |
||
| 62 | 'dquo' => 'dquo', |
||
| 63 | 'pull-single' => 'pull-single', |
||
| 64 | 'pull-double' => 'pull-double', |
||
| 65 | 'push-single' => 'push-single', |
||
| 66 | 'push-double' => 'push-double', |
||
| 67 | 'numerator' => 'numerator', |
||
| 68 | 'denominator' => 'denominator', |
||
| 69 | 'ordinal' => 'ordinal', |
||
| 70 | ]; |
||
| 71 | |||
| 72 | /** |
||
| 73 | * An array of Node_Fix implementations. |
||
| 74 | * |
||
| 75 | * @var array |
||
| 76 | */ |
||
| 77 | private $node_fixes = [ |
||
| 78 | self::CHARACTERS => [], |
||
| 79 | self::SPACING_PRE_WORDS => [], |
||
| 80 | self::PROCESS_WORDS => [], |
||
| 81 | self::SPACING_POST_WORDS => [], |
||
| 82 | self::HTML_INSERTION => [], |
||
| 83 | ]; |
||
| 84 | |||
| 85 | /** |
||
| 86 | * The token fix registry. |
||
| 87 | * |
||
| 88 | * @var Node_Fixes\Process_Words_Fix |
||
| 89 | */ |
||
| 90 | private $process_words_fix; |
||
| 91 | |||
| 92 | /** |
||
| 93 | * Creates new registry instance. |
||
| 94 | */ |
||
| 95 | public function __construct() { |
||
| 100 | |||
| 101 | /** |
||
| 102 | * Retrieves the registered node fixes. |
||
| 103 | * |
||
| 104 | * @return Node_Fix[][] |
||
| 105 | */ |
||
| 106 | public function get_node_fixes() { |
||
| 109 | |||
| 110 | /** |
||
| 111 | * Registers a node fix. |
||
| 112 | * |
||
| 113 | * @since 5.0.0 |
||
| 114 | * |
||
| 115 | * @param Node_Fix $fix Required. |
||
| 116 | * @param int $group Required. Only the constants CHARACTERS, SPACING_PRE_WORDS, SPACING_POST_WORDS, HTML_INSERTION are valid. |
||
| 117 | * |
||
| 118 | * @throws \InvalidArgumentException Group is invalid. |
||
| 119 | */ |
||
| 120 | public function register_node_fix( Node_Fix $fix, $group ) { |
||
| 127 | |||
| 128 | /** |
||
| 129 | * Registers a token fix. |
||
| 130 | * |
||
| 131 | * @param Token_Fix $fix Required. |
||
| 132 | */ |
||
| 133 | public function register_token_fix( Token_Fix $fix ) { |
||
| 136 | |||
| 137 | /** |
||
| 138 | * Sets the hyphenator cache for all registered token fixes (that require one). |
||
| 139 | * |
||
| 140 | * @param Cache $cache A hyphenator cache instance. |
||
| 141 | */ |
||
| 142 | public function update_hyphenator_cache( Cache $cache ) { |
||
| 145 | |||
| 146 | /** |
||
| 147 | * Applies typography fixes to a textnode. |
||
| 148 | * |
||
| 149 | * @param \DOMText $textnode The node to process. |
||
| 150 | * @param Settings $settings The settings to apply. |
||
| 151 | * @param bool $is_title Treat as title/heading tag if true. |
||
| 152 | * @param bool $is_feed Check for feed compatibility if true. |
||
| 153 | */ |
||
| 154 | public function apply_fixes( \DOMText $textnode, Settings $settings, $is_title, $is_feed ) { |
||
| 163 | |||
| 164 | /** |
||
| 165 | * Creates a new default registry instance. |
||
| 166 | * |
||
| 167 | * @param Cache|null $cache Optional. A hyphenatation cache instance to use. Default null. |
||
| 168 | * @param string[]|null $css_classes Optional. An array of CSS classes to use. Defaults to null (i.e. use the predefined classes). |
||
| 169 | * |
||
| 170 | * @return Registry |
||
| 171 | */ |
||
| 172 | public static function create( Cache $cache = null, array $css_classes = null ) { |
||
| 218 | } |
||
| 219 |