Skip to content

Commit

Permalink
兼容性调整
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Oct 16, 2024
1 parent af703e2 commit 0b88bd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public function get(string $name = '')
* @param callable|null $callback 解析规则回调
* @return void
*/
public function extend(string $rule, callable $callback = null): void
public function extend(string $rule, ?callable $callback = null): void
{
$this->extend[$rule] = $callback;
}
Expand Down Expand Up @@ -808,7 +808,7 @@ public function parseTagLib(string $tagLib, string &$content, bool $hide = false
* @param string|null $name 不为空时返回指定的属性名
* @return array
*/
public function parseAttr(string $str, string $name = null): array
public function parseAttr(string $str, ?string $name = null): array
{
$regex = '/\s+(?>(?P<name>[\w-]+)\s*)=(?>\s*)([\"\'])(?P<value>(?:(?!\\2).)*)\\2/is';
$array = [];
Expand Down

0 comments on commit 0b88bd4

Please sign in to comment.