Skip to content

Commit

Permalink
完善 8.0支持
Browse files Browse the repository at this point in the history
  • Loading branch information
iwillhappy1314 committed Feb 13, 2023
1 parent 3e776b2 commit 4fb0982
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Controls/DatePickerInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ public function getControl(): Html
});
</script>";

return $el . $script;
return $el->addHtml($script);
}
}
6 changes: 3 additions & 3 deletions src/Renders/AdminFormRender.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class AdminFormRender extends BaseFormRender
{
use Nette\SmartObject;

var $type = 'post_meta';
var mixed $type = 'post_meta';

public function __construct($type = 'post_meta')
{
Expand Down Expand Up @@ -44,11 +44,11 @@ public function __construct($type = 'post_meta')
/**
* 渲染一行
*
* @param \Nette\Forms\IControl $control
* @param \Nette\Forms\Control $control
*
* @return string
*/
public function renderPair(Nette\Forms\IControl $control)
public function renderPair(Nette\Forms\Control $control): string
{
$pair = $this->getWrapper('pair container');
$pair->addHtml($this->renderLabel($control));
Expand Down
4 changes: 2 additions & 2 deletions src/Renders/BaseFormRender.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function renderPairMulti(array $controls): string
{
$s = [];
foreach ($controls as $control) {
if ( ! $control instanceof Nette\Forms\IControl) {
if ( ! $control instanceof Nette\Forms\Control) {
throw new Nette\InvalidArgumentException('Argument must be array of Nette\Forms\IControl instances.');
}

Expand Down Expand Up @@ -161,7 +161,7 @@ public function renderPairMulti(array $controls): string
*
* @return \Nette\Utils\Html|string
*/
public function renderControlGroup($control)
public function renderControlGroup($control): Html|string
{
$html = '';

Expand Down
8 changes: 4 additions & 4 deletions src/Renders/FormRender.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Nette;
use Nette\Utils\Html;
use Nette\Utils\IHtmlString;
use Nette\HtmlStringable;

/**
* 转到表单到 HTML 输出
Expand Down Expand Up @@ -119,7 +119,7 @@ class FormRender extends Nette\Forms\Rendering\DefaultFormRenderer
*
* @return string
*/
public function renderControls($parent)
public function renderControls($parent): string
{
if ( ! ($parent instanceof Nette\Forms\Container || $parent instanceof Nette\Forms\ControlGroup)) {
throw new Nette\InvalidArgumentException('Argument must be Nette\Forms\Container or Nette\Forms\ControlGroup instance.');
Expand Down Expand Up @@ -249,7 +249,7 @@ public function renderPair(Nette\Forms\Control $control): string
*
* @return string
*/
public function renderPairMulti(array $controls) :string
public function renderPairMulti(array $controls): string
{
$s = [];
foreach ($controls as $control) {
Expand All @@ -259,7 +259,7 @@ public function renderPairMulti(array $controls) :string

$description = $control->getOption('description');

if ($description instanceof IHtmlString) {
if ($description instanceof HtmlStringable) {

$description = ' ' . $description;

Expand Down

0 comments on commit 4fb0982

Please sign in to comment.