@@ -332,7 +332,7 @@ public static function create($locale = 'en', $style = null, $pattern = null)
332332 */
333333 public function formatCurrency ($ value , $ currency )
334334 {
335- if ($ this ->style == self :: DECIMAL ) {
335+ if (self :: DECIMAL == $ this ->style ) {
336336 return $ this ->format ($ value );
337337 }
338338
@@ -371,21 +371,21 @@ public function formatCurrency($value, $currency)
371371 public function format ($ value , $ type = self ::TYPE_DEFAULT )
372372 {
373373 // The original NumberFormatter does not support this format type
374- if ($ type == self ::TYPE_CURRENCY ) {
374+ if (self ::TYPE_CURRENCY == $ type ) {
375375 trigger_error (__METHOD__ .'(): Unsupported format type ' .$ type , \E_USER_WARNING );
376376
377377 return false ;
378378 }
379379
380- if ($ this ->style == self :: CURRENCY ) {
380+ if (self :: CURRENCY == $ this ->style ) {
381381 throw new NotImplementedException (sprintf (
382382 '%s() method does not support the formatting of currencies (instance with CURRENCY style). %s ' ,
383383 __METHOD__ , NotImplementedException::INTL_INSTALL_MESSAGE
384384 ));
385385 }
386386
387387 // Only the default type is supported.
388- if ($ type != self ::TYPE_DEFAULT ) {
388+ if (self ::TYPE_DEFAULT != $ type ) {
389389 throw new MethodArgumentValueNotImplementedException (__METHOD__ , 'type ' , $ type , 'Only TYPE_DEFAULT is supported ' );
390390 }
391391
@@ -528,7 +528,7 @@ public function parseCurrency($value, &$currency, &$position = null)
528528 */
529529 public function parse ($ value , $ type = self ::TYPE_DOUBLE , &$ position = 0 )
530530 {
531- if ($ type == self ::TYPE_DEFAULT || $ type == self ::TYPE_CURRENCY ) {
531+ if (self ::TYPE_DEFAULT == $ type || self ::TYPE_CURRENCY == $ type ) {
532532 trigger_error (__METHOD__ .'(): Unsupported format type ' .$ type , \E_USER_WARNING );
533533
534534 return false ;
@@ -775,7 +775,7 @@ private function formatNumber($value, $precision)
775775 */
776776 private function getUninitializedPrecision ($ value , $ precision )
777777 {
778- if ($ this ->style == self :: CURRENCY ) {
778+ if (self :: CURRENCY == $ this ->style ) {
779779 return $ precision ;
780780 }
781781
@@ -811,11 +811,11 @@ private function isInitializedAttribute($attr)
811811 */
812812 private function convertValueDataType ($ value , $ type )
813813 {
814- if ($ type == self ::TYPE_DOUBLE ) {
814+ if (self ::TYPE_DOUBLE == $ type ) {
815815 $ value = (float ) $ value ;
816- } elseif ($ type == self ::TYPE_INT32 ) {
816+ } elseif (self ::TYPE_INT32 == $ type ) {
817817 $ value = $ this ->getInt32Value ($ value );
818- } elseif ($ type == self ::TYPE_INT64 ) {
818+ } elseif (self ::TYPE_INT64 == $ type ) {
819819 $ value = $ this ->getInt64Value ($ value );
820820 }
821821
0 commit comments