Skip to content

Commit 02a27e9

Browse files
committed
修复
1 parent 96bff04 commit 02a27e9

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

src/Struct/ColumnMeta.php

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -108,33 +108,32 @@ public function __call(string $name, array $arguments)
108108
{
109109
if ('getTypeName' === $name)
110110
{
111-
return $this->typeName;
112-
}
113-
elseif ('getTypeValue' === $name)
114-
{
115-
return $this->type;
116-
}
117-
}
118-
119-
/**
120-
* @return mixed
121-
*/
122-
public static function __callStatic(string $name, array $arguments)
123-
{
124-
if ('getTypeName' === $name)
125-
{
126-
return self::TYPE_MAP[$arguments[0] ?? null] ?? null;
111+
if ($arguments)
112+
{
113+
return self::TYPE_MAP[$arguments[0] ?? null] ?? null;
114+
}
115+
else
116+
{
117+
return $this->typeName;
118+
}
127119
}
128120
elseif ('getTypeValue' === $name)
129121
{
130-
$value = array_search($arguments[0] ?? null, self::TYPE_MAP);
131-
if (false === $value)
122+
if ($arguments)
132123
{
133-
return self::TYPE_UNKNOWN;
124+
$value = array_search($arguments[0] ?? null, self::TYPE_MAP);
125+
if (false === $value)
126+
{
127+
return self::TYPE_UNKNOWN;
128+
}
129+
else
130+
{
131+
return $value;
132+
}
134133
}
135134
else
136135
{
137-
return $value;
136+
return $this->type;
138137
}
139138
}
140139
}
@@ -159,15 +158,15 @@ public function getType(): int
159158
public function setType(int $type): self
160159
{
161160
$this->type = $type;
162-
$this->typeName = static::getTypeName($type);
161+
$this->typeName = $this->getTypeName($type);
163162

164163
return $this;
165164
}
166165

167166
public function setTypeName(string $typeName): self
168167
{
169168
$this->typeName = $typeName;
170-
$this->type = static::getTypeValue($typeName);
169+
$this->type = $this->getTypeValue($typeName);
171170

172171
return $this;
173172
}

0 commit comments

Comments
 (0)