@@ -705,220 +705,220 @@ discard block |
||
705 | 705 | return \in_array($tag_name, self::$optional_end_tags, true) |
706 | 706 | || |
707 | 707 | ( |
708 | - $tag_name === 'li' |
|
708 | + $tag_name === 'li' |
|
709 | 709 | && |
710 | 710 | ( |
711 | - $nextSibling === null |
|
711 | + $nextSibling === null |
|
712 | 712 | || |
713 | 713 | ( |
714 | - $nextSibling instanceof \DOMElement |
|
714 | + $nextSibling instanceof \DOMElement |
|
715 | 715 | && |
716 | 716 | $nextSibling->tagName === 'li' |
717 | - ) |
|
718 | - ) |
|
719 | - ) |
|
717 | + ) |
|
718 | + ) |
|
719 | + ) |
|
720 | 720 | || |
721 | 721 | ( |
722 | - $tag_name === 'optgroup' |
|
722 | + $tag_name === 'optgroup' |
|
723 | 723 | && |
724 | 724 | ( |
725 | - $nextSibling === null |
|
725 | + $nextSibling === null |
|
726 | 726 | || |
727 | 727 | ( |
728 | - $nextSibling instanceof \DOMElement |
|
728 | + $nextSibling instanceof \DOMElement |
|
729 | 729 | && |
730 | 730 | $nextSibling->tagName === 'optgroup' |
731 | - ) |
|
732 | - ) |
|
733 | - ) |
|
731 | + ) |
|
732 | + ) |
|
733 | + ) |
|
734 | 734 | || |
735 | 735 | ( |
736 | - $tag_name === 'rp' |
|
736 | + $tag_name === 'rp' |
|
737 | 737 | && |
738 | 738 | ( |
739 | - $nextSibling === null |
|
739 | + $nextSibling === null |
|
740 | 740 | || |
741 | 741 | ( |
742 | - $nextSibling instanceof \DOMElement |
|
742 | + $nextSibling instanceof \DOMElement |
|
743 | 743 | && |
744 | 744 | ( |
745 | - $nextSibling->tagName === 'rp' |
|
745 | + $nextSibling->tagName === 'rp' |
|
746 | 746 | || |
747 | 747 | $nextSibling->tagName === 'rt' |
748 | - ) |
|
749 | - ) |
|
750 | - ) |
|
751 | - ) |
|
748 | + ) |
|
749 | + ) |
|
750 | + ) |
|
751 | + ) |
|
752 | 752 | || |
753 | 753 | ( |
754 | - $tag_name === 'tr' |
|
754 | + $tag_name === 'tr' |
|
755 | 755 | && |
756 | 756 | ( |
757 | - $nextSibling === null |
|
757 | + $nextSibling === null |
|
758 | 758 | || |
759 | 759 | ( |
760 | - $nextSibling instanceof \DOMElement |
|
760 | + $nextSibling instanceof \DOMElement |
|
761 | 761 | && |
762 | 762 | $nextSibling->tagName === 'tr' |
763 | - ) |
|
764 | - ) |
|
765 | - ) |
|
763 | + ) |
|
764 | + ) |
|
765 | + ) |
|
766 | 766 | || |
767 | 767 | ( |
768 | - $tag_name === 'source' |
|
768 | + $tag_name === 'source' |
|
769 | 769 | && |
770 | 770 | ( |
771 | - $parent_tag_name === 'audio' |
|
771 | + $parent_tag_name === 'audio' |
|
772 | 772 | || |
773 | 773 | $parent_tag_name === 'video' |
774 | 774 | || |
775 | 775 | $parent_tag_name === 'picture' |
776 | 776 | || |
777 | 777 | $parent_tag_name === 'source' |
778 | - ) |
|
778 | + ) |
|
779 | 779 | && |
780 | 780 | ( |
781 | - $nextSibling === null |
|
781 | + $nextSibling === null |
|
782 | 782 | || |
783 | 783 | ( |
784 | - $nextSibling instanceof \DOMElement |
|
784 | + $nextSibling instanceof \DOMElement |
|
785 | 785 | && |
786 | 786 | $nextSibling->tagName === 'source' |
787 | - ) |
|
788 | - ) |
|
789 | - ) |
|
787 | + ) |
|
788 | + ) |
|
789 | + ) |
|
790 | 790 | || |
791 | 791 | ( |
792 | - ( |
|
793 | - $tag_name === 'td' |
|
792 | + ( |
|
793 | + $tag_name === 'td' |
|
794 | 794 | || |
795 | 795 | $tag_name === 'th' |
796 | - ) |
|
796 | + ) |
|
797 | 797 | && |
798 | 798 | ( |
799 | - $nextSibling === null |
|
799 | + $nextSibling === null |
|
800 | 800 | || |
801 | 801 | ( |
802 | - $nextSibling instanceof \DOMElement |
|
802 | + $nextSibling instanceof \DOMElement |
|
803 | 803 | && |
804 | 804 | ( |
805 | - $nextSibling->tagName === 'td' |
|
805 | + $nextSibling->tagName === 'td' |
|
806 | 806 | || |
807 | 807 | $nextSibling->tagName === 'th' |
808 | - ) |
|
809 | - ) |
|
810 | - ) |
|
811 | - ) |
|
808 | + ) |
|
809 | + ) |
|
810 | + ) |
|
811 | + ) |
|
812 | 812 | || |
813 | 813 | ( |
814 | - ( |
|
815 | - $tag_name === 'dd' |
|
814 | + ( |
|
815 | + $tag_name === 'dd' |
|
816 | 816 | || |
817 | 817 | $tag_name === 'dt' |
818 | - ) |
|
818 | + ) |
|
819 | 819 | && |
820 | 820 | ( |
821 | - ( |
|
822 | - $nextSibling === null |
|
821 | + ( |
|
822 | + $nextSibling === null |
|
823 | 823 | && |
824 | 824 | $tag_name === 'dd' |
825 | - ) |
|
825 | + ) |
|
826 | 826 | || |
827 | 827 | ( |
828 | - $nextSibling instanceof \DOMElement |
|
828 | + $nextSibling instanceof \DOMElement |
|
829 | 829 | && |
830 | 830 | ( |
831 | - $nextSibling->tagName === 'dd' |
|
831 | + $nextSibling->tagName === 'dd' |
|
832 | 832 | || |
833 | 833 | $nextSibling->tagName === 'dt' |
834 | - ) |
|
835 | - ) |
|
836 | - ) |
|
837 | - ) |
|
834 | + ) |
|
835 | + ) |
|
836 | + ) |
|
837 | + ) |
|
838 | 838 | || |
839 | 839 | ( |
840 | - $tag_name === 'option' |
|
840 | + $tag_name === 'option' |
|
841 | 841 | && |
842 | 842 | ( |
843 | - $nextSibling === null |
|
843 | + $nextSibling === null |
|
844 | 844 | || |
845 | 845 | ( |
846 | - $nextSibling instanceof \DOMElement |
|
846 | + $nextSibling instanceof \DOMElement |
|
847 | 847 | && |
848 | 848 | ( |
849 | - $nextSibling->tagName === 'option' |
|
849 | + $nextSibling->tagName === 'option' |
|
850 | 850 | || |
851 | 851 | $nextSibling->tagName === 'optgroup' |
852 | - ) |
|
853 | - ) |
|
854 | - ) |
|
855 | - ) |
|
852 | + ) |
|
853 | + ) |
|
854 | + ) |
|
855 | + ) |
|
856 | 856 | || |
857 | 857 | ( |
858 | - $tag_name === 'p' |
|
858 | + $tag_name === 'p' |
|
859 | 859 | && |
860 | 860 | ( |
861 | - ( |
|
862 | - $nextSibling === null |
|
861 | + ( |
|
862 | + $nextSibling === null |
|
863 | 863 | && |
864 | 864 | ( |
865 | - $node->parentNode !== null |
|
865 | + $node->parentNode !== null |
|
866 | 866 | && |
867 | 867 | !\in_array( |
868 | - $node->parentNode->nodeName, |
|
869 | - [ |
|
870 | - 'a', |
|
871 | - 'audio', |
|
872 | - 'del', |
|
873 | - 'ins', |
|
874 | - 'map', |
|
875 | - 'noscript', |
|
876 | - 'video', |
|
877 | - ], |
|
878 | - true |
|
879 | - ) |
|
880 | - ) |
|
881 | - ) |
|
868 | + $node->parentNode->nodeName, |
|
869 | + [ |
|
870 | + 'a', |
|
871 | + 'audio', |
|
872 | + 'del', |
|
873 | + 'ins', |
|
874 | + 'map', |
|
875 | + 'noscript', |
|
876 | + 'video', |
|
877 | + ], |
|
878 | + true |
|
879 | + ) |
|
880 | + ) |
|
881 | + ) |
|
882 | 882 | || |
883 | 883 | ( |
884 | - $nextSibling instanceof \DOMElement |
|
884 | + $nextSibling instanceof \DOMElement |
|
885 | 885 | && |
886 | 886 | \in_array( |
887 | - $nextSibling->tagName, |
|
888 | - [ |
|
889 | - 'address', |
|
890 | - 'article', |
|
891 | - 'aside', |
|
892 | - 'blockquote', |
|
893 | - 'dir', |
|
894 | - 'div', |
|
895 | - 'dl', |
|
896 | - 'fieldset', |
|
897 | - 'footer', |
|
898 | - 'form', |
|
899 | - 'h1', |
|
900 | - 'h2', |
|
901 | - 'h3', |
|
902 | - 'h4', |
|
903 | - 'h5', |
|
904 | - 'h6', |
|
905 | - 'header', |
|
906 | - 'hgroup', |
|
907 | - 'hr', |
|
908 | - 'menu', |
|
909 | - 'nav', |
|
910 | - 'ol', |
|
911 | - 'p', |
|
912 | - 'pre', |
|
913 | - 'section', |
|
914 | - 'table', |
|
915 | - 'ul', |
|
916 | - ], |
|
917 | - true |
|
918 | - ) |
|
919 | - ) |
|
920 | - ) |
|
921 | - ); |
|
887 | + $nextSibling->tagName, |
|
888 | + [ |
|
889 | + 'address', |
|
890 | + 'article', |
|
891 | + 'aside', |
|
892 | + 'blockquote', |
|
893 | + 'dir', |
|
894 | + 'div', |
|
895 | + 'dl', |
|
896 | + 'fieldset', |
|
897 | + 'footer', |
|
898 | + 'form', |
|
899 | + 'h1', |
|
900 | + 'h2', |
|
901 | + 'h3', |
|
902 | + 'h4', |
|
903 | + 'h5', |
|
904 | + 'h6', |
|
905 | + 'header', |
|
906 | + 'hgroup', |
|
907 | + 'hr', |
|
908 | + 'menu', |
|
909 | + 'nav', |
|
910 | + 'ol', |
|
911 | + 'p', |
|
912 | + 'pre', |
|
913 | + 'section', |
|
914 | + 'table', |
|
915 | + 'ul', |
|
916 | + ], |
|
917 | + true |
|
918 | + ) |
|
919 | + ) |
|
920 | + ) |
|
921 | + ); |
|
922 | 922 | } |
923 | 923 | |
924 | 924 | protected function domNodeToString(\DOMNode $node): string |
@@ -1047,9 +1047,9 @@ discard block |
||
1047 | 1047 | } |
1048 | 1048 | |
1049 | 1049 | return '<!DOCTYPE ' . $child->name . '' |
1050 | - . ($child->publicId ? ' ' . $tmpTypePublic . ' "' . $child->publicId . '"' : '') |
|
1051 | - . ($child->systemId ? ' ' . $tmpTypeSystem . ' "' . $child->systemId . '"' : '') |
|
1052 | - . '>'; |
|
1050 | + . ($child->publicId ? ' ' . $tmpTypePublic . ' "' . $child->publicId . '"' : '') |
|
1051 | + . ($child->systemId ? ' ' . $tmpTypeSystem . ' "' . $child->systemId . '"' : '') |
|
1052 | + . '>'; |
|
1053 | 1053 | } |
1054 | 1054 | } |
1055 | 1055 |