Skip to content

Commit

Permalink
uses nette/utils 4
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jan 21, 2024
1 parent 89d5a39 commit 2c79b8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"php": "8.1 - 8.3",
"nette/component-model": "^3.0",
"nette/http": "^3.1",
"nette/utils": "^3.2.5 || ~4.0.0"
"nette/utils": "^4.0.4"
},
"require-dev": {
"nette/application": "^3.0",
Expand Down
12 changes: 3 additions & 9 deletions src/Forms/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use Nette;
use Nette\Utils\Html;
use Nette\Utils\Image;
use Nette\Utils\Strings;


Expand Down Expand Up @@ -192,7 +193,7 @@ public static function createInputList(
$input->value = $value;
$res .= ($res === '' && $wrapperEnd === '' ? '' : $wrapper)
. $labelTag . $label->attributes() . '>'
. $inputTag . $input->attributes() . (isset(Html::$xhtml) && Html::$xhtml ? ' />' : '>')
. $inputTag . $input->attributes() . '>'
. ($caption instanceof Nette\HtmlStringable ? $caption : htmlspecialchars((string) $caption, ENT_NOQUOTES, 'UTF-8'))
. '</label>'
. $wrapperEnd;
Expand Down Expand Up @@ -298,13 +299,6 @@ public static function getSingleType($reflection): ?string
/** @internal */
public static function getSupportedImages(): array
{
$flag = imagetypes();
return array_filter([
$flag & IMG_GIF ? 'image/gif' : null,
$flag & IMG_JPG ? 'image/jpeg' : null,
$flag & IMG_PNG ? 'image/png' : null,
$flag & IMG_WEBP ? 'image/webp' : null,
$flag & 256 ? 'image/avif' : null, // IMG_AVIF
]);
return array_map(fn($type) => Image::typeToMimeType($type), Image::getSupportedTypes());
}
}

0 comments on commit 2c79b8b

Please sign in to comment.