@@ -41,7 +41,7 @@ class YiiBase
41
41
private static $ _logger ;
42
42
public static function getVersion ()
43
43
{
44
- return '1.1.26-dev ' ;
44
+ return '1.1.26 ' ;
45
45
}
46
46
public static function createWebApplication ($ config =null )
47
47
{
@@ -1972,10 +1972,12 @@ protected function setReadOnly($value)
1972
1972
{
1973
1973
$ this ->_r =$ value ;
1974
1974
}
1975
+ #[ReturnTypeWillChange]
1975
1976
public function getIterator ()
1976
1977
{
1977
1978
return new CMapIterator ($ this ->_d );
1978
1979
}
1980
+ #[ReturnTypeWillChange]
1979
1981
public function count ()
1980
1982
{
1981
1983
return $ this ->getCount ();
@@ -2100,18 +2102,22 @@ public static function mergeArray($a,$b)
2100
2102
}
2101
2103
return $ res ;
2102
2104
}
2105
+ #[ReturnTypeWillChange]
2103
2106
public function offsetExists ($ offset )
2104
2107
{
2105
2108
return $ this ->contains ($ offset );
2106
2109
}
2110
+ #[ReturnTypeWillChange]
2107
2111
public function offsetGet ($ offset )
2108
2112
{
2109
2113
return $ this ->itemAt ($ offset );
2110
2114
}
2115
+ #[ReturnTypeWillChange]
2111
2116
public function offsetSet ($ offset ,$ item )
2112
2117
{
2113
2118
$ this ->add ($ offset ,$ item );
2114
2119
}
2120
+ #[ReturnTypeWillChange]
2115
2121
public function offsetUnset ($ offset )
2116
2122
{
2117
2123
$ this ->remove ($ offset );
@@ -2406,7 +2412,7 @@ public function getRestParams()
2406
2412
if ($ this ->_restParams ===null )
2407
2413
{
2408
2414
$ result =array ();
2409
- if (strncmp ($ this ->getContentType (), 'application/json ' , 16 ) === 0 )
2415
+ if (strncmp (( string ) $ this ->getContentType (), 'application/json ' , 16 ) === 0 )
2410
2416
$ result = CJSON ::decode ($ this ->getRawBody (), $ this ->jsonAsArray );
2411
2417
elseif (function_exists ('mb_parse_str ' ))
2412
2418
mb_parse_str ($ this ->getRawBody (), $ result );
@@ -2722,7 +2728,8 @@ public static function parseAcceptHeader($header)
2722
2728
$ matches =array ();
2723
2729
$ accepts =array ();
2724
2730
// get individual entries with their type, subtype, basetype and params
2725
- preg_match_all ('/(?:\G\s?,\s?|^)(\w+|\*)\/(\w+|\*)(?:\+(\w+))?|(?<!^)\G(?:\s?;\s?(\w+)=([\w\.]+))/ ' ,$ header ,$ matches );
2731
+ if ($ header !==null )
2732
+ preg_match_all ('/(?:\G\s?,\s?|^)(\w+|\*)\/(\w+|\*)(?:\+(\w+))?|(?<!^)\G(?:\s?;\s?(\w+)=([\w\.]+))/ ' ,$ header ,$ matches );
2726
2733
// the regexp should (in theory) always return an array of 6 arrays
2727
2734
if (count ($ matches )===6 )
2728
2735
{
@@ -3312,7 +3319,7 @@ public function createPathInfo($params,$equal,$ampersand, $key=null)
3312
3319
if (is_array ($ v ))
3313
3320
$ pairs []=$ this ->createPathInfo ($ v ,$ equal ,$ ampersand , $ k );
3314
3321
else
3315
- $ pairs []=urlencode ($ k ).$ equal .urlencode ($ v );
3322
+ $ pairs []=urlencode ($ k ).$ equal .urlencode (( string ) $ v );
3316
3323
}
3317
3324
return implode ($ ampersand ,$ pairs );
3318
3325
}
@@ -4826,6 +4833,7 @@ public function gcSession($maxLifetime)
4826
4833
return true ;
4827
4834
}
4828
4835
//------ The following methods enable CHttpSession to be CMap-like -----
4836
+ #[ReturnTypeWillChange]
4829
4837
public function getIterator ()
4830
4838
{
4831
4839
return new CHttpSessionIterator ;
@@ -4834,6 +4842,7 @@ public function getCount()
4834
4842
{
4835
4843
return count ($ _SESSION );
4836
4844
}
4845
+ #[ReturnTypeWillChange]
4837
4846
public function count ()
4838
4847
{
4839
4848
return $ this ->getCount ();
@@ -4878,18 +4887,22 @@ public function toArray()
4878
4887
{
4879
4888
return $ _SESSION ;
4880
4889
}
4890
+ #[ReturnTypeWillChange]
4881
4891
public function offsetExists ($ offset )
4882
4892
{
4883
4893
return isset ($ _SESSION [$ offset ]);
4884
4894
}
4895
+ #[ReturnTypeWillChange]
4885
4896
public function offsetGet ($ offset )
4886
4897
{
4887
4898
return isset ($ _SESSION [$ offset ]) ? $ _SESSION [$ offset ] : null ;
4888
4899
}
4900
+ #[ReturnTypeWillChange]
4889
4901
public function offsetSet ($ offset ,$ item )
4890
4902
{
4891
4903
$ _SESSION [$ offset ]=$ item ;
4892
4904
}
4905
+ #[ReturnTypeWillChange]
4893
4906
public function offsetUnset ($ offset )
4894
4907
{
4895
4908
unset($ _SESSION [$ offset ]);
@@ -4937,7 +4950,7 @@ class CHtml
4937
4950
private static $ _modelNameConverter ;
4938
4951
public static function encode ($ text )
4939
4952
{
4940
- return htmlspecialchars ($ text ,ENT_QUOTES ,Yii::app ()->charset );
4953
+ return htmlspecialchars (( string ) $ text ,ENT_QUOTES ,Yii::app ()->charset );
4941
4954
}
4942
4955
public static function decode ($ text )
4943
4956
{
@@ -5380,7 +5393,7 @@ public static function checkBoxList($name,$select,$data,$htmlOptions=array())
5380
5393
$ checkAll =true ;
5381
5394
foreach ($ data as $ value =>$ labelTitle )
5382
5395
{
5383
- $ checked =!is_array ($ select ) && !strcmp ($ value ,$ select ) || is_array ($ select ) && in_array ($ value ,$ select );
5396
+ $ checked =!is_array ($ select ) && !strcmp ($ value ,( string ) $ select ) || is_array ($ select ) && in_array ($ value ,$ select );
5384
5397
$ checkAll =$ checkAll && $ checked ;
5385
5398
$ htmlOptions ['value ' ]=$ value ;
5386
5399
$ htmlOptions ['id ' ]=$ baseID .'_ ' .$ id ++;
@@ -5455,7 +5468,7 @@ public static function radioButtonList($name,$select,$data,$htmlOptions=array())
5455
5468
$ id =0 ;
5456
5469
foreach ($ data as $ value =>$ labelTitle )
5457
5470
{
5458
- $ checked =!strcmp ($ value ,$ select );
5471
+ $ checked =!strcmp ($ value ,( string ) $ select );
5459
5472
$ htmlOptions ['value ' ]=$ value ;
5460
5473
$ htmlOptions ['id ' ]=$ baseID .'_ ' .$ id ++;
5461
5474
$ option =self ::radioButton ($ name ,$ checked ,$ htmlOptions );
@@ -6034,7 +6047,7 @@ public static function listOptions($selection,$listData,&$htmlOptions)
6034
6047
else
6035
6048
{
6036
6049
$ attributes =array ('value ' =>(string )$ key ,'encode ' =>!$ raw );
6037
- if (!is_array ($ selection ) && !strcmp ($ key ,$ selection ) || is_array ($ selection ) && in_array ($ key ,$ selection ))
6050
+ if (!is_array ($ selection ) && !strcmp ($ key ,( string ) $ selection ) || is_array ($ selection ) && in_array ($ key ,$ selection ))
6038
6051
$ attributes ['selected ' ]='selected ' ;
6039
6052
if (isset ($ options [$ key ]))
6040
6053
$ attributes =array_merge ($ attributes ,$ options [$ key ]);
@@ -6116,7 +6129,7 @@ public static function resolveNameID($model,&$attribute,&$htmlOptions)
6116
6129
public static function resolveName ($ model ,&$ attribute )
6117
6130
{
6118
6131
$ modelName =self ::modelName ($ model );
6119
- if (($ pos =strpos ($ attribute ,'[ ' ))!==false )
6132
+ if (($ pos =strpos (( string ) $ attribute ,'[ ' ))!==false )
6120
6133
{
6121
6134
if ($ pos !==0 ) // e.g. name[a][b]
6122
6135
return $ modelName .'[ ' .substr ($ attribute ,0 ,$ pos ).'] ' .substr ($ attribute ,$ pos );
@@ -6878,10 +6891,12 @@ protected function setReadOnly($value)
6878
6891
{
6879
6892
$ this ->_r =$ value ;
6880
6893
}
6894
+ #[ReturnTypeWillChange]
6881
6895
public function getIterator ()
6882
6896
{
6883
6897
return new CListIterator ($ this ->_d );
6884
6898
}
6899
+ #[ReturnTypeWillChange]
6885
6900
public function count ()
6886
6901
{
6887
6902
return $ this ->getCount ();
@@ -7002,14 +7017,17 @@ public function mergeWith($data)
7002
7017
elseif ($ data !==null )
7003
7018
throw new CException (Yii::t ('yii ' ,'List data must be an array or an object implementing Traversable. ' ));
7004
7019
}
7020
+ #[ReturnTypeWillChange]
7005
7021
public function offsetExists ($ offset )
7006
7022
{
7007
7023
return ($ offset >=0 && $ offset <$ this ->_c );
7008
7024
}
7025
+ #[ReturnTypeWillChange]
7009
7026
public function offsetGet ($ offset )
7010
7027
{
7011
7028
return $ this ->itemAt ($ offset );
7012
7029
}
7030
+ #[ReturnTypeWillChange]
7013
7031
public function offsetSet ($ offset ,$ item )
7014
7032
{
7015
7033
if ($ offset ===null || $ offset ===$ this ->_c )
@@ -7020,6 +7038,7 @@ public function offsetSet($offset,$item)
7020
7038
$ this ->insertAt ($ offset ,$ item );
7021
7039
}
7022
7040
}
7041
+ #[ReturnTypeWillChange]
7023
7042
public function offsetUnset ($ offset )
7024
7043
{
7025
7044
$ this ->removeAt ($ offset );
@@ -7526,23 +7545,28 @@ public function getSafeAttributeNames()
7526
7545
unset($ attributes [$ name ]);
7527
7546
return array_keys ($ attributes );
7528
7547
}
7548
+ #[ReturnTypeWillChange]
7529
7549
public function getIterator ()
7530
7550
{
7531
7551
$ attributes =$ this ->getAttributes ();
7532
7552
return new CMapIterator ($ attributes );
7533
7553
}
7554
+ #[ReturnTypeWillChange]
7534
7555
public function offsetExists ($ offset )
7535
7556
{
7536
7557
return property_exists ($ this ,$ offset );
7537
7558
}
7559
+ #[ReturnTypeWillChange]
7538
7560
public function offsetGet ($ offset )
7539
7561
{
7540
7562
return $ this ->$ offset ;
7541
7563
}
7564
+ #[ReturnTypeWillChange]
7542
7565
public function offsetSet ($ offset ,$ item )
7543
7566
{
7544
7567
$ this ->$ offset =$ item ;
7545
7568
}
7569
+ #[ReturnTypeWillChange]
7546
7570
public function offsetUnset ($ offset )
7547
7571
{
7548
7572
unset($ this ->$ offset );
@@ -8446,6 +8470,7 @@ protected function instantiate($attributes)
8446
8470
$ model =new $ class (null );
8447
8471
return $ model ;
8448
8472
}
8473
+ #[ReturnTypeWillChange]
8449
8474
public function offsetExists ($ offset )
8450
8475
{
8451
8476
return $ this ->__isset ($ offset );
@@ -8825,6 +8850,8 @@ protected function initConnection($pdo)
8825
8850
$ pdo ->setAttribute (PDO ::ATTR_ERRMODE , PDO ::ERRMODE_EXCEPTION );
8826
8851
if ($ this ->emulatePrepare !==null && constant ('PDO::ATTR_EMULATE_PREPARES ' ))
8827
8852
$ pdo ->setAttribute (PDO ::ATTR_EMULATE_PREPARES ,$ this ->emulatePrepare );
8853
+ if (PHP_VERSION_ID >= 80100 && strncasecmp ($ this ->getDriverName (),'sqlite ' ,6 )===0 )
8854
+ $ pdo ->setAttribute (PDO ::ATTR_STRINGIFY_FETCHES , true );
8828
8855
if ($ this ->charset !==null )
8829
8856
{
8830
8857
$ driver =strtolower ($ pdo ->getAttribute (PDO ::ATTR_DRIVER_NAME ));
@@ -10663,22 +10690,27 @@ public function __construct(&$data)
10663
10690
$ this ->_d =&$ data ;
10664
10691
$ this ->_i =0 ;
10665
10692
}
10693
+ #[ReturnTypeWillChange]
10666
10694
public function rewind ()
10667
10695
{
10668
10696
$ this ->_i =0 ;
10669
10697
}
10698
+ #[ReturnTypeWillChange]
10670
10699
public function key ()
10671
10700
{
10672
10701
return $ this ->_i ;
10673
10702
}
10703
+ #[ReturnTypeWillChange]
10674
10704
public function current ()
10675
10705
{
10676
10706
return $ this ->_d [$ this ->_i ];
10677
10707
}
10708
+ #[ReturnTypeWillChange]
10678
10709
public function next ()
10679
10710
{
10680
10711
$ this ->_i ++;
10681
10712
}
10713
+ #[ReturnTypeWillChange]
10682
10714
public function valid ()
10683
10715
{
10684
10716
return $ this ->_i <count ($ this ->_d );
0 commit comments