2222#include " support.h"
2323#include " generated/IsSuperTypeOfResult.h"
2424
25+ namespace sigs = ptdecl::IsSuperTypeOfResult::sig;
26+
2527namespace slots = ptdecl::IsSuperTypeOfResult::slot;
2628#include " zv.h"
2729
@@ -478,8 +480,6 @@ void pt_is_super_type_of_result_rshutdown()
478480#include " reg.h"
479481#include " TypeTraits.h"
480482
481- #define IS_SUPER_TYPE_OF_RESULT_CLASS " PHPStanTurbo\\ IsSuperTypeOfResult"
482- #define TRINARY_CLASS " PHPStanTurbo\\ TrinaryLogic"
483483
484484static zend_result pt_verify_is_super_type_of_result_variadic (zval *args, uint32_t count, uint32_t offset)
485485{
@@ -579,8 +579,11 @@ void pt_register_is_super_type_of_result()
579579{
580580 reg::Class cls (" PHPStan\\ Type\\ IsSuperTypeOfResult" );
581581 ptdecl::IsSuperTypeOfResult::declareClass (cls);
582+ /* the static flyweight properties stay unused: the natives keep the
583+ * singletons in the request globals */
584+ ptdecl::IsSuperTypeOfResult::declareProperties (cls);
582585
583- cls.method (" __construct " , reg::Public, 2 , { reg::obj ( " result " , TRINARY_CLASS ), reg::arrayArg ( " reasons " ), reg::withDefault ( reg::arrayArg ( " lazyReasons " ), " [] " ) } , [](INTERNAL_FUNCTION_PARAMETERS ) {
586+ cls.method (sigs::__construct , [](INTERNAL_FUNCTION_PARAMETERS ) {
584587 zval *result, *reasons;
585588 zval *lazyReasons = NULL ;
586589 ZEND_PARSE_PARAMETERS_START (2 , 3 )
@@ -592,75 +595,75 @@ void pt_register_is_super_type_of_result()
592595 if (UNEXPECTED (!IsSuperTypeOfResult (Z_OBJ_P (ZEND_THIS )).construct (result, reasons, lazyReasons))) RETURN_THROWS ();
593596 });
594597
595- cls.method (" yes " , reg::Public, 0 , {} , [](INTERNAL_FUNCTION_PARAMETERS ) {
598+ cls.method (sigs::yes , [](INTERNAL_FUNCTION_PARAMETERS ) {
596599 pt_is_super_type_of_result_bool (INTERNAL_FUNCTION_PARAM_PASSTHRU , PT_TRI_YES );
597600 });
598601
599- cls.method (" maybe " , reg::Public, 0 , {} , [](INTERNAL_FUNCTION_PARAMETERS ) {
602+ cls.method (sigs::maybe , [](INTERNAL_FUNCTION_PARAMETERS ) {
600603 pt_is_super_type_of_result_bool (INTERNAL_FUNCTION_PARAM_PASSTHRU , PT_TRI_MAYBE );
601604 });
602605
603- cls.method (" no " , reg::Public, 0 , {} , [](INTERNAL_FUNCTION_PARAMETERS ) {
606+ cls.method (sigs::no , [](INTERNAL_FUNCTION_PARAMETERS ) {
604607 pt_is_super_type_of_result_bool (INTERNAL_FUNCTION_PARAM_PASSTHRU , PT_TRI_NO );
605608 });
606609
607- cls.method (" getReasons " , reg::Public, 0 , {} , [](INTERNAL_FUNCTION_PARAMETERS ) {
610+ cls.method (sigs::getReasons , [](INTERNAL_FUNCTION_PARAMETERS ) {
608611 ZEND_PARSE_PARAMETERS_NONE ();
609612 zv::Val result = IsSuperTypeOfResult (Z_OBJ_P (ZEND_THIS )).getReasons ();
610613 if (UNEXPECTED (result.isUndef ())) RETURN_THROWS ();
611614 result.intoReturnValue (return_value);
612615 });
613616
614- cls.method (" createYes " , reg::PublicStatic, 0 , {} , [](INTERNAL_FUNCTION_PARAMETERS ) {
617+ cls.method (sigs::createYes , [](INTERNAL_FUNCTION_PARAMETERS ) {
615618 ZEND_PARSE_PARAMETERS_NONE ();
616619 zv::Val result = IsSuperTypeOfResult::createYes ();
617620 if (UNEXPECTED (result.isUndef ())) RETURN_THROWS ();
618621 result.intoReturnValue (return_value);
619622 });
620623
621- cls.method (" createNo " , reg::PublicStatic, 0 , { reg::withDefault ( reg::arrayArg ( " reasons " ), " [] " ), reg::withDefault ( reg::arrayArg ( " lazyReasons " ), " [] " ) } , [](INTERNAL_FUNCTION_PARAMETERS ) {
624+ cls.method (sigs::createNo , [](INTERNAL_FUNCTION_PARAMETERS ) {
622625 zval *reasons = NULL , *lazyReasons = NULL ;
623626 if (!zp::parse<zp::Opt<zp::Arr>, zp::Opt<zp::Arr>>(execute_data, reasons, lazyReasons)) RETURN_THROWS ();
624627 zv::Val result = IsSuperTypeOfResult::createNo (reasons, lazyReasons);
625628 if (UNEXPECTED (result.isUndef ())) RETURN_THROWS ();
626629 result.intoReturnValue (return_value);
627630 });
628631
629- cls.method (" createMaybe " , reg::PublicStatic, 0 , {} , [](INTERNAL_FUNCTION_PARAMETERS ) {
632+ cls.method (sigs::createMaybe , [](INTERNAL_FUNCTION_PARAMETERS ) {
630633 ZEND_PARSE_PARAMETERS_NONE ();
631634 zv::Val result = IsSuperTypeOfResult::createMaybe ();
632635 if (UNEXPECTED (result.isUndef ())) RETURN_THROWS ();
633636 result.intoReturnValue (return_value);
634637 });
635638
636- cls.method (" createFromBoolean " , reg::PublicStatic, 1 , { reg::boolArg ( " value " ) } , [](INTERNAL_FUNCTION_PARAMETERS ) {
639+ cls.method (sigs::createFromBoolean , [](INTERNAL_FUNCTION_PARAMETERS ) {
637640 bool value;
638641 if (!zp::parse<zp::Bool>(execute_data, value)) RETURN_THROWS ();
639642 zv::Val result = IsSuperTypeOfResult::createFromBoolean (value);
640643 if (UNEXPECTED (result.isUndef ())) RETURN_THROWS ();
641644 result.intoReturnValue (return_value);
642645 });
643646
644- cls.method (" toAcceptsResult " , reg::Public, 0 , {} , [](INTERNAL_FUNCTION_PARAMETERS ) {
647+ cls.method (sigs::toAcceptsResult , [](INTERNAL_FUNCTION_PARAMETERS ) {
645648 ZEND_PARSE_PARAMETERS_NONE ();
646649 zv::Val result = IsSuperTypeOfResult (Z_OBJ_P (ZEND_THIS )).toAcceptsResult ();
647650 if (UNEXPECTED (result.isUndef ())) RETURN_THROWS ();
648651 result.intoReturnValue (return_value);
649652 });
650653
651- cls.method (" and " , reg::Public, 0 , { reg::variadicObj ( " others " , IS_SUPER_TYPE_OF_RESULT_CLASS ) } , [](INTERNAL_FUNCTION_PARAMETERS ) {
654+ cls.method (sigs::and_ , [](INTERNAL_FUNCTION_PARAMETERS ) {
652655 pt_is_super_type_of_result_and_or (INTERNAL_FUNCTION_PARAM_PASSTHRU , true );
653656 });
654657 /* the one-operand call native code makes; the operand checked as the
655658 * variadic `self` parameter is */
656659 cls.op (PT_OP_AND , PT_OP_LAMBDA { if (UNEXPECTED (pt_verify_is_super_type_of_result_variadic (argv, 1 , 1 ) != SUCCESS )) { return zv::Val (); } return IsSuperTypeOfResult (self).and_ (argv, 1 ); });
657660
658- cls.method (" or " , reg::Public, 0 , { reg::variadicObj ( " others " , IS_SUPER_TYPE_OF_RESULT_CLASS ) } , [](INTERNAL_FUNCTION_PARAMETERS ) {
661+ cls.method (sigs::or_ , [](INTERNAL_FUNCTION_PARAMETERS ) {
659662 pt_is_super_type_of_result_and_or (INTERNAL_FUNCTION_PARAM_PASSTHRU , false );
660663 });
661664 cls.op (PT_OP_OR , PT_OP_LAMBDA { if (UNEXPECTED (pt_verify_is_super_type_of_result_variadic (argv, 1 , 1 ) != SUCCESS )) { return zv::Val (); } return IsSuperTypeOfResult (self).or_ (argv, 1 ); });
662665
663- cls.method (" decorateReasons " , reg::Public, 1 , { reg::callableArg ( " cb " ) } , [](INTERNAL_FUNCTION_PARAMETERS ) {
666+ cls.method (sigs::decorateReasons , [](INTERNAL_FUNCTION_PARAMETERS ) {
664667 zend_fcall_info fci;
665668 zend_fcall_info_cache fcc;
666669 ZEND_PARSE_PARAMETERS_START (1 , 1 )
@@ -671,15 +674,15 @@ void pt_register_is_super_type_of_result()
671674 result.intoReturnValue (return_value);
672675 });
673676
674- cls.method (" extremeIdentity " , reg::PublicStatic, 0 , { reg::variadicObj ( " operands " , IS_SUPER_TYPE_OF_RESULT_CLASS ) } , [](INTERNAL_FUNCTION_PARAMETERS ) {
677+ cls.method (sigs::extremeIdentity , [](INTERNAL_FUNCTION_PARAMETERS ) {
675678 pt_is_super_type_of_result_variadic_op (INTERNAL_FUNCTION_PARAM_PASSTHRU , true );
676679 });
677680
678- cls.method (" maxMin " , reg::PublicStatic, 0 , { reg::variadicObj ( " operands " , IS_SUPER_TYPE_OF_RESULT_CLASS ) } , [](INTERNAL_FUNCTION_PARAMETERS ) {
681+ cls.method (sigs::maxMin , [](INTERNAL_FUNCTION_PARAMETERS ) {
679682 pt_is_super_type_of_result_variadic_op (INTERNAL_FUNCTION_PARAM_PASSTHRU , false );
680683 });
681684
682- cls.method (" lazyMaxMin " , reg::PublicStatic, 2 , { reg::arrayArg ( " objects " ), reg::callableArg ( " callback " ) } , [](INTERNAL_FUNCTION_PARAMETERS ) {
685+ cls.method (sigs::lazyMaxMin , [](INTERNAL_FUNCTION_PARAMETERS ) {
683686 zval *objects;
684687 zend_fcall_info fci;
685688 zend_fcall_info_cache fcc;
@@ -692,23 +695,20 @@ void pt_register_is_super_type_of_result()
692695 result.intoReturnValue (return_value);
693696 });
694697
695- cls.method (" negate " , reg::Public, 0 , {} , [](INTERNAL_FUNCTION_PARAMETERS ) {
698+ cls.method (sigs::negate , [](INTERNAL_FUNCTION_PARAMETERS ) {
696699 ZEND_PARSE_PARAMETERS_NONE ();
697700 zv::Val result = IsSuperTypeOfResult (Z_OBJ_P (ZEND_THIS )).negate ();
698701 if (UNEXPECTED (result.isUndef ())) RETURN_THROWS ();
699702 result.intoReturnValue (return_value);
700703 });
701704
702- cls.method (" describe " , reg::Public, 0 , {} , [](INTERNAL_FUNCTION_PARAMETERS ) {
705+ cls.method (sigs::describe , [](INTERNAL_FUNCTION_PARAMETERS ) {
703706 ZEND_PARSE_PARAMETERS_NONE ();
704707 const char *described = IsSuperTypeOfResult (Z_OBJ_P (ZEND_THIS )).describe ();
705708 if (UNEXPECTED (described == NULL )) RETURN_THROWS ();
706709 RETURN_STRING (described);
707710 });
708711
709- cls.publicReadonlyProperty (" result" , MAY_BE_OBJECT );
710- cls.publicReadonlyProperty (" reasons" , MAY_BE_ARRAY );
711- cls.publicReadonlyProperty (" lazyReasons" , MAY_BE_ARRAY );
712712 cls.shadow (&pt_ce_is_super_type_of_result);
713713
714714 /* the decorateReasons() lazy-reason holder: an internal detail with no PHP
0 commit comments