Skip to content

Commit

Permalink
Merge branch '5' into 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jan 14, 2025
2 parents 4bddf25 + 0aa00a6 commit dd6d7d8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
8 changes: 7 additions & 1 deletion src/Dev/Deprecation.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ public static function withSuppressedNotice(callable $func): mixed
*/
protected static function get_called_method_from_trace($backtrace, $level = 1)
{
if ($backtrace === null) {
return '';
}
$level = (int)$level;
if (!$level) {
$level = 1;
Expand Down Expand Up @@ -188,8 +191,11 @@ private static function get_called_from_trace(array $backtrace, int $level): arr
return $called;
}

private static function isCalledFromSupportedCode(array $backtrace): bool
private static function isCalledFromSupportedCode(?array $backtrace): bool
{
if ($backtrace === null) {
return false;
}
$called = Deprecation::get_called_from_trace($backtrace, 1);
$file = $called['file'] ?? '';
if (!$file) {
Expand Down
12 changes: 0 additions & 12 deletions src/Forms/SearchableDropdownField.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,6 @@ public function __construct(
$this->setHasEmptyDefault(true);
}

/**
* @param string $string
* @return $this
*
* @deprecated 5.2.0 Use setPlaceholder() instead
*/
public function setEmptyString($string)
{
Deprecation::notice('5.2.0', 'Use setPlaceholder() instead');
return parent::setEmptyString($string);
}

public function getValueForValidation(): mixed
{
$arr = $this->getValueArray();
Expand Down
3 changes: 1 addition & 2 deletions src/Forms/SearchableDropdownTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ public function getPlaceholder(): string
* Calling this will also call setHasEmptyDefault(true), if the method exists on the class,
* which is required for the placeholder functionality to work on SearchableDropdownField
*
* In the case of SearchableDropField this method should be used instead of setEmptyString() which
* will be remvoved in a future version
* In the case of SearchableDropField this method should be used instead of setEmptyString()
*/
public function setPlaceholder(string $placeholder): static
{
Expand Down

0 comments on commit dd6d7d8

Please sign in to comment.