This commit is contained in:
2021-03-16 10:46:10 +08:00
parent 21be67ea4e
commit f3947f4542
3 changed files with 11 additions and 15 deletions
+1
View File
@@ -426,6 +426,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
return $this; return $this;
} }
foreach ($param as $key => $val) { foreach ($param as $key => $val) {
var_dump($this->has($key), $key);
if (!$this->has($key)) { if (!$this->has($key)) {
$this->setAttribute($key, $val); $this->setAttribute($key, $val);
} else { } else {
-1
View File
@@ -230,7 +230,6 @@ class Columns extends Component
*/ */
public function hasField(string $name): bool public function hasField(string $name): bool
{ {
var_dump($name, array_key_exists($name, $this->getFields()));
return array_key_exists($name, $this->getFields()); return array_key_exists($name, $this->getFields());
} }
+10 -14
View File
@@ -12,8 +12,6 @@ use HttpServer\Route\Router;
use JetBrains\PhpStorm\Pure; use JetBrains\PhpStorm\Pure;
use Snowflake\Abstracts\Config; use Snowflake\Abstracts\Config;
use Snowflake\Error\Logger; use Snowflake\Error\Logger;
use Snowflake\Exception\ComponentException;
use Snowflake\Exception\NotFindClassException;
use Snowflake\Snowflake; use Snowflake\Snowflake;
use HttpServer\Http\Context; use HttpServer\Http\Context;
use Snowflake\Core\ArrayAccess; use Snowflake\Core\ArrayAccess;
@@ -58,7 +56,7 @@ if (!function_exists('annotation')) {
/** /**
* @return Annotation * @return Annotation
* @throws ComponentException * @throws Exception
*/ */
function annotation(): Annotation function annotation(): Annotation
{ {
@@ -74,9 +72,7 @@ if (!function_exists('recursive_directory')) {
/** /**
* @param DirectoryIterator $file * @param DirectoryIterator $file
* @throws ComponentException * @throws Exception
* @throws ReflectionException
* @throws NotFindClassException
*/ */
function recursive_callback(DirectoryIterator $file) function recursive_callback(DirectoryIterator $file)
{ {
@@ -144,7 +140,7 @@ if (!function_exists('isUrl')) {
* @param bool $get_info * @param bool $get_info
* @return false|array * @return false|array
*/ */
function isUrl($url, $get_info = true) function isUrl($url, $get_info = true): bool|array
{ {
$queryMatch = '/((http[s]?):\/\/)?(([\w\-\_]+\.)+\w+(:\d+)?)(\/.*)?/'; $queryMatch = '/((http[s]?):\/\/)?(([\w\-\_]+\.)+\w+(:\d+)?)(\/.*)?/';
if (!preg_match($queryMatch, $url, $outPut)) { if (!preg_match($queryMatch, $url, $outPut)) {
@@ -273,7 +269,7 @@ if (!function_exists('write')) {
/** /**
* @param string $messages * @param string $messages
* @param string $category * @param string $category
* @throws ComponentException * @throws Exception
*/ */
function write(string $messages, $category = 'app') function write(string $messages, $category = 'app')
{ {
@@ -288,7 +284,7 @@ if (!function_exists('fire')) {
/** /**
* @param string $event * @param string $event
* @param array $params * @param array $params
* @throws ComponentException * @throws Exception
* @throws Exception * @throws Exception
*/ */
function fire(string $event, array $params = []) function fire(string $event, array $params = [])
@@ -305,7 +301,7 @@ if (!function_exists('objectPool')) {
* @param string $className * @param string $className
* @param callable $construct * @param callable $construct
* @return mixed * @return mixed
* @throws ComponentException * @throws Exception
*/ */
function objectPool(mixed $className, callable $construct): mixed function objectPool(mixed $className, callable $construct): mixed
{ {
@@ -319,7 +315,7 @@ if (!function_exists('objectRecover')) {
* @param string $className * @param string $className
* @param $object * @param $object
* @return mixed * @return mixed
* @throws ComponentException * @throws Exception
*/ */
function objectRecover(mixed $className, $object): void function objectRecover(mixed $className, $object): void
{ {
@@ -362,7 +358,7 @@ if (!function_exists('logger')) {
/** /**
* @return Logger * @return Logger
* @throws ComponentException * @throws Exception
*/ */
function logger(): Logger function logger(): Logger
{ {
@@ -530,7 +526,7 @@ if (!function_exists('listen')) {
* @param $callback * @param $callback
* @param $params * @param $params
* @param $isAppend * @param $isAppend
* @throws ComponentException * @throws Exception
* @throws Exception * @throws Exception
*/ */
function listen($name, $callback, $params = [], $isAppend = true) function listen($name, $callback, $params = [], $isAppend = true)
@@ -678,7 +674,7 @@ if (!function_exists('router')) {
/** /**
* @return Router * @return Router
* @throws ComponentException * @throws Exception
*/ */
function router(): Router function router(): Router
{ {