Browse Source

兼容php7和php8

xaboy 1 year ago
parent
commit
85d6a099e5
2 changed files with 6 additions and 6 deletions
  1. 1 1
      composer.json
  2. 5 5
      src/Driver/CustomComponent.php

+ 1 - 1
composer.json

@@ -27,7 +27,7 @@
     "source": "https://github.com/xaboy/form-builder"
   },
   "require": {
-    "php": ">=5.4.0",
+    "php": ">=7.1",
     "ext-json": "*",
     "symfony/http-foundation": ">=2.6",
     "doctrine/annotations": "^1.2.7"

+ 5 - 5
src/Driver/CustomComponent.php

@@ -94,27 +94,27 @@ class CustomComponent implements CustomComponentInterface, \JsonSerializable, \A
         return $this->appendRule + $this->getRule();
     }
 
-    public function jsonSerialize()
+    public function jsonSerialize(): mixed
     {
         return $this->build();
     }
 
-    public function offsetExists($offset)
+    public function offsetExists($offset): bool
     {
         return isset($this->props[$offset]);
     }
 
-    public function offsetGet($offset)
+    public function offsetGet($offset): mixed
     {
         return $this->props[$offset];
     }
 
-    public function offsetSet($offset, $value)
+    public function offsetSet($offset, $value): void
     {
         $this->props[$offset] = $value;
     }
 
-    public function offsetUnset($offset)
+    public function offsetUnset($offset): void
     {
         unset($this->props[$offset]);
     }