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

Deprecate the Numeric class, ref #30 #34

Merged
merged 2 commits into from
Apr 2, 2017
Merged

Deprecate the Numeric class, ref #30 #34

merged 2 commits into from
Apr 2, 2017

Conversation

damienalexandre
Copy link
Member

  • rename Numeric into Unit
  • mark the Numeric as deprecated and throw a Notice if used
  • add a check for usage, allow to keep old configuration intact!

$content = preg_replace('@([\dº])('.Fixer::ALL_SPACES.')+([º°%Ω฿₵¢₡$₫֏€ƒ₲₴₭£₤₺₦₨₱៛₹$₪৳₸₮₩¥\w]{1})@', '$1'.Fixer::NO_BREAK_SPACE.'$3', $content);

return $content;
trigger_error('Numeric fixer is deprecated, use Unit instead.', E_USER_NOTICE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should probably add a @ silencer and use a deprecation error level:
@trigger_error('...', E_USER_DEPRECATED);

@@ -135,6 +135,11 @@ private function compileRules($rules)
$fixer = $rule;
$className = get_class($rule);
} else {
/* BC Layer: the Numeric class is deprecated */
if (mb_strtolower($rule) === 'numeric') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this layer is not necessary as the old class still exists

@damienalexandre damienalexandre merged commit f04ed96 into master Apr 2, 2017
@lyrixx lyrixx deleted the numeric branch December 7, 2021 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants