• R/O
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

PHPのフレームワークです。オートローディング、ルーティング、ORマッパ、フォームバリデータ、その他ユーティリティがセットになっています。


Commit MetaInfo

修订版154 (tree)
时间2022-03-22 13:11:05
作者tantancode

Log Message

PHP8.1対応

更改概述

差异

--- lib/IndexerObject.php (revision 153)
+++ lib/IndexerObject.php (revision 154)
@@ -89,7 +89,7 @@
8989 // ArrayAccessの実装。
9090 //-----------------------------------------------------------------------------------------------------
9191
92- public function offsetGet($index) {
92+ public function offsetGet($index): mixed {
9393
9494 // メンバ変数 properties にキーがあるならそれを返す。
9595 if( array_key_exists($index, $this->properties) )
@@ -100,7 +100,7 @@
100100 return $this->properties[$index];
101101 }
102102
103- public function offsetSet($index, $value) {
103+ public function offsetSet($index, $value): void {
104104 if(is_null($index))
105105 $this->properties[] = $value;
106106 else
@@ -107,11 +107,11 @@
107107 $this->properties[$index] = $value;
108108 }
109109
110- public function offsetUnset($index) {
110+ public function offsetUnset($index): void {
111111 unset($this->properties[$index]);
112112 }
113113
114- public function offsetExists($index) {
114+ public function offsetExists($index): bool {
115115 return (null !== @$this[$index]);
116116 }
117117
--- lib/ViewUtil.php (revision 153)
+++ lib/ViewUtil.php (revision 154)
@@ -36,9 +36,10 @@
3636
3737 [$action, $params] = str_snap($serial, '?');
3838
39- parse_str($params, $result);
39+ if( isset($params) ) parse_str($params, $result);
40+ else $result = [];
41+
4042 $result['@'] = $action;
41-
4243 return $result;
4344 }
4445
--- lib/extension/filters/PostValidationFilter.php (revision 153)
+++ lib/extension/filters/PostValidationFilter.php (revision 154)
@@ -17,7 +17,7 @@
1717 protected function preExecuteOnce($action) {
1818
1919 // POSTメソッドでのみ処理する。
20- if(strtolower(@$_SERVER["REQUEST_METHOD"]) != 'post')
20+ if(strtolower($_SERVER["REQUEST_METHOD"] ?? '') != 'post')
2121 return;
2222
2323 // 切断されても中断しないようにする。
--- lib/extension/form/FormContainer.php (revision 153)
+++ lib/extension/form/FormContainer.php (revision 154)
@@ -196,7 +196,7 @@
196196 /**
197197 * offsetGet() をオーバーライド。一部の属性値の取得を特殊な処理にマップする。
198198 */
199- public function offsetGet($index) {
199+ public function offsetGet($index): mixed {
200200
201201 // ここ、stringキャストが入っていないと 0 が文字列とマッチしてしまう。
202202 switch( (string)$index ) {
@@ -244,7 +244,7 @@
244244 /**
245245 * offsetSet() をオーバーライド。input, value, default において、与えられた値のキーを対応する子項目に振り分けるようにする。
246246 */
247- public function offsetSet($index, $value) {
247+ public function offsetSet($index, $value): void {
248248
249249 switch($index) {
250250
--- lib/extension/form/FormItem.php (revision 153)
+++ lib/extension/form/FormItem.php (revision 154)
@@ -317,7 +317,7 @@
317317 /**
318318 * 一部のキーでのアクセスを拡張する。
319319 */
320- public function offsetGet($index) {
320+ public function offsetGet($index): mixed {
321321
322322 switch($index) {
323323
@@ -423,7 +423,7 @@
423423 /**
424424 * オーバーライド。
425425 */
426- public function offsetSet($index, $value) {
426+ public function offsetSet($index, $value): void {
427427
428428 switch($index) {
429429
--- lib/extension/session/PhpSession.php (revision 153)
+++ lib/extension/session/PhpSession.php (revision 154)
@@ -53,7 +53,7 @@
5353 /**
5454 * offsetGet() をオーバーライド。一部のキーは特殊な処理が入る。
5555 */
56- public function offsetGet($index) {
56+ public function offsetGet($index): mixed {
5757
5858 switch($index) {
5959
--- lib/extension/session/SessionStorage.php (revision 153)
+++ lib/extension/session/SessionStorage.php (revision 154)
@@ -37,7 +37,7 @@
3737 * user_id ユーザID。ログインしていない場合は 0。
3838 * operator_code 管理者アカウント名。管理者でない場合はnull。
3939 */
40- // public function offsetGet($index);
40+ // public function offsetGet($index): mixed;
4141 }
4242
4343 // セッションを開始できないことを表す例外。
--- lib/tables/SessionLog.php (revision 153)
+++ lib/tables/SessionLog.php (revision 154)
@@ -202,7 +202,7 @@
202202 /**
203203 * offsetGet() をオーバーライド。一部のキーは特殊な処理が入る。
204204 */
205- public function offsetGet($index) {
205+ public function offsetGet($index): mixed {
206206
207207 switch($index) {
208208
--- lib/tables/database/MojoRecord.php (revision 153)
+++ lib/tables/database/MojoRecord.php (revision 154)
@@ -317,7 +317,7 @@
317317 * レコードが存在しない場合は例外が発生する。これを避けたい場合は load() の戻り値で条件分岐して回避すること。
318318 * また、レコードはあるが値がセットされていないキーを指定した場合は E_USER_NOTICE となる。こちらはエラー抑制演算子(@)で制御できる。
319319 */
320- public function offsetGet($index) {
320+ public function offsetGet($index): mixed {
321321
322322 // 元々レコードにある、あるいは、インスタンスに明示的に設定されたキーならそれを返す。
323323 if( array_key_exists($index, $this->mutation) )
@@ -348,7 +348,7 @@
348348 /**
349349 * 指定されたキーを削除する。
350350 */
351- public function offsetUnset($index) {
351+ public function offsetUnset($index): void {
352352
353353 unset($this->mutation[$index]);
354354 unset($this->imitation[$index]);
--- mojo/Mojo.php (revision 153)
+++ mojo/Mojo.php (revision 154)
@@ -669,7 +669,7 @@
669669 $document = $argv[0];
670670
671671 // コマンドライン第一引数を PATH_INFO とするが、クエリストリングが付いている可能性があるので分離しておく。
672- @list($_SERVER['PATH_INFO'], $query) = explode('?', @$argv[1]);
672+ @[$_SERVER['PATH_INFO'], $query] = explode('?', @$argv[1]);
673673
674674 // "/" で始まっていなかったら補う。
675675 if(strlen($_SERVER['PATH_INFO']) > 0 && $_SERVER['PATH_INFO'][0] != '/')
@@ -676,7 +676,8 @@
676676 $_SERVER['PATH_INFO'] = '/' . $_SERVER['PATH_INFO'];
677677
678678 // クエリストリングは $_GET へ格納。
679- parse_str($query, $_GET);
679+ if( isset($query) )
680+ parse_str($query, $_GET);
680681
681682 // CGIモードで実行している場合は...
682683 }else {
--- mojo/MojoRenderer.php (revision 153)
+++ mojo/MojoRenderer.php (revision 154)
@@ -31,7 +31,7 @@
3131 public function render($view=null) {
3232
3333 // "none" なら何もしない。
34- if(strtolower($view) == 'none')
34+ if(strtolower($view ?? '') == 'none')
3535 return;
3636
3737 // ヘッダがまだ送信されていないなら Content-Type を出力。
@@ -57,11 +57,11 @@
5757 // ArrayAccessの実装。params メンバ変数を入れ物とする。
5858 //-----------------------------------------------------------------------------------------------------
5959
60- public function offsetGet($index) {
60+ public function offsetGet($index): mixed {
6161 return $this->params[$index];
6262 }
6363
64- public function offsetSet($index, $value) {
64+ public function offsetSet($index, $value): void {
6565 if(is_null($index))
6666 $this->params[] = $value;
6767 else
@@ -68,11 +68,11 @@
6868 $this->params[$index] = $value;
6969 }
7070
71- public function offsetUnset($index) {
71+ public function offsetUnset($index): void {
7272 unset($this->params[$index]);
7373 }
7474
75- public function offsetExists($index) {
75+ public function offsetExists($index): bool {
7676 return (null !== @$this[$index]);
7777 }
7878