@@ -330,7 +330,7 @@ public static function create($locale = 'en', $style = null, $pattern = null)
330330 */
331331 public function formatCurrency ($ value , $ currency )
332332 {
333- if ($ this ->style == self :: DECIMAL ) {
333+ if (self :: DECIMAL == $ this ->style ) {
334334 return $ this ->format ($ value );
335335 }
336336
@@ -369,21 +369,21 @@ public function formatCurrency($value, $currency)
369369 public function format ($ value , $ type = self ::TYPE_DEFAULT )
370370 {
371371 // The original NumberFormatter does not support this format type
372- if ($ type == self ::TYPE_CURRENCY ) {
372+ if (self ::TYPE_CURRENCY == $ type ) {
373373 trigger_error (__METHOD__ .'(): Unsupported format type ' .$ type , \E_USER_WARNING );
374374
375375 return false ;
376376 }
377377
378- if ($ this ->style == self :: CURRENCY ) {
378+ if (self :: CURRENCY == $ this ->style ) {
379379 throw new NotImplementedException (sprintf (
380380 '%s() method does not support the formatting of currencies (instance with CURRENCY style). %s ' ,
381381 __METHOD__ , NotImplementedException::INTL_INSTALL_MESSAGE
382382 ));
383383 }
384384
385385 // Only the default type is supported.
386- if ($ type != self ::TYPE_DEFAULT ) {
386+ if (self ::TYPE_DEFAULT != $ type ) {
387387 throw new MethodArgumentValueNotImplementedException (__METHOD__ , 'type ' , $ type , 'Only TYPE_DEFAULT is supported ' );
388388 }
389389
@@ -526,7 +526,7 @@ public function parseCurrency($value, &$currency, &$position = null)
526526 */
527527 public function parse ($ value , $ type = self ::TYPE_DOUBLE , &$ position = 0 )
528528 {
529- if ($ type == self ::TYPE_DEFAULT || $ type == self ::TYPE_CURRENCY ) {
529+ if (self ::TYPE_DEFAULT == $ type || self ::TYPE_CURRENCY == $ type ) {
530530 trigger_error (__METHOD__ .'(): Unsupported format type ' .$ type , \E_USER_WARNING );
531531
532532 return false ;
@@ -773,7 +773,7 @@ private function formatNumber($value, $precision)
773773 */
774774 private function getUninitializedPrecision ($ value , $ precision )
775775 {
776- if ($ this ->style == self :: CURRENCY ) {
776+ if (self :: CURRENCY == $ this ->style ) {
777777 return $ precision ;
778778 }
779779
@@ -809,11 +809,11 @@ private function isInitializedAttribute($attr)
809809 */
810810 private function convertValueDataType ($ value , $ type )
811811 {
812- if ($ type == self ::TYPE_DOUBLE ) {
812+ if (self ::TYPE_DOUBLE == $ type ) {
813813 $ value = (float ) $ value ;
814- } elseif ($ type == self ::TYPE_INT32 ) {
814+ } elseif (self ::TYPE_INT32 == $ type ) {
815815 $ value = $ this ->getInt32Value ($ value );
816- } elseif ($ type == self ::TYPE_INT64 ) {
816+ } elseif (self ::TYPE_INT64 == $ type ) {
817817 $ value = $ this ->getInt64Value ($ value );
818818 }
819819
0 commit comments