1 | <?php |
||
12 | class EMTypograph extends EMTBase |
||
13 | { |
||
14 | public $trets = array( |
||
15 | '\Fenrizbes\TypographBundle\EMT\EMTTretQuote', |
||
16 | '\Fenrizbes\TypographBundle\EMT\EMTTretDash', |
||
17 | '\Fenrizbes\TypographBundle\EMT\EMTTretSymbol', |
||
18 | '\Fenrizbes\TypographBundle\EMT\EMTTretPunctmark', |
||
19 | '\Fenrizbes\TypographBundle\EMT\EMTTretNumber', |
||
20 | '\Fenrizbes\TypographBundle\EMT\EMTTretSpace', |
||
21 | '\Fenrizbes\TypographBundle\EMT\EMTTretAbbr', |
||
22 | '\Fenrizbes\TypographBundle\EMT\EMTTretNobr', |
||
23 | '\Fenrizbes\TypographBundle\EMT\EMTTretDate', |
||
24 | '\Fenrizbes\TypographBundle\EMT\EMTTretOptAlign', |
||
25 | '\Fenrizbes\TypographBundle\EMT\EMTTretEtc', |
||
26 | '\Fenrizbes\TypographBundle\EMT\EMTTretText' |
||
27 | ); |
||
28 | |||
29 | |||
30 | protected $group_list = array( |
||
31 | 'Quote' => true, |
||
32 | 'Dash' => true, |
||
33 | 'Nobr' => true, |
||
34 | 'Symbol' => true, |
||
35 | 'Punctmark' => true, |
||
36 | 'Number' => true, |
||
37 | 'Date' => true, |
||
38 | 'Space' => true, |
||
39 | 'Abbr' => true, |
||
40 | 'OptAlign' => true, |
||
41 | 'Text' => true, |
||
42 | 'Etc' => true, |
||
43 | ); |
||
44 | protected $all_options = array( |
||
45 | |||
46 | 'Quote.quotes' => array( 'description' => 'Расстановка «кавычек-елочек» первого уровня', 'selector' => "Quote.*quote" ), |
||
47 | 'Quote.quotation' => array( 'description' => 'Внутренние кавычки-лапки', 'selector' => "Quote", 'setting' => 'no_bdquotes', 'reversed' => true ), |
||
48 | |||
49 | 'Dash.to_libo_nibud' => 'direct', |
||
50 | 'Dash.iz_za_pod' => 'direct', |
||
51 | 'Dash.ka_de_kas' => 'direct', |
||
52 | |||
53 | 'Nobr.super_nbsp' => 'direct', |
||
54 | 'Nobr.nbsp_in_the_end' => 'direct', |
||
55 | 'Nobr.phone_builder' => 'direct', |
||
56 | 'Nobr.ip_address' => 'direct', |
||
57 | 'Nobr.spaces_nobr_in_surname_abbr' => 'direct', |
||
58 | 'Nobr.nbsp_celcius' => 'direct', |
||
59 | 'Nobr.hyphen_nowrap_in_small_words' => 'direct', |
||
60 | 'Nobr.hyphen_nowrap' => 'direct', |
||
61 | 'Nobr.nowrap' => array('description' => 'Nobr (по умолчанию) & nowrap', 'disabled' => true, 'selector' => '*', 'setting' => 'nowrap' ), |
||
62 | |||
63 | 'Symbol.tm_replace' => 'direct', |
||
64 | 'Symbol.r_sign_replace' => 'direct', |
||
65 | 'Symbol.copy_replace' => 'direct', |
||
66 | 'Symbol.apostrophe' => 'direct', |
||
67 | 'Symbol.degree_f' => 'direct', |
||
68 | 'Symbol.arrows_symbols' => 'direct', |
||
69 | 'Symbol.no_inches' => array( 'description' => 'Расстановка дюйма после числа', 'selector' => "Quote", 'setting' => 'no_inches', 'reversed' => true ), |
||
70 | |||
71 | 'Punctmark.auto_comma' => 'direct', |
||
72 | 'Punctmark.hellip' => 'direct', |
||
73 | 'Punctmark.fix_pmarks' => 'direct', |
||
74 | 'Punctmark.fix_excl_quest_marks' => 'direct', |
||
75 | 'Punctmark.dot_on_end' => 'direct', |
||
76 | |||
77 | 'Number.minus_between_nums' => 'direct', |
||
78 | 'Number.minus_in_numbers_range' => 'direct', |
||
79 | 'Number.auto_times_x' => 'direct', |
||
80 | 'Number.simple_fraction' => 'direct', |
||
81 | 'Number.math_chars' => 'direct', |
||
82 | //'Number.split_number_to_triads' => 'direct', |
||
|
|||
83 | 'Number.thinsp_between_number_triads' => 'direct', |
||
84 | 'Number.thinsp_between_no_and_number' => 'direct', |
||
85 | 'Number.thinsp_between_sect_and_number' => 'direct', |
||
86 | |||
87 | 'Date.years' => 'direct', |
||
88 | 'Date.mdash_month_interval' => 'direct', |
||
89 | 'Date.nbsp_and_dash_month_interval' => 'direct', |
||
90 | 'Date.nobr_year_in_date' => 'direct', |
||
91 | |||
92 | 'Space.many_spaces_to_one' => 'direct', |
||
93 | 'Space.clear_percent' => 'direct', |
||
94 | 'Space.clear_before_after_punct' => array( 'description' => 'Удаление пробелов перед и после знаков препинания в предложении', 'selector' => 'Space.remove_space_before_punctuationmarks'), |
||
95 | 'Space.autospace_after' => array( 'description' => 'Расстановка пробелов после знаков препинания', 'selector' => 'Space.autospace_after_*'), |
||
96 | 'Space.bracket_fix' => array( 'description' => 'Удаление пробелов внутри скобок, а также расстановка пробела перед скобками', |
||
97 | 'selector' => array('Space.nbsp_before_open_quote', 'Punctmark.fix_brackets')), |
||
98 | |||
99 | 'Abbr.nbsp_money_abbr' => 'direct', |
||
100 | 'Abbr.nobr_vtch_itd_itp' => 'direct', |
||
101 | 'Abbr.nobr_sm_im' => 'direct', |
||
102 | 'Abbr.nobr_acronym' => 'direct', |
||
103 | 'Abbr.nobr_locations' => 'direct', |
||
104 | 'Abbr.nobr_abbreviation' => 'direct', |
||
105 | 'Abbr.ps_pps' => 'direct', |
||
106 | 'Abbr.nbsp_org_abbr' => 'direct', |
||
107 | 'Abbr.nobr_gost' => 'direct', |
||
108 | 'Abbr.nobr_before_unit_volt' => 'direct', |
||
109 | 'Abbr.nbsp_before_unit' => 'direct', |
||
110 | |||
111 | 'OptAlign.all' => array( 'description' => 'Все настройки оптического выравнивания', 'hide' => true, 'selector' => 'OptAlign.*'), |
||
112 | 'OptAlign.oa_oquote' => 'direct', |
||
113 | 'OptAlign.oa_obracket_coma' => 'direct', |
||
114 | 'OptAlign.oa_oquote_extra' => 'direct', |
||
115 | 'OptAlign.layout' => array( 'description' => 'Inline стили или CSS' ), |
||
116 | |||
117 | 'Text.paragraphs' => 'direct', |
||
118 | 'Text.auto_links' => 'direct', |
||
119 | 'Text.email' => 'direct', |
||
120 | 'Text.breakline' => 'direct', |
||
121 | 'Text.no_repeat_words' => 'direct', |
||
122 | |||
123 | |||
124 | //'Etc.no_nbsp_in_nobr' => 'direct', |
||
125 | 'Etc.unicode_convert' => array('description' => 'Преобразовывать html-сущности в юникод', 'selector' => '*', 'setting' => 'dounicode' , 'disabled' => true), |
||
126 | |||
127 | ); |
||
128 | |||
129 | /** |
||
130 | * Получить список имеющихся опций |
||
131 | * |
||
132 | * @return array |
||
133 | * all - полный список |
||
134 | * group - сгруппрованный по группам |
||
135 | */ |
||
136 | public function get_options_list() |
||
163 | |||
164 | |||
165 | /** |
||
166 | * Получить информацию о настройке |
||
167 | * |
||
168 | * @param string $key |
||
169 | * @return array|false |
||
170 | */ |
||
171 | protected function get_option_info($key) |
||
189 | |||
190 | |||
191 | /** |
||
192 | * Установка одной метанастройки |
||
193 | * |
||
194 | * @param string $name |
||
195 | * @param mixed $value |
||
196 | */ |
||
197 | public function do_setup($name, $value) |
||
224 | |||
225 | /** |
||
226 | * Запустить типограф со стандартными параметрами |
||
227 | * |
||
228 | * @param string $text |
||
229 | * @param array $options |
||
230 | * @return string |
||
231 | */ |
||
232 | public static function fast_apply($text, $options = null) |
||
239 | } |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.