forked from rectorphp/rector-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPhpVersionFeature.php
More file actions
812 lines (661 loc) · 17.7 KB
/
PhpVersionFeature.php
File metadata and controls
812 lines (661 loc) · 17.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
<?php
declare(strict_types=1);
namespace Rector\ValueObject;
/**
* @api
*/
final class PhpVersionFeature
{
/**
* @var int
*/
public const PROPERTY_MODIFIER = PhpVersion::PHP_52;
/**
* @var int
*/
public const CONTINUE_TO_BREAK = PhpVersion::PHP_52;
/**
* @var int
*/
public const NO_REFERENCE_IN_NEW = PhpVersion::PHP_53;
/**
* @var int
*/
public const SERVER_VAR = PhpVersion::PHP_53;
/**
* @var int
*/
public const DIR_CONSTANT = PhpVersion::PHP_53;
/**
* @var int
*/
public const ELVIS_OPERATOR = PhpVersion::PHP_53;
/**
* @var int
*/
public const ANONYMOUS_FUNCTION_PARAM_TYPE = PhpVersion::PHP_53;
/**
* @var int
*/
public const NO_ZERO_BREAK = PhpVersion::PHP_54;
/**
* @var int
*/
public const NO_REFERENCE_IN_ARG = PhpVersion::PHP_54;
/**
* @var int
*/
public const SHORT_ARRAY = PhpVersion::PHP_54;
/**
* @var int
*/
public const DATE_TIME_INTERFACE = PhpVersion::PHP_55;
/**
* @see https://wiki.php.net/rfc/class_name_scalars
* @var int
*/
public const CLASSNAME_CONSTANT = PhpVersion::PHP_55;
/**
* @var int
*/
public const PREG_REPLACE_CALLBACK_E_MODIFIER = PhpVersion::PHP_55;
/**
* @var int
*/
public const EXP_OPERATOR = PhpVersion::PHP_56;
/**
* @var int
*/
public const REQUIRE_DEFAULT_VALUE = PhpVersion::PHP_56;
/**
* @var int
*/
public const SCALAR_TYPES = PhpVersion::PHP_70;
/**
* @var int
*/
public const HAS_RETURN_TYPE = PhpVersion::PHP_70;
/**
* @var int
*/
public const NULL_COALESCE = PhpVersion::PHP_70;
/**
* @var int
*/
public const LIST_SWAP_ORDER = PhpVersion::PHP_70;
/**
* @var int
*/
public const SPACESHIP = PhpVersion::PHP_70;
/**
* @var int
*/
public const DIRNAME_LEVELS = PhpVersion::PHP_70;
/**
* @var int
*/
public const CSPRNG_FUNCTIONS = PhpVersion::PHP_70;
/**
* @var int
*/
public const THROWABLE_TYPE = PhpVersion::PHP_70;
/**
* @var int
*/
public const NO_LIST_SPLIT_STRING = PhpVersion::PHP_70;
/**
* @var int
*/
public const NO_BREAK_OUTSIDE_LOOP = PhpVersion::PHP_70;
/**
* @var int
*/
public const NO_PHP4_CONSTRUCTOR = PhpVersion::PHP_70;
/**
* @var int
*/
public const NO_CALL_USER_METHOD = PhpVersion::PHP_70;
/**
* @var int
*/
public const NO_EREG_FUNCTION = PhpVersion::PHP_70;
/**
* @var int
*/
public const VARIABLE_ON_FUNC_CALL = PhpVersion::PHP_70;
/**
* @var int
*/
public const NO_MKTIME_WITHOUT_ARG = PhpVersion::PHP_70;
/**
* @var int
*/
public const NO_EMPTY_LIST = PhpVersion::PHP_70;
/**
* @see https://php.watch/versions/8.0/non-static-static-call-fatal-error
* Deprecated since PHP 7.0
*
* @var int
*/
public const STATIC_CALL_ON_NON_STATIC = PhpVersion::PHP_70;
/**
* @var int
*/
public const INSTANCE_CALL = PhpVersion::PHP_70;
/**
* @var int
*/
public const NO_MULTIPLE_DEFAULT_SWITCH = PhpVersion::PHP_70;
/**
* @var int
*/
public const WRAP_VARIABLE_VARIABLE = PhpVersion::PHP_70;
/**
* @var int
*/
public const ANONYMOUS_FUNCTION_RETURN_TYPE = PhpVersion::PHP_70;
/**
* @var int
*/
public const ITERABLE_TYPE = PhpVersion::PHP_71;
/**
* @var int
*/
public const VOID_TYPE = PhpVersion::PHP_71;
/**
* @var int
*/
public const CONSTANT_VISIBILITY = PhpVersion::PHP_71;
/**
* @var int
*/
public const ARRAY_DESTRUCT = PhpVersion::PHP_71;
/**
* @var int
*/
public const MULTI_EXCEPTION_CATCH = PhpVersion::PHP_71;
/**
* @var int
*/
public const NO_ASSIGN_ARRAY_TO_STRING = PhpVersion::PHP_71;
/**
* @var int
*/
public const BINARY_OP_NUMBER_STRING = PhpVersion::PHP_71;
/**
* @var int
*/
public const NO_EXTRA_PARAMETERS = PhpVersion::PHP_71;
/**
* @var int
*/
public const RESERVED_OBJECT_KEYWORD = PhpVersion::PHP_71;
/**
* @var int
*/
public const DEPRECATE_EACH = PhpVersion::PHP_72;
/**
* @var int
*/
public const OBJECT_TYPE = PhpVersion::PHP_72;
/**
* @var int
*/
public const NO_EACH_OUTSIDE_LOOP = PhpVersion::PHP_72;
/**
* @var int
*/
public const DEPRECATE_CREATE_FUNCTION = PhpVersion::PHP_72;
/**
* @var int
*/
public const NO_NULL_ON_GET_CLASS = PhpVersion::PHP_72;
/**
* @var int
*/
public const INVERTED_BOOL_IS_OBJECT_INCOMPLETE_CLASS = PhpVersion::PHP_72;
/**
* @var int
*/
public const RESULT_ARG_IN_PARSE_STR = PhpVersion::PHP_72;
/**
* @var int
*/
public const STRING_IN_FIRST_DEFINE_ARG = PhpVersion::PHP_72;
/**
* @var int
*/
public const STRING_IN_ASSERT_ARG = PhpVersion::PHP_72;
/**
* @var int
*/
public const NO_UNSET_CAST = PhpVersion::PHP_72;
/**
* @var int
*/
public const IS_COUNTABLE = PhpVersion::PHP_73;
/**
* @var int
*/
public const ARRAY_KEY_FIRST_LAST = PhpVersion::PHP_73;
/**
* @var int
* @see https://php.watch/versions/8.5/array_first-array_last
*/
public const ARRAY_FIRST_LAST = PhpVersion::PHP_85;
/**
* @var int
*/
public const JSON_EXCEPTION = PhpVersion::PHP_73;
/**
* @var int
*/
public const SETCOOKIE_ACCEPT_ARRAY_OPTIONS = PhpVersion::PHP_73;
/**
* @var int
*/
public const DEPRECATE_INSENSITIVE_CONSTANT_NAME = PhpVersion::PHP_73;
/**
* @var int
*/
public const ESCAPE_DASH_IN_REGEX = PhpVersion::PHP_73;
/**
* @var int
*/
public const DEPRECATE_INSENSITIVE_CONSTANT_DEFINE = PhpVersion::PHP_73;
/**
* @var int
*/
public const DEPRECATE_INT_IN_STR_NEEDLES = PhpVersion::PHP_73;
/**
* @var int
*/
public const SENSITIVE_HERE_NOW_DOC = PhpVersion::PHP_73;
/**
* @var int
*/
public const ARROW_FUNCTION = PhpVersion::PHP_74;
/**
* @var int
*/
public const LITERAL_SEPARATOR = PhpVersion::PHP_74;
/**
* @var int
*/
public const NULL_COALESCE_ASSIGN = PhpVersion::PHP_74;
/**
* @var int
*/
public const TYPED_PROPERTIES = PhpVersion::PHP_74;
/**
* @see https://wiki.php.net/rfc/covariant-returns-and-contravariant-parameters
* @var int
*/
public const COVARIANT_RETURN = PhpVersion::PHP_74;
/**
* @var int
*/
public const ARRAY_SPREAD = PhpVersion::PHP_74;
/**
* @var int
*/
public const DEPRECATE_CURLY_BRACKET_ARRAY_STRING = PhpVersion::PHP_74;
/**
* @var int
*/
public const DEPRECATE_REAL = PhpVersion::PHP_74;
/**
* @var int
*/
public const DEPRECATE_MONEY_FORMAT = PhpVersion::PHP_74;
/**
* @var int
*/
public const ARRAY_KEY_EXISTS_TO_PROPERTY_EXISTS = PhpVersion::PHP_74;
/**
* @var int
*/
public const FILTER_VAR_TO_ADD_SLASHES = PhpVersion::PHP_74;
/**
* @var int
*/
public const CHANGE_MB_STRPOS_ARG_POSITION = PhpVersion::PHP_74;
/**
* @var int
*/
public const RESERVED_FN_FUNCTION_NAME = PhpVersion::PHP_74;
/**
* @var int
*/
public const REFLECTION_TYPE_GETNAME = PhpVersion::PHP_74;
/**
* @var int
*/
public const EXPORT_TO_REFLECTION_FUNCTION = PhpVersion::PHP_74;
/**
* @var int
*/
public const DEPRECATE_NESTED_TERNARY = PhpVersion::PHP_74;
/**
* @var int
*/
public const DEPRECATE_RESTORE_INCLUDE_PATH = PhpVersion::PHP_74;
/**
* @var int
*/
public const DEPRECATE_HEBREVC = PhpVersion::PHP_74;
/**
* @var int
*/
public const UNION_TYPES = PhpVersion::PHP_80;
/**
* @var int
*/
public const CLASS_ON_OBJECT = PhpVersion::PHP_80;
/**
* @var int
*/
public const STATIC_RETURN_TYPE = PhpVersion::PHP_80;
/**
* @var int
*/
public const NO_FINAL_PRIVATE = PhpVersion::PHP_80;
/**
* @var int
*/
public const DEPRECATE_REQUIRED_PARAMETER_AFTER_OPTIONAL = PhpVersion::PHP_80;
/**
* @var int
*/
public const STATIC_VISIBILITY_SET_STATE = PhpVersion::PHP_80;
/**
* @var int
*/
public const NULLSAFE_OPERATOR = PhpVersion::PHP_80;
/**
* @var int
*/
public const IS_ITERABLE = PhpVersion::PHP_71;
/**
* @var int
*/
public const NULLABLE_TYPE = PhpVersion::PHP_71;
/**
* @var int
*/
public const PARENT_VISIBILITY_OVERRIDE = PhpVersion::PHP_72;
/**
* @var int
*/
public const COUNT_ON_NULL = PhpVersion::PHP_71;
/**
* @see https://wiki.php.net/rfc/constructor_promotion
* @var int
*/
public const PROPERTY_PROMOTION = PhpVersion::PHP_80;
/**
* @see https://wiki.php.net/rfc/attributes_v2
* @var int
*/
public const ATTRIBUTES = PhpVersion::PHP_80;
/**
* @var int
*/
public const STRINGABLE = PhpVersion::PHP_80;
/**
* @var int
*/
public const PHP_TOKEN = PhpVersion::PHP_80;
/**
* @var int
*/
public const STR_ENDS_WITH = PhpVersion::PHP_80;
/**
* @var int
*/
public const STR_STARTS_WITH = PhpVersion::PHP_80;
/**
* @var int
*/
public const STR_CONTAINS = PhpVersion::PHP_80;
/**
* @var int
*/
public const JSON_VALIDATE = PhpVersion::PHP_80;
/**
* @var int
*/
public const GET_DEBUG_TYPE = PhpVersion::PHP_80;
/**
* @see https://wiki.php.net/rfc/noreturn_type
* @var int
*/
public const NEVER_TYPE = PhpVersion::PHP_81;
/**
* @see https://wiki.php.net/rfc/variadics
* @var int
*/
public const VARIADIC_PARAM = PhpVersion::PHP_56;
/**
* @see https://wiki.php.net/rfc/readonly_and_immutable_properties
* @var int
*/
public const READONLY_PROPERTY = PhpVersion::PHP_81;
/**
* @see https://wiki.php.net/rfc/final_class_const
* @var int
*/
public const FINAL_CLASS_CONSTANTS = PhpVersion::PHP_81;
/**
* @see https://wiki.php.net/rfc/enumerations
* @var int
*/
public const ENUM = PhpVersion::PHP_81;
/**
* @see https://wiki.php.net/rfc/match_expression_v2
* @var int
*/
public const MATCH_EXPRESSION = PhpVersion::PHP_80;
/**
* @see https://wiki.php.net/rfc/non-capturing_catches
* @var int
*/
public const NON_CAPTURING_CATCH = PhpVersion::PHP_80;
/**
* @see https://www.php.net/manual/en/migration80.incompatible.php#migration80.incompatible.resource2object
* @var int
*/
public const PHP8_RESOURCE_TO_OBJECT = PhpVersion::PHP_80;
/**
* @see https://wiki.php.net/rfc/lsp_errors
* @var int
*/
public const FATAL_ERROR_ON_INCOMPATIBLE_METHOD_SIGNATURE = PhpVersion::PHP_80;
/**
* @see https://www.php.net/manual/en/migration81.incompatible.php#migration81.incompatible.resource2object
* @var int
*/
public const PHP81_RESOURCE_TO_OBJECT = PhpVersion::PHP_81;
/**
* @see https://wiki.php.net/rfc/new_in_initializers
* @var int
*/
public const NEW_INITIALIZERS = PhpVersion::PHP_81;
/**
* @see https://wiki.php.net/rfc/pure-intersection-types
* @var int
*/
public const INTERSECTION_TYPES = PhpVersion::PHP_81;
/**
* @see https://php.watch/versions/8.2/dnf-types
* @var int
*/
public const UNION_INTERSECTION_TYPES = PhpVersion::PHP_82;
/**
* @see https://wiki.php.net/rfc/array_unpacking_string_keys
* @var int
*/
public const ARRAY_SPREAD_STRING_KEYS = PhpVersion::PHP_81;
/**
* @see https://wiki.php.net/rfc/internal_method_return_types
* @var int
*/
public const RETURN_TYPE_WILL_CHANGE_ATTRIBUTE = PhpVersion::PHP_81;
/**
* @see https://wiki.php.net/rfc/first_class_callable_syntax
* @var int
*/
public const FIRST_CLASS_CALLABLE_SYNTAX = PhpVersion::PHP_81;
/**
* @see https://wiki.php.net/rfc/deprecate_dynamic_properties
* @var int
*/
public const DEPRECATE_DYNAMIC_PROPERTIES = PhpVersion::PHP_82;
/**
* @see https://wiki.php.net/rfc/readonly_classes
* @var int
*/
public const READONLY_CLASS = PhpVersion::PHP_82;
/**
* @see https://www.php.net/manual/en/migration83.new-features.php#migration83.new-features.core.readonly-modifier-improvements
* @var int
*/
public const READONLY_ANONYMOUS_CLASS = PhpVersion::PHP_83;
/**
* @see https://wiki.php.net/rfc/mixed_type_v2
* @var int
*/
public const MIXED_TYPE = PhpVersion::PHP_80;
/**
* @var int
*/
public const DEPRECATE_NULL_ARG_IN_STRING_FUNCTION = PhpVersion::PHP_81;
/**
* @see https://wiki.php.net/rfc/remove_utf8_decode_and_utf8_encode
* @var int
*/
public const DEPRECATE_UTF8_DECODE_ENCODE_FUNCTION = PhpVersion::PHP_82;
/**
* @see https://www.php.net/manual/en/filesystemiterator.construct
* @var int
*/
public const FILESYSTEM_ITERATOR_SKIP_DOTS = PhpVersion::PHP_82;
/**
* @see https://wiki.php.net/rfc/null-false-standalone-types
* @see https://wiki.php.net/rfc/true-type
*
* @var int
*/
public const NULL_FALSE_TRUE_STANDALONE_TYPE = PhpVersion::PHP_82;
/**
* @see https://wiki.php.net/rfc/redact_parameters_in_back_traces
* @var int
*/
public const SENSITIVE_PARAMETER_ATTRIBUTE = PhpVersion::PHP_82;
/**
* @see https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation
* @var int
*/
public const DEPRECATE_VARIABLE_IN_STRING_INTERPOLATION = PhpVersion::PHP_82;
/**
* @see https://wiki.php.net/rfc/marking_overriden_methods
* @var int
*/
public const OVERRIDE_ATTRIBUTE = PhpVersion::PHP_83;
/**
* @see https://wiki.php.net/rfc/typed_class_constants
* @var int
*/
public const TYPED_CLASS_CONSTANTS = PhpVersion::PHP_83;
/**
* @see https://wiki.php.net/rfc/dynamic_class_constant_fetch
* @var int
*/
public const DYNAMIC_CLASS_CONST_FETCH = PhpVersion::PHP_83;
/**
* @see https://wiki.php.net/rfc/deprecate-implicitly-nullable-types
* @var int
*/
public const DEPRECATE_IMPLICIT_NULLABLE_PARAM_TYPE = PhpVersion::PHP_84;
/**
* @see https://wiki.php.net/rfc/new_without_parentheses
* @var int
*/
public const NEW_METHOD_CALL_WITHOUT_PARENTHESES = PhpVersion::PHP_84;
/**
* @see https://wiki.php.net/rfc/correctly_name_the_rounding_mode_and_make_it_an_enum
* @var int
*/
public const ROUNDING_MODES = PhpVersion::PHP_84;
/**
* @see https://php.watch/versions/8.4/csv-functions-escape-parameter
* @var int
*/
public const REQUIRED_ESCAPE_PARAMETER = PhpVersion::PHP_84;
/**
* @see https://www.php.net/manual/en/migration83.deprecated.php#migration83.deprecated.ldap
* @var int
*/
public const DEPRECATE_HOST_PORT_SEPARATE_ARGS = PhpVersion::PHP_83;
/**
* @see https://www.php.net/manual/en/migration83.deprecated.php#migration83.deprecated.core.get-class
* @see https://php.watch/versions/8.3/get_class-get_parent_class-parameterless-deprecated
* @var int
*/
public const DEPRECATE_GET_CLASS_WITHOUT_ARGS = PhpVersion::PHP_83;
/**
* @see https://wiki.php.net/rfc/deprecated_attribute
* @var int
*/
public const DEPRECATED_ATTRIBUTE = PhpVersion::PHP_84;
/**
* @see https://php.watch/versions/8.4/array_find-array_find_key-array_any-array_all
* @var int
*/
public const ARRAY_FIND = PhpVersion::PHP_84;
/**
* @see https://php.watch/versions/8.4/array_find-array_find_key-array_any-array_all
* @var int
*/
public const ARRAY_FIND_KEY = PhpVersion::PHP_84;
/**
* @see https://php.watch/versions/8.4/array_find-array_find_key-array_any-array_all
* @var int
*/
public const ARRAY_ALL = PhpVersion::PHP_84;
/**
* @see https://php.watch/versions/8.4/array_find-array_find_key-array_any-array_all
* @var int
*/
public const ARRAY_ANY = PhpVersion::PHP_84;
/**
* @see https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_context_parameter_for_finfo_buffer
* @var int
*/
public const DEPRECATE_FINFO_BUFFER_CONTEXT = PhpVersion::PHP_85;
/**
* @see https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_debuginfo_returning_null
* @var int
*/
public const DEPRECATED_NULL_DEBUG_INFO_RETURN = PhpVersion::PHP_85;
/**
* @see https://wiki.php.net/rfc/attributes-on-constants
* @var int
*/
public const DEPRECATED_ATTRIBUTE_ON_CONSTANT = PhpVersion::PHP_85;
/**
* @see https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_semicolon_after_case_in_switch_statement
* @var int
*/
public const COLON_AFTER_SWITCH_CASE = PhpVersion::PHP_85;
/**
* @see https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_using_values_null_as_an_array_offset_and_when_calling_array_key_exists
* @var int
*/
public const DEPRECATE_NULL_ARG_IN_ARRAY_KEY_EXISTS_FUNCTION = PhpVersion::PHP_85;
/**
* @see https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_string_which_are_not_one_byte_long_to_ord
* @var int
*/
public const DEPRECATE_ORD_WITH_MULTIBYTE_STRING = PhpVersion::PHP_85;
}