Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
wp-content
/
plugins
/
woocommerce
/
src
/
Internal
/
StockNotifications
/
Utilities
:
EmailNormalizer.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php declare( strict_types=1 ); namespace Automattic\WooCommerce\Internal\StockNotifications\Utilities; /** * Canonical form for customer emails stored in stock notifications. * * Lookups on `wc_stock_notifications.user_email` use plain SQL equality, so every * write and every query must go through the same normalization or the same customer * can appear more than once under a different letter case. * * @internal */ final class EmailNormalizer { /** * Normalize an already validated email address. * * Trims and lowercases. No validation is performed. * * @param string $email The email address. * @return string */ public static function normalize( string $email ): string { return strtolower( trim( $email ) ); } }