Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark PhoneNumber validator class as deprecated #124

Merged
merged 2 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.22.2@d768d914152dbbf3486c36398802f74e80cfde48">
<files psalm-version="5.24.0@462c80e31c34e58cc4f750c656be3927e80e550e">
<file src="src/ConfigProvider.php">
<DeprecatedClass>
<code><![CDATA[Validator\PhoneNumber::class]]></code>
<code><![CDATA[Validator\PhoneNumber::class]]></code>
<code><![CDATA[Validator\PhoneNumber::class]]></code>
<code><![CDATA[Validator\PhoneNumber::class]]></code>
<code><![CDATA[Validator\PhoneNumber::class]]></code>
</DeprecatedClass>
</file>
<file src="src/Exception/ExtensionNotLoadedException.php">
<UnusedClass>
<code><![CDATA[ExtensionNotLoadedException]]></code>
Expand Down Expand Up @@ -861,6 +870,15 @@
</PossiblyUnusedMethod>
</file>
<file src="test/Validator/PhoneNumberTest.php">
<DeprecatedClass>
<code><![CDATA[PhoneNumber]]></code>
<code><![CDATA[new PhoneNumber($constructorOptions)]]></code>
<code><![CDATA[new PhoneNumber()]]></code>
<code><![CDATA[new PhoneNumber()]]></code>
<code><![CDATA[new PhoneNumber([
'country' => 'country-code',
])]]></code>
</DeprecatedClass>
<PossiblyUnusedMethod>
<code><![CDATA[constructDataProvider]]></code>
<code><![CDATA[numbersDataProvider]]></code>
Expand Down
5 changes: 5 additions & 0 deletions src/Validator/PhoneNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
use function strtoupper;
use function substr;

/**
* @deprecated This class is deprecated and will be removed in v3.0.0
* Use Laminas\I18n\PhoneNumber\Validator\PhoneNumber instead:
* https://github.com/laminas/laminas-i18n-phone-number
*/
class PhoneNumber extends AbstractValidator
{
public const NO_MATCH = 'phoneNumberNoMatch';
Expand Down