-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathstubs.php
More file actions
956 lines (869 loc) · 23.7 KB
/
Copy pathstubs.php
File metadata and controls
956 lines (869 loc) · 23.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
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
<?php
namespace {
define( 'MINUTE_IN_SECONDS', 60 );
define( 'HOUR_IN_SECONDS', 60 * MINUTE_IN_SECONDS );
define( 'DAY_IN_SECONDS', 24 * HOUR_IN_SECONDS );
define( 'WEEK_IN_SECONDS', 7 * DAY_IN_SECONDS );
define( 'MONTH_IN_SECONDS', 30 * DAY_IN_SECONDS );
define( 'YEAR_IN_SECONDS', 365 * DAY_IN_SECONDS );
define( 'EMPTY_TRASH_DAYS', 30 );
define( 'ABSPATH', realpath( __FILE__ . '/../../../../' ) );
define( 'WP_PLUGIN_DIR', realpath( __FILE__ . '/../' ) );
define( 'WPINC', 'wp-includes' );
define( 'OBJECT', 'OBJECT' );
define( 'OBJECT_K', 'OBJECT_K' );
define( 'ARRAY_A', 'ARRAY_A' );
define( 'EP_PAGES', 4096 );
define( 'EP_PERMALINK', 1 );
define( 'COOKIEHASH', '' );
define( 'COOKIE_DOMAIN', false );
define( 'WP_IMPORTING', false );
define( 'ICL_PLUGIN_INACTIVE', false );
class FrmProFormState {
public static function get_from_request( $key, $default ) {}
/**
* @param string $key
* @param mixed $value
*
* @return void
*/
public static function set_initial_value( $key, $value ) {
}
}
class FrmProEntryShortcodeFormatter extends FrmEntryShortcodeFormatter {
}
class FrmProSettings extends FrmSettings {
}
class FrmProApplicationsHelper {
public static function get_custom_applications_capability() {}
/**
* @return string
*/
public static function get_required_templates_capability() {
}
}
class FrmProFileImport {
public static function import_attachment( $val, $field ) {
}
}
class FrmProAppHelper {
public static function get_settings() {
}
public static function convert_date( $date_str, $from_format, $to_format ) {
}
/**
* @return bool
*/
public static function views_is_installed() {
}
/**
* @return string
*/
public static function plugin_path() {
}
/**
* @return bool
*/
public static function use_chosen_js() {
}
/**
* @param array|string $selected
* @param string $current
* @param bool $echo
*
* @return string
*/
public static function selected( $selected, $current, $echo = true ) {
}
/**
* @return string
*/
public static function plugin_url() {
}
/**
* @return FrmProEddController
*/
public static function get_updater() {
}
public static function use_jquery_datepicker() {
}
}
class FrmProEntryMetaHelper {
public static function get_post_or_meta_value( $entry, $field, $atts = array() ) {
}
/**
* @param int|object|string $field_id
* @param array|string $value
* @param false|int|string $entry_id
*
* @return array|object|string|null
*/
public static function value_exists( $field_id, $value, $entry_id = false ) {
}
public static function get_post_value( $post_id, $post_field, $custom_field, $atts ) {
}
}
class FrmProFormActionsController {
/**
* @param WP_Post $action
* @param stdClass $entry
*
* @return bool
*/
public static function action_conditions_met( $action, $entry ) {
}
}
class FrmViewsLayout {
/**
* @param int $view_id
* @param string $listing_layout
* @param string $detail_layout
*/
public static function maybe_create_layouts_for_view( $view_id, $listing_layout, $detail_layout ) {
}
/**
* @param int $view_id
* @param false|string $type
*
* @return array|false|object
*/
public static function get_layouts_for_view( $view_id, $type = false ) {
}
}
class FrmProDisplaysHelper {
public static function get_shortcodes( $content, $form_id ) {
}
}
class FrmProAddonsController {
/**
* @param bool $force_type
*
* @return string
*/
public static function license_type( $force_type = false ) {
}
/**
* @return bool|int
*/
public static function is_license_expiring() {
}
/**
* @param string $plugin
* @param array|string $upgrade_link_args
*
* @return void
*/
public static function conditional_action_button( $plugin, $upgrade_link_args ) {
}
/**
* @param array $atts
*
* @return void
*/
public static function show_conditional_action_button( $atts ) {
}
/**
* @return bool
*/
public static function admin_banner() {
}
/**
* @return string
*/
public static function get_readable_license_type() {
}
}
class FrmProCurrencyHelper {
public static function normalize_formatted_numbers( $field, $formatted_value ) {}
}
class FrmProDb {
/**
* @var string
*/
public static $plug_version;
}
class FrmProStylesController extends FrmStylesController {
/**
* @param int $form_id
*
* @return WP_Post
*/
public static function get_active_style_for_form( $form_id ) {
}
/**
* @param stdClass|WP_Post $active_style
*
* @return array<WP_Post>
*/
public static function get_styles_for_styler( $active_style ) {
}
/**
* @return array<string>
*/
public static function get_notes_for_styler_preview() {
}
/**
* @return false|string
*/
public static function get_disabled_javascript_features() {
}
}
class FrmProPost {
/**
* @param array $field
* @param array $args
*
* @return string
*/
public static function get_category_dropdown( $field, $args ) {
}
}
class FrmProEntriesController {
public static function show_entry_shortcode( $atts ) {
}
/**
* @param array $atts
*
* @return string
*/
public static function entry_delete_link( $atts ) {
}
/**
* @param string $method
* @param stdClass $form
* @param int $entry_id
* @param array $args
* @param array $form_options
*/
public static function confirmation( $method, $form, $form_options, $entry_id, $args = array() ) {
}
/**
* @param object $form
*
* @return bool
*/
public static function is_form_displayed_after_edit( $form ) {
}
/**
* @param object $entry
* @param array $args
*
* @return void
*/
public static function show_front_end_form_with_entry( $entry, $args ) {
}
}
class FrmProFormsHelper {
public static function post_type( $form ) {
}
/**
* @return array
*/
public static function get_default_opts() {
}
}
class FrmProEntry {
/**
* @param array|false $values
* @param string $location
*
* @return array
*/
public static function mod_other_vals( $values = false, $location = 'front' ) {
}
}
class FrmProEntryFormatter extends FrmEntryFormatter {
}
class FrmProEntriesHelper {
public static function get_search_str( $where_clause, $search_str, $form_id = 0, $fid = '' ) {
}
/**
* @param object $field
* @param object $entry
* @param array|int|string $field_value
*
* @return void
*/
public static function get_dynamic_list_values( $field, $entry, &$field_value ) {
}
/**
* @param object $entry
* @param object $field
* @param array $atts
*
* @return string
*/
public static function prepare_child_display_value( $entry, $field, $atts ) {
}
}
class FrmProFieldsHelper {
/**
* @param array $args
* @param string $value
*
* @return void
*/
public static function replace_non_standard_formidable_shortcodes( $args, &$value ) {
}
/**
* @param array|object $field
*
* @return bool
*/
public static function is_field_visible_to_user( $field ) {
}
}
class FrmViewsAppHelper {
/**
* @return string
*/
public static function plugin_version() {
}
}
class FrmViewsDisplay {
/**
* @param int $form_id
*
* @return array
*/
public static function get_display_ids_by_form( $form_id ) {
}
}
class FrmProCreditCardsController {
/**
* @param array $field
* @param string $field_name
* @param array $atts
*
* @return void
*/
public static function show_in_form( $field, $field_name, $atts ) {
}
}
class FrmProAppController {
/**
* @return bool
*/
public static function has_combo_js_file() {
}
}
class Akismet {
/**
* @param string $request
* @param string $path
* @param string $ip
*
* @return array
*/
public static function http_post( $request, $path, $ip = null ) {
}
public static function get_user_roles( $user_id ) {
}
}
class PHPMailer {
public function __construct( $exceptions = null ) {
}
}
class FrmPaymentsController {
/**
* @var string
*/
public static $db_opt_name = 'frm_pay_db_version';
/**
* @param array $cols
*
* @return array
*/
public static function payment_columns( $cols = array() ) {
}
}
class FrmProDashboardHelper {
/**
* @return bool
*/
public static function should_display_videos() {
}
/**
* @param array $entries_template
*
* @return void
*/
public static function get_main_widget( $entries_template ) {
}
/**
* @param array $entries_template
*
* @return void
*/
public static function get_bottom_widget( $entries_template ) {
}
/**
* @param array $template
*
* @return void
*/
public static function load_license_management( $template ) {
}
}
class FrmProEddController extends FrmAddon {
}
class FrmProFieldSettings {
}
function load_formidable_pro() {
}
/**
* @return WPMailSMTP\Core
*/
function wp_mail_smtp() {
}
/**
* @return bool
*/
function akismet_test_mode() {
}
/** WP Optimize plugin */
class WP_Optimize {
/**
* @return WPO_Page_Cache
*/
public function get_page_cache() {
}
}
class WPO_Page_Cache {
/**
* @return bool
*/
public function purge() {
}
}
class FrmLog {
/**
* @param array<string> $values values.
*
* @return void
*/
public function add( $values ) {
}
}
/**
* @return WP_Optimize
*/
function WP_Optimize() {
}
/**
* Function from W3 Total cache.
*
* @param array|null $extras Extras.
*
* @return void
*/
function w3tc_flush_all( $extras = null ) {
}
class FrmTransListsController {
/**
* @param array $columns
*
* @return array
*/
public static function payment_columns( $columns = array() ) {
}
}
class FrmProSettingsController {
/**
* @param string $count
*
* @return string
*/
public static function inbox_badge( $count ) {}
/**
* @return void
*/
public static function add_currency_settings() {}
}
class FrmProAddressesController extends FrmProComboFieldsController {
/**
* @param string $country
*
* @return string
*/
public static function get_country_code( $country ) {
}
}
class FrmProComboFieldsController {
}
class FrmProEntryMeta {
/**
* @param object $field
*
* @return bool
*/
public static function skip_required_validation( $field ) {
}
}
class FrmProDashboardController {
/**
* @return array
*/
public static function get_counters() {
}
}
class FrmProFormsController{
public static function enqueue_pro_web_components_script(){
}
}
/**
* This class is in the PayPal add-on.
*/
class FrmPaymentSettingsController {
/**
* @return void
*/
public static function route() {
}
}
/**
* DeepSource's PHP analyzer excludes the vendor directory from its scan (see the
* exclude_patterns in .deepsource.toml), so it never sees PHPUnit\Framework\TestCase's real
* methods even though this class extends it - that extends clause only helps PHPStan, which
* does load vendor/. Every PHPUnit method the plugin's tests actually call is therefore
* re-declared concretely below, with a real (if simplified) body: an empty body would trip
* DeepSource's PHP-W1080, and an unused parameter would trip PHP-W1037, on every one of these.
*/
class WP_UnitTestCase_Base extends PHPUnit\Framework\TestCase {
/**
* FrmUnitTest::setUp() actually replaces this with a FrmUnitTestFactory, but that class
* lives under tests/, which phpstan.neon excludes from the analysis paths - PHPStan would
* report "unknown class" for a type it can never load. WP_UnitTest_Factory is the real
* base type and is declared below, so it resolves.
*
* @var WP_UnitTest_Factory
*/
protected $factory;
/**
* Real PHPUnit\Framework\TestCase declares every assertion method static, so an override
* has to match that or PHP fatals with "Cannot make static method ... non static".
*
* @param bool $passed
* @param string $message
*/
protected static function stub_check( $passed, $message = '' ) {
if ( ! $passed ) {
throw new Exception( $message );
}
}
/**
* The parent parameter is array|ArrayAccess. Any concrete spelling of that PHPStan can
* check - including a fully generic ArrayAccess<mixed,mixed> - reads as narrower than the
* parent's bare, unparameterized ArrayAccess and trips the contravariance rule, so this is
* typed mixed: the widest possible type, trivially at least as wide as the parent's.
*
* @param mixed $key
* @param mixed $array
*/
public static function assertArrayHasKey( $key, $array, string $message = '' ): void {
self::stub_check( is_array( $array ) && array_key_exists( $key, $array ), $message );
}
/**
* @param mixed $key
* @param mixed $array
*/
public static function assertArrayNotHasKey( $key, $array, string $message = '' ): void {
self::stub_check( ! ( is_array( $array ) && array_key_exists( $key, $array ) ), $message );
}
public static function assertContains( $needle, iterable $haystack, string $message = '' ): void {
self::stub_check( in_array( $needle, is_array( $haystack ) ? $haystack : iterator_to_array( $haystack ), true ), $message );
}
public static function assertNotContains( $needle, iterable $haystack, string $message = '' ): void {
self::stub_check( ! in_array( $needle, is_array( $haystack ) ? $haystack : iterator_to_array( $haystack ), true ), $message );
}
public static function assertCount( int $expected_count, $haystack, string $message = '' ): void {
self::stub_check( is_countable( $haystack ) && count( $haystack ) === $expected_count, $message );
}
public static function assertEmpty( $actual, string $message = '' ): void {
self::stub_check( empty( $actual ), $message );
}
public static function assertNotEmpty( $actual, string $message = '' ): void {
self::stub_check( ! empty( $actual ), $message );
}
public static function assertEquals( $expected, $actual, string $message = '' ): void {
self::stub_check( $expected == $actual, $message ); // phpcs:ignore Universal.Operators.StrictComparisons
}
public static function assertTrue( $condition, string $message = '' ): void {
self::stub_check( $condition === true, $message );
}
public static function assertFalse( $condition, string $message = '' ): void {
self::stub_check( $condition === false, $message );
}
public static function assertNotFalse( $condition, string $message = '' ): void {
self::stub_check( $condition !== false, $message );
}
public static function assertFileExists( string $filename, string $message = '' ): void {
self::stub_check( file_exists( $filename ), $message );
}
public static function assertGreaterThan( $expected, $actual, string $message = '' ): void {
self::stub_check( $actual > $expected, $message );
}
public static function assertGreaterThanOrEqual( $expected, $actual, string $message = '' ): void {
self::stub_check( $actual >= $expected, $message );
}
public static function assertLessThan( $expected, $actual, string $message = '' ): void {
self::stub_check( $actual < $expected, $message );
}
public static function assertLessThanOrEqual( $expected, $actual, string $message = '' ): void {
self::stub_check( $actual <= $expected, $message );
}
public static function assertInstanceOf( string $expected, $actual, string $message = '' ): void {
self::stub_check( $actual instanceof $expected, $message );
}
public static function assertNotInstanceOf( string $expected, $actual, string $message = '' ): void {
self::stub_check( ! ( $actual instanceof $expected ), $message );
}
public static function assertIsArray( $actual, string $message = '' ): void {
self::stub_check( is_array( $actual ), $message );
}
public static function assertIsBool( $actual, string $message = '' ): void {
self::stub_check( is_bool( $actual ), $message );
}
public static function assertIsObject( $actual, string $message = '' ): void {
self::stub_check( is_object( $actual ), $message );
}
public static function assertIsString( $actual, string $message = '' ): void {
self::stub_check( is_string( $actual ), $message );
}
public static function assertIsNumeric( $actual, string $message = '' ): void {
self::stub_check( is_numeric( $actual ), $message );
}
public static function assertIsNotNumeric( $actual, string $message = '' ): void {
self::stub_check( ! is_numeric( $actual ), $message );
}
public static function assertNotNull( $actual, string $message = '' ): void {
self::stub_check( $actual !== null, $message );
}
public static function assertNull( $actual, string $message = '' ): void {
self::stub_check( $actual === null, $message );
}
public static function assertSame( $expected, $actual, string $message = '' ): void {
self::stub_check( $expected === $actual, $message );
}
public static function assertNotSame( $expected, $actual, string $message = '' ): void {
self::stub_check( $expected !== $actual, $message );
}
/**
* assertObjectNotHasProperty is deliberately not overridden here: PHPUnit declares it
* final, so any override at all is a fatal "Cannot override final method" - not just a
* signature mismatch. It is only used in test_FrmEntry.php, which this stub rewrite does
* not need to cover.
*/
public static function assertStringContainsString( string $needle, string $haystack, string $message = '' ): void {
self::stub_check( strpos( $haystack, $needle ) !== false, $message );
}
public static function assertStringNotContainsString( string $needle, string $haystack, string $message = '' ): void {
self::stub_check( strpos( $haystack, $needle ) === false, $message );
}
public static function assertStringStartsWith( string $prefix, string $string, string $message = '' ): void {
self::stub_check( strncmp( $string, $prefix, strlen( $prefix ) ) === 0, $message );
}
public static function fail( string $message = '' ): void {
throw new Exception( $message );
}
public static function markTestSkipped( string $message = '' ): void {
throw new Exception( $message );
}
/**
* Real WP_UnitTestCase_Base declares this one an instance method, not static.
*/
public function go_to( $url ) {
self::stub_check( is_string( $url ) );
}
/**
* Real WP_UnitTestCase_Base declares this one an instance method, not static.
*/
public function clean_up_global_scope() {
self::stub_check( true );
}
}
class WP_UnitTestCase extends WP_UnitTestCase_Base {
}
class WP_UnitTest_Factory {
/**
* @var WP_UnitTest_Factory_For_Post
*/
public $post;
/**
* @var WP_UnitTest_Factory_For_Attachment
*/
public $attachment;
/**
* @var WP_UnitTest_Factory_For_Comment
*/
public $comment;
/**
* @var WP_UnitTest_Factory_For_User
*/
public $user;
/**
* @var WP_UnitTest_Factory_For_Term
*/
public $term;
/**
* @var WP_UnitTest_Factory_For_Term
*/
public $category;
/**
* @var WP_UnitTest_Factory_For_Term
*/
public $tag;
/**
* @var WP_UnitTest_Factory_For_Bookmark
*/
public $bookmark;
/**
* @var WP_UnitTest_Factory_For_Blog
*/
public $blog;
/**
* @var WP_UnitTest_Factory_For_Network
*/
public $network;
}
/**
* The leaf *_For_* classes below are deliberately left abstract with no override of
* create_object()/update_object()/get_object_by_id(): they exist only so property access
* like $factory->post resolves to a type that inherits create()/create_and_get(), and an
* abstract class is never instantiated from this file, so leaving them unimplemented is
* fine for static analysis and avoids stubbing empty method bodies DeepSource flags as
* PHP-W1080 (no body) with unused-parameter findings on top.
*/
abstract class WP_UnitTest_Factory_For_Thing {
public $default_generation_definitions;
public $factory;
public function __construct( $factory, $default_generation_definitions = array() ) {
$this->factory = $factory;
$this->default_generation_definitions = $default_generation_definitions;
}
abstract public function create_object( $args );
abstract public function update_object( $object_id, $fields );
abstract public function get_object_by_id( $object_id );
public function create( $args = array(), $generation_definitions = null ) {
if ( $generation_definitions === null ) {
$generation_definitions = $this->default_generation_definitions;
}
return $this->create_object( array_merge( (array) $generation_definitions, $args ) );
}
public function create_and_get( $args = array(), $generation_definitions = null ) {
return $this->get_object_by_id( $this->create( $args, $generation_definitions ) );
}
public function create_many( $count, $args = array(), $generation_definitions = null ) {
return array_fill( 0, $count, $this->create( $args, $generation_definitions ) );
}
}
abstract class WP_UnitTest_Factory_For_Post extends WP_UnitTest_Factory_For_Thing {
}
abstract class WP_UnitTest_Factory_For_Attachment extends WP_UnitTest_Factory_For_Post {
}
abstract class WP_UnitTest_Factory_For_Comment extends WP_UnitTest_Factory_For_Thing {
}
abstract class WP_UnitTest_Factory_For_User extends WP_UnitTest_Factory_For_Thing {
}
abstract class WP_UnitTest_Factory_For_Term extends WP_UnitTest_Factory_For_Thing {
}
abstract class WP_UnitTest_Factory_For_Bookmark extends WP_UnitTest_Factory_For_Thing {
}
abstract class WP_UnitTest_Factory_For_Blog extends WP_UnitTest_Factory_For_Thing {
}
abstract class WP_UnitTest_Factory_For_Network extends WP_UnitTest_Factory_For_Thing {
}
/**
* frm_factory.php uses this to generate unique default values (field names, entry names).
* mago.toml's [source] paths includes "tests" directly - unlike PHPStan, mago analyzes that
* file itself and needs this class to exist, not just its name.
*/
class WP_UnitTest_Generator_Sequence {
public static $incr = -1;
public $next;
public $template_string;
public function __construct( $template_string = '%s', $start = null ) {
}
public function next() {
}
public function get_incr() {
}
public function get_template_string() {
}
}
/**
* frm_factory.php uses this to generate a random entry value, for the same reason as
* WP_UnitTest_Generator_Sequence above.
*/
function rand_str( $length = 32 ) {
}
}
namespace Elementor {
abstract class Widget_Base {
public function start_controls_section( $section_id, array $args = array() ) {
}
public function add_control( $id, array $args, $options = array() ) {
}
public function end_controls_section() {
}
public function get_settings_for_display( $setting_key = null ) {
}
}
class Plugin {
/**
* @return Plugin
*/
public static function instance() {
}
}
class Controls_Manager {
const TAB_CONTENT = 'content';
const SELECT2 = 'select2';
const SWITCHER = 'switcher';
}
}
namespace WPMailSMTP {
class Options {
/**
* @return Options
*/
public static function init() {
}
/**
* @param string $group
* @param string $key
* @param bool $strip_slashes
*
* @return mixed|null
*/
public function get( $group, $key, $strip_slashes = true ) {
}
}
class Core {
/**
* @return Providers\Loader
*/
public function get_providers() {
}
}
}
namespace WPMailSMTP\Providers {
interface MailerInterface {
/**
* @return bool
*/
public function is_mailer_complete();
}
abstract class MailerAbstract implements MailerInterface {
}
class Loader {
/**
* @param string $provider The provider name.
* @param MailCatcherInterface $phpmailer The MailCatcher object.
*
* @return MailerAbstract|null
*/
public function get_mailer( $provider, $phpmailer ) {
}
}
}