@@ -633,119 +633,119 @@ public static function calPercentageBetweenNumbers(float|int $number = 0, float|
633633 /**
634634 * Check if array has duplicate value
635635 *
636- * @param array $data
636+ * @param array $array
637637 * @return bool
638638 * - true|false
639639 */
640- public static function isArrayDuplicate (?array $ data = [])
640+ public static function isArrayDuplicate (?array $ array = [])
641641 {
642- return Str::arrayDuplicate ($ data );
642+ return Str::arrayDuplicate ($ array );
643643 }
644644
645645 /**
646646 * Check if all values of array is same
647647 *
648- * @param array $data
648+ * @param array $array
649649 * @return bool
650650 * - true|false
651651 */
652- public static function isArraySame (?array $ data = [])
652+ public static function isArraySame (?array $ array = [])
653653 {
654- return Str::arraySame ($ data );
654+ return Str::arraySame ($ array );
655655 }
656656
657657 /**
658658 * For sorting array
659659 *
660- * @param array $data
660+ * @param array $array
661661 * @param string $type
662662 * - [rsort|asort|ksort|arsort|krsort|sort]
663663 *
664664 * @return array
665665 */
666- public static function sortArray (&$ data = [], $ type = 'sort ' )
666+ public static function sortArray (&$ array = [], $ type = 'sort ' )
667667 {
668- // Validate that $data is an array
669- if (!is_array ($ data )) {
668+ // Validate that $array is an array
669+ if (!is_array ($ array )) {
670670 return [];
671671 }
672672
673673 // Perform sorting based on the specified type
674674 switch ($ type ) {
675675 case 'rsort ' :
676- rsort ($ data ); // Sort arrays in descending order
676+ rsort ($ array ); // Sort arrays in descending order
677677 break ;
678678
679679 case 'asort ' :
680- asort ($ data ); // Sort associative arrays in ascending order, according to the value
680+ asort ($ array ); // Sort associative arrays in ascending order, according to the value
681681 break ;
682682
683683 case 'ksort ' :
684- ksort ($ data ); // Sort associative arrays in ascending order, according to the key
684+ ksort ($ array ); // Sort associative arrays in ascending order, according to the key
685685 break ;
686686
687687 case 'arsort ' :
688- arsort ($ data ); // Sort associative arrays in descending order, according to the value
688+ arsort ($ array ); // Sort associative arrays in descending order, according to the value
689689 break ;
690690
691691 case 'krsort ' :
692- krsort ($ data ); // Sort associative arrays in descending order, according to the value
692+ krsort ($ array ); // Sort associative arrays in descending order, according to the value
693693 break ;
694694
695695 default :
696- sort ($ data ); // Sort arrays in ascending order
696+ sort ($ array ); // Sort arrays in ascending order
697697 break ;
698698 }
699699
700- return $ data ;
700+ return $ array ;
701701 }
702702
703703 /**
704704 * For sorting muti-dimentional array
705705 *
706- * @param array $data
706+ * @param array $array
707707 * @param string|null $key
708708 * @param string $type
709709 * - [asc|desc|snum]
710710 *
711711 * @return array
712712 */
713- public static function sortMultipleArray (? array & $ data = [], $ key = null , ? string $ type = 'asc ' )
713+ public static function sortMultipleArray (& $ array = [], $ key = null , $ type = 'asc ' )
714714 {
715- // Check if $data is an array and not empty
716- if (!is_array ($ data ) || empty ($ data )) {
715+ // Check if $array is an array and not empty
716+ if (!is_array ($ array ) || empty ($ array )) {
717717 return [];
718718 }
719719
720720 // Check if $key is provided
721721 // If $key is not provided, return without sorting
722722 if (is_null ($ key )) {
723- return $ data ;
723+ return $ array ;
724724 }
725725
726726 // Extract values of the specified key from each sub-array
727- $ id = array_column ($ data , $ key );
727+ $ id = array_column ($ array , $ key );
728728
729- // Ensure $id and $data have the same size before sorting
730- if (count ($ id ) !== count ($ data )) {
729+ // Ensure $id and $array have the same size before sorting
730+ if (count ($ id ) !== count ($ array )) {
731731 return ;
732732 }
733733
734734 switch ($ type ) {
735735 case 'desc ' :
736- array_multisort ($ id , SORT_DESC , $ data ); //sort associative arrays in descending order
736+ array_multisort ($ id , SORT_DESC , $ array ); //sort associative arrays in descending order
737737 break ;
738738
739739 case 'snum ' :
740- array_multisort ($ id , SORT_NUMERIC , $ data ); //sort associative arrays in numeric order
740+ array_multisort ($ id , SORT_NUMERIC , $ array ); //sort associative arrays in numeric order
741741 break ;
742742
743743 default :
744- array_multisort ($ id , SORT_ASC , $ data ); //sort arrays in ascending order
744+ array_multisort ($ id , SORT_ASC , $ array ); //sort arrays in ascending order
745745 break ;
746746 }
747747
748- return $ data ;
748+ return $ array ;
749749 }
750750
751751 /**
@@ -1263,21 +1263,21 @@ public static function decryptStr($jsonString = null)
12631263 $ openSSL = self ::openSSLEncrypt ();
12641264
12651265 // Decode the JSON string
1266- $ data = Server::toArray ($ jsonString );
1266+ $ array = Server::toArray ($ jsonString );
12671267
1268- if (empty ($ data )) {
1268+ if (empty ($ array )) {
12691269 return ;
12701270 }
12711271
12721272 // Decode base64-encoded IV and encrypted string
1273- $ iv = base64_decode ($ data ['e ' ]);
1274- $ encryptedString = base64_decode ($ data ['s ' ]);
1273+ $ iv = base64_decode ($ array ['e ' ]);
1274+ $ encryptedString = base64_decode ($ array ['s ' ]);
12751275
12761276 // Get encryption settings
12771277 $ openSSL = self ::openSSLEncrypt ();
12781278
12791279 // Store the encryption key
1280- $ key = $ data ['k ' ];
1280+ $ key = $ array ['k ' ];
12811281
12821282 // Decryption
12831283 return openssl_decrypt (
0 commit comments