2525 */
2626
2727/*
28- Third Party Update by SuperSonic v2.4
29- https://git.io/Jfvrg
30-
31- (c) 2020 SuperSonic (https://github.com/supersonictw)
32- */
28+ * Third Party Update by SuperSonic v2.4
29+ * https://git.io/Jfvrg
30+ *
31+ * (c) 2020 SuperSonic (https://github.com/supersonictw)
32+ */
3333
3434if (!function_exists ('hash_equals ' )) {
3535 defined ('USE_MB_STRING ' ) or define ('USE_MB_STRING ' , function_exists ('mb_strlen ' ));
@@ -692,88 +692,81 @@ private function sign($body)
692692
693693class LINEMSG
694694{
695- public function QuickReply ($ actions )
695+ public static function QuickReply ($ actions )
696696 {
697- $ MsgObject = array (
697+ return array ( " quickReply " => array (
698698 "items " => $ actions ,
699- );
700- return array ("quickReply " => $ MsgObject );
699+ ));
701700 }
702701
703- public function Text ($ msgText )
702+ public static function Text ($ msgText )
704703 {
705- $ MsgObject = array (
704+ return array (
706705 "type " => "text " ,
707706 "text " => $ msgText ,
708707 );
709- return $ MsgObject ;
710708 }
711709
712- public function Sticker ($ packageId , $ stickerId )
710+ public static function Sticker ($ packageId , $ stickerId )
713711 {
714- $ MsgObject = array (
712+ return array (
715713 "type " => "sticker " ,
716714 "packageId " => $ packageId ,
717715 "stickerId " => $ stickerId ,
718716 );
719- return $ MsgObject ;
720717 }
721718
722- public function Image ($ url , $ preview_url = null )
719+ public static function Image ($ url , $ preview_url = null )
723720 {
724721 if ($ preview_url == null ) {
725722 $ preview = $ url ;
726723 } else {
727724 $ preview = $ preview_url ;
728725 }
729726
730- $ MsgObject = array (
727+ return array (
731728 "type " => "image " ,
732729 "originalContentUrl " => $ url ,
733730 "previewImageUrl " => $ preview ,
734731 );
735- return $ MsgObject ;
736732 }
737733
738- public function Video ($ url , $ preview_url )
734+ public static function Video ($ url , $ preview_url )
739735 {
740- $ MsgObject = array (
736+ return array (
741737 "type " => "video " ,
742738 "originalContentUrl " => $ url ,
743739 "previewImageUrl " => $ preview_url ,
744740 );
745- return $ MsgObject ;
746741 }
747742
748- public function Audio ($ url , $ second = null )
743+ public static function Audio ($ url , $ second = null )
749744 {
750745 if ($ second == null ) {
751746 $ seconds = 0 ;
752747 } else {
753748 $ seconds = $ second ;
754749 }
755750
756- $ MsgObject = array (
751+ return array (
757752 "type " => "audio " ,
758753 "originalContentUrl " => $ url ,
759754 "duration " => $ seconds ,
760755 );
761- return $ MsgObject ;
762756 }
763757
764- public function Location ($ title , $ address , $ latitude , $ longitude )
758+ public static function Location ($ title , $ address , $ latitude , $ longitude )
765759 {
766- $ MsgObject = array (
760+ return array (
767761 "type " => "location " ,
768762 "title " => $ title ,
769763 "address " => $ address ,
770764 "latitude " => $ latitude ,
771765 "longitude " => $ longitude ,
772766 );
773- return $ MsgObject ;
774767 }
775768
776- public function Imagemap ($ baseUrl , $ altText , $ width , $ height , $ action )
769+ public static function Imagemap ($ baseUrl , $ altText , $ width , $ height , $ action )
777770 {
778771 if (isset ($ action ["type " ])) {
779772 $ actions = array ($ action );
@@ -787,44 +780,41 @@ public function Imagemap($baseUrl, $altText, $width, $height, $action)
787780 "width " => $ width ,
788781 "height " => $ height ,
789782 );
790- $ MsgObject = array (
783+ return array (
791784 "type " => "imagemap " ,
792785 "baseUrl " => $ baseUrl ,
793786 "altText " => $ altText ,
794787 "baseSize " => $ baseSize ,
795788 "actions " => $ actions ,
796789 );
797- return $ MsgObject ;
798790 }
799791
800- public function Template ($ altText , $ template )
792+ public static function Template ($ altText , $ template )
801793 {
802794 foreach ($ template as $ num => $ var ) {
803795 if ($ var == null ) {
804796 unset($ template [$ num ]);
805797 }
806798 }
807- $ MsgObject = array (
799+ return array (
808800 "type " => "template " ,
809801 "altText " => $ altText ,
810802 "template " => $ template ,
811803 );
812- return $ MsgObject ;
813804 }
814805
815- public function Flex ($ altText , $ contents )
806+ public static function Flex ($ altText , $ contents )
816807 {
817808 foreach ($ contents as $ num => $ var ) {
818809 if ($ var == null ) {
819810 unset($ contents [$ num ]);
820811 }
821812 }
822- $ MsgObject = array (
813+ return array (
823814 "type " => "flex " ,
824815 "altText " => $ altText ,
825816 "contents " => $ contents ,
826817 );
827- return $ MsgObject ;
828818 }
829819}
830820
0 commit comments