Conditions | 100 |
Paths | > 20000 |
Total Lines | 502 |
Code Lines | 334 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
637 | public static function finishCurrentSpan(string &$result, bool $theEnd = false): void |
||
638 | { |
||
639 | $textSpan = substr($result, self::$posSpanStart); |
||
640 | $result = substr($result, 0, self::$posSpanStart); |
||
641 | |||
642 | // Get rid of empty spans, so that our check for presence of RTL will work |
||
643 | $result = str_replace([ |
||
644 | self::START_LTR . self::END_LTR, |
||
645 | self::START_RTL . self::END_RTL, |
||
646 | ], '', $result); |
||
647 | |||
648 | // Look for numeric strings that are times (hh:mm:ss). These have to be separated from surrounding numbers. |
||
649 | $tempResult = ''; |
||
650 | while ($textSpan !== '') { |
||
651 | $posColon = strpos($textSpan, ':'); |
||
652 | if ($posColon === false) { |
||
653 | break; |
||
654 | } // No more possible time strings |
||
655 | $posLRE = strpos($textSpan, self::UTF8_LRE); |
||
656 | if ($posLRE === false) { |
||
657 | break; |
||
658 | } // No more numeric strings |
||
659 | $posPDF = strpos($textSpan, self::UTF8_PDF, $posLRE); |
||
660 | if ($posPDF === false) { |
||
661 | break; |
||
662 | } // No more numeric strings |
||
663 | |||
664 | $tempResult .= substr($textSpan, 0, $posLRE + 3); // Copy everything preceding the numeric string |
||
665 | $numericString = substr($textSpan, $posLRE + 3, $posPDF - $posLRE); // Separate the entire numeric string |
||
666 | $textSpan = substr($textSpan, $posPDF + 3); |
||
667 | $posColon = strpos($numericString, ':'); |
||
668 | if ($posColon === false) { |
||
669 | // Nothing that looks like a time here |
||
670 | $tempResult .= $numericString; |
||
671 | continue; |
||
672 | } |
||
673 | $posBlank = strpos($numericString . ' ', ' '); |
||
674 | $posNbsp = strpos($numericString . ' ', ' '); |
||
675 | if ($posBlank < $posNbsp) { |
||
676 | $posSeparator = $posBlank; |
||
677 | $lengthSeparator = 1; |
||
678 | } else { |
||
679 | $posSeparator = $posNbsp; |
||
680 | $lengthSeparator = 6; |
||
681 | } |
||
682 | if ($posColon > $posSeparator) { |
||
683 | // We have a time string preceded by a blank: Exclude that blank from the numeric string |
||
684 | $tempResult .= substr($numericString, 0, $posSeparator); |
||
685 | $tempResult .= self::UTF8_PDF; |
||
686 | $tempResult .= substr($numericString, $posSeparator, $lengthSeparator); |
||
687 | $tempResult .= self::UTF8_LRE; |
||
688 | $numericString = substr($numericString, $posSeparator + $lengthSeparator); |
||
689 | } |
||
690 | |||
691 | $posBlank = strpos($numericString, ' '); |
||
692 | $posNbsp = strpos($numericString, ' '); |
||
693 | if ($posBlank === false && $posNbsp === false) { |
||
694 | // The time string isn't followed by a blank |
||
695 | $textSpan = $numericString . $textSpan; |
||
696 | continue; |
||
697 | } |
||
698 | |||
699 | // We have a time string followed by a blank: Exclude that blank from the numeric string |
||
700 | if ($posBlank === false) { |
||
701 | $posSeparator = $posNbsp; |
||
702 | $lengthSeparator = 6; |
||
703 | } elseif ($posNbsp === false) { |
||
704 | $posSeparator = $posBlank; |
||
705 | $lengthSeparator = 1; |
||
706 | } elseif ($posBlank < $posNbsp) { |
||
707 | $posSeparator = $posBlank; |
||
708 | $lengthSeparator = 1; |
||
709 | } else { |
||
710 | $posSeparator = $posNbsp; |
||
711 | $lengthSeparator = 6; |
||
712 | } |
||
713 | $tempResult .= substr($numericString, 0, $posSeparator); |
||
714 | $tempResult .= self::UTF8_PDF; |
||
715 | $tempResult .= substr($numericString, $posSeparator, $lengthSeparator); |
||
716 | $posSeparator += $lengthSeparator; |
||
717 | $numericString = substr($numericString, $posSeparator); |
||
718 | $textSpan = self::UTF8_LRE . $numericString . $textSpan; |
||
719 | } |
||
720 | $textSpan = $tempResult . $textSpan; |
||
721 | $trailingBlanks = ''; |
||
722 | $trailingBreaks = ''; |
||
723 | |||
724 | /* ****************************** LTR text handling ******************************** */ |
||
725 | |||
726 | if (self::$currentState === 'LTR') { |
||
727 | // Move trailing numeric strings to the following RTL text. Include any blanks preceding or following the numeric text too. |
||
728 | if (I18N::direction() === 'rtl' && self::$previousState === 'RTL' && !$theEnd) { |
||
729 | $trailingString = ''; |
||
730 | $savedSpan = $textSpan; |
||
731 | while ($textSpan !== '') { |
||
732 | // Look for trailing spaces and tentatively move them |
||
733 | if (substr($textSpan, -1) === ' ') { |
||
734 | $trailingString = ' ' . $trailingString; |
||
735 | $textSpan = substr($textSpan, 0, -1); |
||
736 | continue; |
||
737 | } |
||
738 | if (substr($textSpan, -6) === ' ') { |
||
739 | $trailingString = ' ' . $trailingString; |
||
740 | $textSpan = substr($textSpan, 0, -1); |
||
741 | continue; |
||
742 | } |
||
743 | if (substr($textSpan, -3) !== self::UTF8_PDF) { |
||
744 | // There is no trailing numeric string |
||
745 | $textSpan = $savedSpan; |
||
746 | break; |
||
747 | } |
||
748 | |||
749 | // We have a numeric string |
||
750 | $posStartNumber = strrpos($textSpan, self::UTF8_LRE); |
||
751 | if ($posStartNumber === false) { |
||
752 | $posStartNumber = 0; |
||
753 | } |
||
754 | $trailingString = substr($textSpan, $posStartNumber) . $trailingString; |
||
755 | $textSpan = substr($textSpan, 0, $posStartNumber); |
||
756 | |||
757 | // Look for more spaces and move them too |
||
758 | while ($textSpan !== '') { |
||
759 | if (substr($textSpan, -1) === ' ') { |
||
760 | $trailingString = ' ' . $trailingString; |
||
761 | $textSpan = substr($textSpan, 0, -1); |
||
762 | continue; |
||
763 | } |
||
764 | if (substr($textSpan, -6) === ' ') { |
||
765 | $trailingString = ' ' . $trailingString; |
||
766 | $textSpan = substr($textSpan, 0, -1); |
||
767 | continue; |
||
768 | } |
||
769 | break; |
||
770 | } |
||
771 | |||
772 | self::$waitingText = $trailingString . self::$waitingText; |
||
773 | break; |
||
774 | } |
||
775 | } |
||
776 | |||
777 | $savedSpan = $textSpan; |
||
778 | // Move any trailing <br>, optionally preceded or followed by blanks, outside this LTR span |
||
779 | while ($textSpan !== '') { |
||
780 | if (substr($textSpan, -1) === ' ') { |
||
781 | $trailingBlanks = ' ' . $trailingBlanks; |
||
782 | $textSpan = substr($textSpan, 0, -1); |
||
783 | continue; |
||
784 | } |
||
785 | if (substr('......' . $textSpan, -6) === ' ') { |
||
786 | $trailingBlanks = ' ' . $trailingBlanks; |
||
787 | $textSpan = substr($textSpan, 0, -6); |
||
788 | continue; |
||
789 | } |
||
790 | break; |
||
791 | } |
||
792 | while (substr($textSpan, -7) === '<LTRbr>') { |
||
793 | $trailingBreaks = '<br>' . $trailingBreaks; // Plain <br> because it’s outside a span |
||
794 | $textSpan = substr($textSpan, 0, -7); |
||
795 | } |
||
796 | if ($trailingBreaks !== '') { |
||
797 | while ($textSpan !== '') { |
||
798 | if (substr($textSpan, -1) === ' ') { |
||
799 | $trailingBreaks = ' ' . $trailingBreaks; |
||
800 | $textSpan = substr($textSpan, 0, -1); |
||
801 | continue; |
||
802 | } |
||
803 | if (substr($textSpan, -6) === ' ') { |
||
804 | $trailingBreaks = ' ' . $trailingBreaks; |
||
805 | $textSpan = substr($textSpan, 0, -6); |
||
806 | continue; |
||
807 | } |
||
808 | break; |
||
809 | } |
||
810 | self::$waitingText = $trailingBlanks . self::$waitingText; // Put those trailing blanks inside the following span |
||
811 | } else { |
||
812 | $textSpan = $savedSpan; |
||
813 | } |
||
814 | |||
815 | $trailingBlanks = ''; |
||
816 | $trailingPunctuation = ''; |
||
817 | $trailingID = ''; |
||
818 | $trailingSeparator = ''; |
||
819 | $leadingSeparator = ''; |
||
820 | |||
821 | while (I18N::direction() === 'rtl') { |
||
822 | if (str_contains($result, self::START_RTL)) { |
||
823 | // Remove trailing blanks for inclusion in a separate LTR span |
||
824 | while ($textSpan !== '') { |
||
825 | if (substr($textSpan, -1) === ' ') { |
||
826 | $trailingBlanks = ' ' . $trailingBlanks; |
||
827 | $textSpan = substr($textSpan, 0, -1); |
||
828 | continue; |
||
829 | } |
||
830 | if (substr($textSpan, -6) === ' ') { |
||
831 | $trailingBlanks = ' ' . $trailingBlanks; |
||
832 | $textSpan = substr($textSpan, 0, -1); |
||
833 | continue; |
||
834 | } |
||
835 | break; |
||
836 | } |
||
837 | |||
838 | // Remove trailing punctuation for inclusion in a separate LTR span |
||
839 | if ($textSpan === '') { |
||
840 | $trailingChar = "\n"; |
||
841 | } else { |
||
842 | $trailingChar = substr($textSpan, -1); |
||
843 | } |
||
844 | if (str_contains(self::PUNCTUATION, $trailingChar)) { |
||
845 | $trailingPunctuation = $trailingChar; |
||
846 | $textSpan = substr($textSpan, 0, -1); |
||
847 | } |
||
848 | } |
||
849 | |||
850 | // Remove trailing ID numbers that look like "(xnnn)" for inclusion in a separate LTR span |
||
851 | while (true) { |
||
852 | if (substr($textSpan, -1) !== ')') { |
||
853 | break; |
||
854 | } // There is no trailing ')' |
||
855 | $posLeftParen = strrpos($textSpan, '('); |
||
856 | if ($posLeftParen === false) { |
||
857 | break; |
||
858 | } // There is no leading '(' |
||
859 | $temp = self::stripLrmRlm(substr($textSpan, $posLeftParen)); // Get rid of UTF8 control codes |
||
860 | |||
861 | // If the parenthesized text doesn't look like an ID number, |
||
862 | // we don't want to touch it. |
||
863 | // This check won’t work if somebody uses ID numbers with an unusual format. |
||
864 | $offset = 1; |
||
865 | $charArray = self::getChar($temp, $offset); // Get 1st character of parenthesized text |
||
866 | if (str_contains(self::NUMBERS, $charArray['letter'])) { |
||
867 | break; |
||
868 | } |
||
869 | $offset += $charArray['length']; // Point at 2nd character of parenthesized text |
||
870 | if (!str_contains(self::NUMBERS, substr($temp, $offset, 1))) { |
||
871 | break; |
||
872 | } |
||
873 | // 1st character of parenthesized text is alpha, 2nd character is a digit; last has to be a digit too |
||
874 | if (!str_contains(self::NUMBERS, substr($temp, -2, 1))) { |
||
875 | break; |
||
876 | } |
||
877 | |||
878 | $trailingID = substr($textSpan, $posLeftParen); |
||
879 | $textSpan = substr($textSpan, 0, $posLeftParen); |
||
880 | break; |
||
881 | } |
||
882 | |||
883 | // Look for " - " or blank preceding the ID number and remove it for inclusion in a separate LTR span |
||
884 | if ($trailingID !== '') { |
||
885 | while ($textSpan !== '') { |
||
886 | if (substr($textSpan, -1) === ' ') { |
||
887 | $trailingSeparator = ' ' . $trailingSeparator; |
||
888 | $textSpan = substr($textSpan, 0, -1); |
||
889 | continue; |
||
890 | } |
||
891 | if (substr($textSpan, -6) === ' ') { |
||
892 | $trailingSeparator = ' ' . $trailingSeparator; |
||
893 | $textSpan = substr($textSpan, 0, -6); |
||
894 | continue; |
||
895 | } |
||
896 | if (substr($textSpan, -1) === '-') { |
||
897 | $trailingSeparator = '-' . $trailingSeparator; |
||
898 | $textSpan = substr($textSpan, 0, -1); |
||
899 | continue; |
||
900 | } |
||
901 | break; |
||
902 | } |
||
903 | } |
||
904 | |||
905 | // Look for " - " preceding the text and remove it for inclusion in a separate LTR span |
||
906 | $foundSeparator = false; |
||
907 | $savedSpan = $textSpan; |
||
908 | while ($textSpan !== '') { |
||
909 | if (substr($textSpan, 0, 1) === ' ') { |
||
910 | $leadingSeparator = ' ' . $leadingSeparator; |
||
911 | $textSpan = substr($textSpan, 1); |
||
912 | continue; |
||
913 | } |
||
914 | if (substr($textSpan, 0, 6) === ' ') { |
||
915 | $leadingSeparator = ' ' . $leadingSeparator; |
||
916 | $textSpan = substr($textSpan, 6); |
||
917 | continue; |
||
918 | } |
||
919 | if (substr($textSpan, 0, 1) === '-') { |
||
920 | $leadingSeparator = '-' . $leadingSeparator; |
||
921 | $textSpan = substr($textSpan, 1); |
||
922 | $foundSeparator = true; |
||
923 | continue; |
||
924 | } |
||
925 | break; |
||
926 | } |
||
927 | if (!$foundSeparator) { |
||
928 | $textSpan = $savedSpan; |
||
929 | $leadingSeparator = ''; |
||
930 | } |
||
931 | break; |
||
932 | } |
||
933 | |||
934 | // We're done: finish the span |
||
935 | $textSpan = self::starredName($textSpan, 'LTR'); // Wrap starred name in <u> and </u> tags |
||
936 | while (true) { |
||
937 | // Remove blanks that precede <LTRbr> |
||
938 | if (str_contains($textSpan, ' <LTRbr>')) { |
||
939 | $textSpan = str_replace(' <LTRbr>', '<LTRbr>', $textSpan); |
||
940 | continue; |
||
941 | } |
||
942 | if (str_contains($textSpan, ' <LTRbr>')) { |
||
943 | $textSpan = str_replace(' <LTRbr>', '<LTRbr>', $textSpan); |
||
944 | continue; |
||
945 | } |
||
946 | break; |
||
947 | } |
||
948 | if ($leadingSeparator !== '') { |
||
949 | $result .= self::START_LTR . $leadingSeparator . self::END_LTR; |
||
950 | } |
||
951 | $result .= $textSpan . self::END_LTR; |
||
952 | if ($trailingSeparator !== '') { |
||
953 | $result .= self::START_LTR . $trailingSeparator . self::END_LTR; |
||
954 | } |
||
955 | if ($trailingID !== '') { |
||
956 | $result .= self::START_LTR . $trailingID . self::END_LTR; |
||
957 | } |
||
958 | if ($trailingPunctuation !== '') { |
||
959 | $result .= self::START_LTR . $trailingPunctuation . self::END_LTR; |
||
960 | } |
||
961 | if ($trailingBlanks !== '') { |
||
962 | $result .= self::START_LTR . $trailingBlanks . self::END_LTR; |
||
963 | } |
||
964 | } |
||
965 | |||
966 | /* ****************************** RTL text handling ******************************** */ |
||
967 | |||
968 | if (self::$currentState === 'RTL') { |
||
969 | $savedSpan = $textSpan; |
||
970 | |||
971 | // Move any trailing <br>, optionally followed by blanks, outside this RTL span |
||
972 | while ($textSpan !== '') { |
||
973 | if (substr($textSpan, -1) === ' ') { |
||
974 | $trailingBlanks = ' ' . $trailingBlanks; |
||
975 | $textSpan = substr($textSpan, 0, -1); |
||
976 | continue; |
||
977 | } |
||
978 | if (substr('......' . $textSpan, -6) === ' ') { |
||
979 | $trailingBlanks = ' ' . $trailingBlanks; |
||
980 | $textSpan = substr($textSpan, 0, -6); |
||
981 | continue; |
||
982 | } |
||
983 | break; |
||
984 | } |
||
985 | while (substr($textSpan, -7) === '<RTLbr>') { |
||
986 | $trailingBreaks = '<br>' . $trailingBreaks; // Plain <br> because it’s outside a span |
||
987 | $textSpan = substr($textSpan, 0, -7); |
||
988 | } |
||
989 | if ($trailingBreaks !== '') { |
||
990 | self::$waitingText = $trailingBlanks . self::$waitingText; // Put those trailing blanks inside the following span |
||
991 | } else { |
||
992 | $textSpan = $savedSpan; |
||
993 | } |
||
994 | |||
995 | // Move trailing numeric strings to the following LTR text. Include any blanks preceding or following the numeric text too. |
||
996 | if (!$theEnd && I18N::direction() !== 'rtl') { |
||
997 | $trailingString = ''; |
||
998 | $savedSpan = $textSpan; |
||
999 | while ($textSpan !== '') { |
||
1000 | // Look for trailing spaces and tentatively move them |
||
1001 | if (substr($textSpan, -1) === ' ') { |
||
1002 | $trailingString = ' ' . $trailingString; |
||
1003 | $textSpan = substr($textSpan, 0, -1); |
||
1004 | continue; |
||
1005 | } |
||
1006 | if (substr($textSpan, -6) === ' ') { |
||
1007 | $trailingString = ' ' . $trailingString; |
||
1008 | $textSpan = substr($textSpan, 0, -1); |
||
1009 | continue; |
||
1010 | } |
||
1011 | if (substr($textSpan, -3) !== self::UTF8_PDF) { |
||
1012 | // There is no trailing numeric string |
||
1013 | $textSpan = $savedSpan; |
||
1014 | break; |
||
1015 | } |
||
1016 | |||
1017 | // We have a numeric string |
||
1018 | $posStartNumber = strrpos($textSpan, self::UTF8_LRE); |
||
1019 | if ($posStartNumber === false) { |
||
1020 | $posStartNumber = 0; |
||
1021 | } |
||
1022 | $trailingString = substr($textSpan, $posStartNumber) . $trailingString; |
||
1023 | $textSpan = substr($textSpan, 0, $posStartNumber); |
||
1024 | |||
1025 | // Look for more spaces and move them too |
||
1026 | while ($textSpan !== '') { |
||
1027 | if (substr($textSpan, -1) === ' ') { |
||
1028 | $trailingString = ' ' . $trailingString; |
||
1029 | $textSpan = substr($textSpan, 0, -1); |
||
1030 | continue; |
||
1031 | } |
||
1032 | if (substr($textSpan, -6) === ' ') { |
||
1033 | $trailingString = ' ' . $trailingString; |
||
1034 | $textSpan = substr($textSpan, 0, -1); |
||
1035 | continue; |
||
1036 | } |
||
1037 | break; |
||
1038 | } |
||
1039 | |||
1040 | self::$waitingText = $trailingString . self::$waitingText; |
||
1041 | break; |
||
1042 | } |
||
1043 | } |
||
1044 | |||
1045 | // Trailing " - " needs to be prefixed to the following span |
||
1046 | if (!$theEnd && substr('...' . $textSpan, -3) === ' - ') { |
||
1047 | $textSpan = substr($textSpan, 0, -3); |
||
1048 | self::$waitingText = ' - ' . self::$waitingText; |
||
1049 | } |
||
1050 | |||
1051 | while (I18N::direction() === 'rtl') { |
||
1052 | // Look for " - " preceding <RTLbr> and relocate it to the front of the string |
||
1053 | $posDashString = strpos($textSpan, ' - <RTLbr>'); |
||
1054 | if ($posDashString === false) { |
||
1055 | break; |
||
1056 | } |
||
1057 | $posStringStart = strrpos(substr($textSpan, 0, $posDashString), '<RTLbr>'); |
||
1058 | if ($posStringStart === false) { |
||
1059 | $posStringStart = 0; |
||
1060 | } else { |
||
1061 | $posStringStart += 9; |
||
1062 | } // Point to the first char following the last <RTLbr> |
||
1063 | |||
1064 | $textSpan = substr($textSpan, 0, $posStringStart) . ' - ' . substr($textSpan, $posStringStart, $posDashString - $posStringStart) . substr($textSpan, $posDashString + 3); |
||
1065 | } |
||
1066 | |||
1067 | // Strip leading spaces from the RTL text |
||
1068 | $countLeadingSpaces = 0; |
||
1069 | while ($textSpan !== '') { |
||
1070 | if (substr($textSpan, 0, 1) === ' ') { |
||
1071 | $countLeadingSpaces++; |
||
1072 | $textSpan = substr($textSpan, 1); |
||
1073 | continue; |
||
1074 | } |
||
1075 | if (substr($textSpan, 0, 6) === ' ') { |
||
1076 | $countLeadingSpaces++; |
||
1077 | $textSpan = substr($textSpan, 6); |
||
1078 | continue; |
||
1079 | } |
||
1080 | break; |
||
1081 | } |
||
1082 | |||
1083 | // Strip trailing spaces from the RTL text |
||
1084 | $countTrailingSpaces = 0; |
||
1085 | while ($textSpan !== '') { |
||
1086 | if (substr($textSpan, -1) === ' ') { |
||
1087 | $countTrailingSpaces++; |
||
1088 | $textSpan = substr($textSpan, 0, -1); |
||
1089 | continue; |
||
1090 | } |
||
1091 | if (substr($textSpan, -6) === ' ') { |
||
1092 | $countTrailingSpaces++; |
||
1093 | $textSpan = substr($textSpan, 0, -6); |
||
1094 | continue; |
||
1095 | } |
||
1096 | break; |
||
1097 | } |
||
1098 | |||
1099 | // Look for trailing " -", reverse it, and relocate it to the front of the string |
||
1100 | if (substr($textSpan, -2) === ' -') { |
||
1101 | $posDashString = strlen($textSpan) - 2; |
||
1102 | $posStringStart = strrpos(substr($textSpan, 0, $posDashString), '<RTLbr>'); |
||
1103 | if ($posStringStart === false) { |
||
1104 | $posStringStart = 0; |
||
1105 | } else { |
||
1106 | $posStringStart += 9; |
||
1107 | } // Point to the first char following the last <RTLbr> |
||
1108 | |||
1109 | $textSpan = substr($textSpan, 0, $posStringStart) . '- ' . substr($textSpan, $posStringStart, $posDashString - $posStringStart) . substr($textSpan, $posDashString + 2); |
||
1110 | } |
||
1111 | |||
1112 | if ($countLeadingSpaces !== 0) { |
||
1113 | $newLength = strlen($textSpan) + $countLeadingSpaces; |
||
1114 | $textSpan = str_pad($textSpan, $newLength, ' ', (I18N::direction() === 'rtl' ? STR_PAD_LEFT : STR_PAD_RIGHT)); |
||
1115 | } |
||
1116 | if ($countTrailingSpaces !== 0) { |
||
1117 | if (I18N::direction() === 'ltr') { |
||
1118 | if ($trailingBreaks === '') { |
||
1119 | // Move trailing RTL spaces to front of following LTR span |
||
1120 | $newLength = strlen(self::$waitingText) + $countTrailingSpaces; |
||
1121 | self::$waitingText = str_pad(self::$waitingText, $newLength, ' ', STR_PAD_LEFT); |
||
1122 | } |
||
1123 | } else { |
||
1124 | $newLength = strlen($textSpan) + $countTrailingSpaces; |
||
1125 | $textSpan = str_pad($textSpan, $newLength, ' '); |
||
1126 | } |
||
1127 | } |
||
1128 | |||
1129 | // We're done: finish the span |
||
1130 | $textSpan = self::starredName($textSpan, 'RTL'); // Wrap starred name in <u> and </u> tags |
||
1131 | $result .= $textSpan . self::END_RTL; |
||
1132 | } |
||
1133 | |||
1134 | if (self::$currentState !== 'LTR' && self::$currentState !== 'RTL') { |
||
1135 | $result .= $textSpan; |
||
1136 | } |
||
1137 | |||
1138 | $result .= $trailingBreaks; // Get rid of any waiting <br> |
||
1139 | } |
||
1194 |