Skip to content
Snippets Groups Projects
Commit c6b60cde authored by catch's avatar catch
Browse files

Issue #3068076 by alexpott: Properly deprecate Cache::validateTags()

parent 99dde710
No related branches found
No related tags found
No related merge requests found
......@@ -96,12 +96,14 @@ public static function mergeMaxAges($a = Cache::PERMANENT, $b = Cache::PERMANENT
* @param string[] $tags
* An array of cache tags.
*
* @deprecated
* Use assert(Inspector::assertAllStrings($tags));
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use
* assert(\Drupal\Component\Assertion\Inspector::assertAllStrings($tags))
* instead.
*
* @throws \LogicException
*/
public static function validateTags(array $tags) {
@trigger_error(__NAMESPACE__ . '\Cache::validateTags() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use assert(\Drupal\Component\Assertion\Inspector::assertAllStrings($tags)) instead.', E_USER_DEPRECATED);
if (empty($tags)) {
return;
}
......
......@@ -44,6 +44,8 @@ public function validateTagsProvider() {
* @covers ::validateTags
*
* @dataProvider validateTagsProvider
* @expectedDeprecation Drupal\Core\Cache\Cache::validateTags() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use assert(\Drupal\Component\Assertion\Inspector::assertAllStrings($tags)) instead.
* @group legacy
*/
public function testValidateTags(array $tags, $expected_exception_message) {
if ($expected_exception_message !== FALSE) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment