Skip to content

Commit

Permalink
used native PHP 8 functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jul 28, 2021
1 parent baff035 commit 583cc1b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Forms/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ public function __call(string $name, array $args)

public static function extensionMethod(string $name, /*callable*/ $callback): void
{
if (strpos($name, '::') !== false) { // back compatibility
if (str_contains($name, '::')) { // back compatibility
[, $name] = explode('::', $name);
}
self::$extMethods[$name] = $callback;
Expand Down
2 changes: 1 addition & 1 deletion src/Forms/Controls/BaseControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ public function __call(string $name, array $args)

public static function extensionMethod(string $name, /*callable*/ $callback): void
{
if (strpos($name, '::') !== false) { // back compatibility
if (str_contains($name, '::')) { // back compatibility
[, $name] = explode('::', $name);
}
self::$extMethods[$name][static::class] = $callback;
Expand Down
2 changes: 1 addition & 1 deletion src/Forms/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static function extractHttpData(
$data = Nette\Utils\Arrays::get($data, $name, null);
$itype = $type & ~Form::DATA_KEYS;

if (substr($htmlName, -2) === '[]') {
if (str_ends_with($htmlName, '[]')) {
if (!is_array($data)) {
return [];
}
Expand Down

0 comments on commit 583cc1b

Please sign in to comment.