@@ -770,214 +770,214 @@ discard block |
||
770 | 770 | return \in_array($tag_name, self::$optional_end_tags, true) |
771 | 771 | || |
772 | 772 | ( |
773 | - $tag_name === 'li' |
|
773 | + $tag_name === 'li' |
|
774 | 774 | && |
775 | 775 | ( |
776 | - $nextSibling === null |
|
776 | + $nextSibling === null |
|
777 | 777 | || |
778 | 778 | ( |
779 | - $nextSibling instanceof \DOMElement |
|
779 | + $nextSibling instanceof \DOMElement |
|
780 | 780 | && |
781 | 781 | $nextSibling->tagName === 'li' |
782 | - ) |
|
783 | - ) |
|
784 | - ) |
|
782 | + ) |
|
783 | + ) |
|
784 | + ) |
|
785 | 785 | || |
786 | 786 | ( |
787 | - $tag_name === 'optgroup' |
|
787 | + $tag_name === 'optgroup' |
|
788 | 788 | && |
789 | 789 | ( |
790 | - $nextSibling === null |
|
790 | + $nextSibling === null |
|
791 | 791 | || |
792 | 792 | ( |
793 | - $nextSibling instanceof \DOMElement |
|
793 | + $nextSibling instanceof \DOMElement |
|
794 | 794 | && |
795 | 795 | $nextSibling->tagName === 'optgroup' |
796 | - ) |
|
797 | - ) |
|
798 | - ) |
|
796 | + ) |
|
797 | + ) |
|
798 | + ) |
|
799 | 799 | || |
800 | 800 | ( |
801 | - $tag_name === 'rp' |
|
801 | + $tag_name === 'rp' |
|
802 | 802 | && |
803 | 803 | ( |
804 | - $nextSibling === null |
|
804 | + $nextSibling === null |
|
805 | 805 | || |
806 | 806 | ( |
807 | - $nextSibling instanceof \DOMElement |
|
807 | + $nextSibling instanceof \DOMElement |
|
808 | 808 | && |
809 | 809 | ( |
810 | - $nextSibling->tagName === 'rp' |
|
810 | + $nextSibling->tagName === 'rp' |
|
811 | 811 | || |
812 | 812 | $nextSibling->tagName === 'rt' |
813 | - ) |
|
814 | - ) |
|
815 | - ) |
|
816 | - ) |
|
813 | + ) |
|
814 | + ) |
|
815 | + ) |
|
816 | + ) |
|
817 | 817 | || |
818 | 818 | ( |
819 | - $tag_name === 'tr' |
|
819 | + $tag_name === 'tr' |
|
820 | 820 | && |
821 | 821 | ( |
822 | - $nextSibling === null |
|
822 | + $nextSibling === null |
|
823 | 823 | || |
824 | 824 | ( |
825 | - $nextSibling instanceof \DOMElement |
|
825 | + $nextSibling instanceof \DOMElement |
|
826 | 826 | && |
827 | 827 | $nextSibling->tagName === 'tr' |
828 | - ) |
|
829 | - ) |
|
830 | - ) |
|
828 | + ) |
|
829 | + ) |
|
830 | + ) |
|
831 | 831 | || |
832 | 832 | ( |
833 | - $tag_name === 'source' |
|
833 | + $tag_name === 'source' |
|
834 | 834 | && |
835 | 835 | ( |
836 | - $parent_tag_name === 'audio' |
|
836 | + $parent_tag_name === 'audio' |
|
837 | 837 | || |
838 | 838 | $parent_tag_name === 'video' |
839 | 839 | || |
840 | 840 | $parent_tag_name === 'picture' |
841 | 841 | || |
842 | 842 | $parent_tag_name === 'source' |
843 | - ) |
|
843 | + ) |
|
844 | 844 | && |
845 | 845 | ( |
846 | - $nextSibling === null |
|
846 | + $nextSibling === null |
|
847 | 847 | || |
848 | 848 | ( |
849 | - $nextSibling instanceof \DOMElement |
|
849 | + $nextSibling instanceof \DOMElement |
|
850 | 850 | && |
851 | 851 | $nextSibling->tagName === 'source' |
852 | - ) |
|
853 | - ) |
|
854 | - ) |
|
852 | + ) |
|
853 | + ) |
|
854 | + ) |
|
855 | 855 | || |
856 | 856 | ( |
857 | - ( |
|
858 | - $tag_name === 'td' |
|
857 | + ( |
|
858 | + $tag_name === 'td' |
|
859 | 859 | || |
860 | 860 | $tag_name === 'th' |
861 | - ) |
|
861 | + ) |
|
862 | 862 | && |
863 | 863 | ( |
864 | - $nextSibling === null |
|
864 | + $nextSibling === null |
|
865 | 865 | || |
866 | 866 | ( |
867 | - $nextSibling instanceof \DOMElement |
|
867 | + $nextSibling instanceof \DOMElement |
|
868 | 868 | && |
869 | 869 | ( |
870 | - $nextSibling->tagName === 'td' |
|
870 | + $nextSibling->tagName === 'td' |
|
871 | 871 | || |
872 | 872 | $nextSibling->tagName === 'th' |
873 | - ) |
|
874 | - ) |
|
875 | - ) |
|
876 | - ) |
|
873 | + ) |
|
874 | + ) |
|
875 | + ) |
|
876 | + ) |
|
877 | 877 | || |
878 | 878 | ( |
879 | - ( |
|
880 | - $tag_name === 'dd' |
|
879 | + ( |
|
880 | + $tag_name === 'dd' |
|
881 | 881 | || |
882 | 882 | $tag_name === 'dt' |
883 | - ) |
|
883 | + ) |
|
884 | 884 | && |
885 | 885 | ( |
886 | - $nextSibling === null |
|
886 | + $nextSibling === null |
|
887 | 887 | || |
888 | 888 | ( |
889 | - $nextSibling instanceof \DOMElement |
|
889 | + $nextSibling instanceof \DOMElement |
|
890 | 890 | && |
891 | 891 | ( |
892 | - $nextSibling->tagName === 'dd' |
|
892 | + $nextSibling->tagName === 'dd' |
|
893 | 893 | || |
894 | 894 | $nextSibling->tagName === 'dt' |
895 | - ) |
|
896 | - ) |
|
897 | - ) |
|
898 | - ) |
|
895 | + ) |
|
896 | + ) |
|
897 | + ) |
|
898 | + ) |
|
899 | 899 | || |
900 | 900 | ( |
901 | - $tag_name === 'option' |
|
901 | + $tag_name === 'option' |
|
902 | 902 | && |
903 | 903 | ( |
904 | - $nextSibling === null |
|
904 | + $nextSibling === null |
|
905 | 905 | || |
906 | 906 | ( |
907 | - $nextSibling instanceof \DOMElement |
|
907 | + $nextSibling instanceof \DOMElement |
|
908 | 908 | && |
909 | 909 | ( |
910 | - $nextSibling->tagName === 'option' |
|
910 | + $nextSibling->tagName === 'option' |
|
911 | 911 | || |
912 | 912 | $nextSibling->tagName === 'optgroup' |
913 | - ) |
|
914 | - ) |
|
915 | - ) |
|
916 | - ) |
|
913 | + ) |
|
914 | + ) |
|
915 | + ) |
|
916 | + ) |
|
917 | 917 | || |
918 | 918 | ( |
919 | - $tag_name === 'p' |
|
919 | + $tag_name === 'p' |
|
920 | 920 | && |
921 | 921 | ( |
922 | - ( |
|
923 | - $nextSibling === null |
|
922 | + ( |
|
923 | + $nextSibling === null |
|
924 | 924 | && |
925 | 925 | $node->parentNode !== null |
926 | 926 | && |
927 | 927 | !\in_array( |
928 | - $node->parentNode->nodeName, |
|
929 | - [ |
|
930 | - 'a', |
|
931 | - 'audio', |
|
932 | - 'del', |
|
933 | - 'ins', |
|
934 | - 'map', |
|
935 | - 'noscript', |
|
936 | - 'video', |
|
937 | - ], |
|
938 | - true |
|
939 | - ) |
|
940 | - ) |
|
928 | + $node->parentNode->nodeName, |
|
929 | + [ |
|
930 | + 'a', |
|
931 | + 'audio', |
|
932 | + 'del', |
|
933 | + 'ins', |
|
934 | + 'map', |
|
935 | + 'noscript', |
|
936 | + 'video', |
|
937 | + ], |
|
938 | + true |
|
939 | + ) |
|
940 | + ) |
|
941 | 941 | || |
942 | 942 | ( |
943 | - $nextSibling instanceof \DOMElement |
|
943 | + $nextSibling instanceof \DOMElement |
|
944 | 944 | && |
945 | 945 | \in_array( |
946 | - $nextSibling->tagName, |
|
947 | - [ |
|
948 | - 'address', |
|
949 | - 'article', |
|
950 | - 'aside', |
|
951 | - 'blockquote', |
|
952 | - 'dir', |
|
953 | - 'div', |
|
954 | - 'dl', |
|
955 | - 'fieldset', |
|
956 | - 'footer', |
|
957 | - 'form', |
|
958 | - 'h1', |
|
959 | - 'h2', |
|
960 | - 'h3', |
|
961 | - 'h4', |
|
962 | - 'h5', |
|
963 | - 'h6', |
|
964 | - 'header', |
|
965 | - 'hgroup', |
|
966 | - 'hr', |
|
967 | - 'menu', |
|
968 | - 'nav', |
|
969 | - 'ol', |
|
970 | - 'p', |
|
971 | - 'pre', |
|
972 | - 'section', |
|
973 | - 'table', |
|
974 | - 'ul', |
|
975 | - ], |
|
976 | - true |
|
977 | - ) |
|
978 | - ) |
|
979 | - ) |
|
980 | - ); |
|
946 | + $nextSibling->tagName, |
|
947 | + [ |
|
948 | + 'address', |
|
949 | + 'article', |
|
950 | + 'aside', |
|
951 | + 'blockquote', |
|
952 | + 'dir', |
|
953 | + 'div', |
|
954 | + 'dl', |
|
955 | + 'fieldset', |
|
956 | + 'footer', |
|
957 | + 'form', |
|
958 | + 'h1', |
|
959 | + 'h2', |
|
960 | + 'h3', |
|
961 | + 'h4', |
|
962 | + 'h5', |
|
963 | + 'h6', |
|
964 | + 'header', |
|
965 | + 'hgroup', |
|
966 | + 'hr', |
|
967 | + 'menu', |
|
968 | + 'nav', |
|
969 | + 'ol', |
|
970 | + 'p', |
|
971 | + 'pre', |
|
972 | + 'section', |
|
973 | + 'table', |
|
974 | + 'ul', |
|
975 | + ], |
|
976 | + true |
|
977 | + ) |
|
978 | + ) |
|
979 | + ) |
|
980 | + ); |
|
981 | 981 | } |
982 | 982 | |
983 | 983 | protected function domNodeToString(\DOMNode $node): string |
@@ -1107,9 +1107,9 @@ discard block |
||
1107 | 1107 | } |
1108 | 1108 | |
1109 | 1109 | return '<!DOCTYPE ' . $child->name |
1110 | - . ($child->publicId ? ' ' . $tmpTypePublic . ' "' . $child->publicId . '"' : '') |
|
1111 | - . ($child->systemId ? ' ' . $tmpTypeSystem . ' "' . $child->systemId . '"' : '') |
|
1112 | - . '>'; |
|
1110 | + . ($child->publicId ? ' ' . $tmpTypePublic . ' "' . $child->publicId . '"' : '') |
|
1111 | + . ($child->systemId ? ' ' . $tmpTypeSystem . ' "' . $child->systemId . '"' : '') |
|
1112 | + . '>'; |
|
1113 | 1113 | } |
1114 | 1114 | } |
1115 | 1115 |