Skip to content

Commit

Permalink
Merge pull request #146 from gsteel/v3/remove-pcre-unicode-support
Browse files Browse the repository at this point in the history
Remove deprecated `AbstractFilter::hasPcreUnicodeSupport` method
  • Loading branch information
gsteel authored Jun 13, 2024
2 parents f8f7589 + 98c35ce commit 2d096c8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 22 deletions.
3 changes: 0 additions & 3 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1095,9 +1095,6 @@
</PossiblyUnusedMethod>
</file>
<file src="test/PregReplaceTest.php">
<DeprecatedMethod>
<code><![CDATA[PregReplaceFilter::hasPcreUnicodeSupport()]]></code>
</DeprecatedMethod>
<PossiblyUnusedMethod>
<code><![CDATA[returnNonStringScalarValues]]></code>
<code><![CDATA[returnUnfilteredDataProvider]]></code>
Expand Down
11 changes: 0 additions & 11 deletions src/AbstractFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Laminas\Filter;

use Laminas\Stdlib\StringUtils;
use Traversable;

use function array_key_exists;
Expand Down Expand Up @@ -32,16 +31,6 @@ abstract class AbstractFilter implements FilterInterface
*/
protected $options = [];

/**
* @deprecated Since 2.1.0
*
* @return bool
*/
public static function hasPcreUnicodeSupport()
{
return StringUtils::hasPcreUnicodeSupport();
}

/**
* @param TOptions|iterable $options
* @return self
Expand Down
8 changes: 0 additions & 8 deletions test/PregReplaceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
use PHPUnit\Framework\TestCase;
use stdClass;

use function preg_match;

class PregReplaceTest extends TestCase
{
private PregReplaceFilter $filter;
Expand All @@ -21,12 +19,6 @@ public function setUp(): void
$this->filter = new PregReplaceFilter();
}

public function testDetectsPcreUnicodeSupport(): void
{
$enabled = (bool) @preg_match('/\pL/u', 'a');
self::assertSame($enabled, PregReplaceFilter::hasPcreUnicodeSupport());
}

public function testPassingPatternToConstructorSetsPattern(): void
{
$pattern = '#^controller/(?P<action>[a-z_-]+)#';
Expand Down

0 comments on commit 2d096c8

Please sign in to comment.