Skip to content

Commit

Permalink
Merge pull request #189 from laminas/2.39.x-merge-up-into-3.0.x_iQzZMsJa
Browse files Browse the repository at this point in the history
Merge release 2.39.0 into 3.0.x
  • Loading branch information
gsteel authored Oct 31, 2024
2 parents dbad5e6 + 1e560dc commit 006013a
Show file tree
Hide file tree
Showing 10 changed files with 233 additions and 53 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
"laminas/laminas-stdlib": "^3.19.0"
},
"require-dev": {
"laminas/laminas-coding-standard": "~3.0",
"laminas/laminas-coding-standard": "^3.0.1",
"pear/archive_tar": "^1.5.0",
"phpunit/phpunit": "^10.5.36",
"phpunit/phpunit": "^10.5.38",
"psalm/plugin-phpunit": "^0.19.0",
"psr/http-factory": "^1.1.0",
"vimeo/psalm": "^5.26.1"
Expand Down
100 changes: 50 additions & 50 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions docs/book/v2/standard-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,27 @@ instead.
Users pulling their `Null` filter instance from the filter plugin manager receive a `ToNull`
instance instead starting in 2.4.0.

## ToString

The `ToString` filter casts `Stringable` objects or scalar values to `string`.
This filter has no runtime options.

### Basic Usage

```php
$filter = new \Laminas\Filter\ToString();

$filter->filter(123); // "123"
```

Non-scalar input will be returned un-filtered:

```php
$filter = new \Laminas\Filter\ToString();

$filter->filter(['muppet' => 'Kermit']); // ['muppet' => 'Kermit']
```

## NumberFormat

The `NumberFormat` filter can be used to return locale-specific number and percentage strings. It
Expand Down
21 changes: 21 additions & 0 deletions docs/book/v3/standard-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,27 @@ $filter = new Laminas\Filter\ToNull([

It is best practice is to use the `TYPE_*` constants rather than the human-readable strings. Modern IDEs will autocomplete these for you and usage and refactoring is easier.

## ToString

The `ToString` filter casts `Stringable` objects or scalar values to `string`.
This filter has no runtime options.

### Basic Usage

```php
$filter = new \Laminas\Filter\ToString();

$filter->filter(123); // "123"
```

Non-scalar input will be returned un-filtered:

```php
$filter = new \Laminas\Filter\ToString();

$filter->filter(['muppet' => 'Kermit']); // ['muppet' => 'Kermit']
```

## NumberFormat

The `NumberFormat` filter can be used to return locale-specific number and percentage strings. It
Expand Down
10 changes: 10 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,10 @@
<DeprecatedClass>
<code><![CDATA[AbstractFilter]]></code>
</DeprecatedClass>
<DeprecatedMethod>
<code><![CDATA[setSeparator]]></code>
<code><![CDATA[setSeparator]]></code>
</DeprecatedMethod>
<PossiblyInvalidArgument>
<code><![CDATA[$separator]]></code>
</PossiblyInvalidArgument>
Expand Down Expand Up @@ -954,6 +958,12 @@
<code><![CDATA[typeTestProvider]]></code>
</PossiblyUnusedMethod>
</file>
<file src="test/ToStringTest.php">
<PossiblyUnusedMethod>
<code><![CDATA[returnBasicDataProvider]]></code>
<code><![CDATA[returnUnfilteredDataProvider]]></code>
</PossiblyUnusedMethod>
</file>
<file src="test/UpperCaseWordsTest.php">
<PossiblyUnusedMethod>
<code><![CDATA[returnUnfilteredDataProvider]]></code>
Expand Down
Loading

0 comments on commit 006013a

Please sign in to comment.