-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Deprecate Validators::validateEntityName()
#6510
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,10 @@ public static function validateUsername($username) | |
} | ||
|
||
/** | ||
* NEXT_MAJOR: Remove this method. | ||
* | ||
* @deprecated since sonata-project/admin-bundle 3.x, will be removed in version 4.0. | ||
* | ||
* @static | ||
* | ||
* @param string $shortcut | ||
|
@@ -51,6 +55,12 @@ public static function validateUsername($username) | |
*/ | ||
public static function validateEntityName($shortcut) | ||
{ | ||
@trigger_error(sprintf( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like there is a testcase which needs to be marked with |
||
'Method "%s()" is deprecated since sonata-project/admin-bundle 3.x' | ||
.' and will be removed in version 4.0.', | ||
__METHOD__ | ||
), E_USER_DEPRECATED); | ||
|
||
$model = str_replace('/', '\\', $shortcut); | ||
|
||
if (false === $pos = strpos($model, ':')) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,13 +45,20 @@ public function testValidateUsernameWithException(): void | |
} | ||
|
||
/** | ||
* NEXT_MAJOR: Remove this test. | ||
* | ||
* @group legacy | ||
* | ||
* @dataProvider getValidateEntityNameTests | ||
*/ | ||
public function testValidateEntityName(array $expected, string $value): void | ||
{ | ||
$this->assertSame($expected, Validators::validateEntityName($value)); | ||
} | ||
|
||
/** | ||
* NEXT_MAJOR: Remove this method. | ||
*/ | ||
public function getValidateEntityNameTests(): array | ||
{ | ||
return [ | ||
|
@@ -62,6 +69,10 @@ public function getValidateEntityNameTests(): array | |
} | ||
|
||
/** | ||
* NEXT_MAJOR: Remove this test. | ||
* | ||
* @group legacy | ||
* | ||
* @dataProvider getValidateEntityNamesWithExceptionTests | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. |
||
*/ | ||
public function testValidateEntityNameWithException(string $value): void | ||
|
@@ -71,6 +82,9 @@ public function testValidateEntityNameWithException(string $value): void | |
Validators::validateEntityName($value); | ||
} | ||
|
||
/** | ||
* NEXT_MAJOR: Remove this method. | ||
*/ | ||
public function getValidateEntityNamesWithExceptionTests(): array | ||
{ | ||
return [ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
until released? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version 3.77 is already released.