@@ -149,7 +149,7 @@ class Zend_Date extends Zend_Date_DateObject
149149 */
150150 public function __construct ($ date = null , $ part = null , $ locale = null )
151151 {
152- if (is_object ($ date ) and !($ date instanceof Zend_TimeSync_Protocol) and
152+ if (is_object ($ date ) && !($ date instanceof Zend_TimeSync_Protocol) &&
153153 !($ date instanceof Zend_Date)) {
154154 if ($ locale instanceof Zend_Locale) {
155155 $ locale = $ date ;
@@ -160,12 +160,12 @@ public function __construct($date = null, $part = null, $locale = null)
160160 }
161161 }
162162
163- if (($ date !== null ) and !is_array ($ date ) and !($ date instanceof Zend_TimeSync_Protocol) and
164- !($ date instanceof Zend_Date) and !defined ($ date ) and Zend_Locale::isLocale ($ date , true , false )) {
163+ if (($ date !== null ) && !is_array ($ date ) && !($ date instanceof Zend_TimeSync_Protocol) &&
164+ !($ date instanceof Zend_Date) && !defined ($ date ) && Zend_Locale::isLocale ($ date , true , false )) {
165165 $ locale = $ date ;
166166 $ date = null ;
167167 $ part = null ;
168- } else if (($ part !== null ) and !defined ($ part ) and Zend_Locale::isLocale ($ part , true , false )) {
168+ } else if (($ part !== null ) && !defined ($ part ) && Zend_Locale::isLocale ($ part , true , false )) {
169169 $ locale = $ part ;
170170 $ part = null ;
171171 }
@@ -460,7 +460,7 @@ public function toString($format = null, $type = null, $locale = null)
460460 $ format = null ;
461461 }
462462
463- if (($ type !== null ) and ($ type != 'php ' ) and ($ type != 'iso ' ) and
463+ if (($ type !== null ) && ($ type != 'php ' ) && ($ type != 'iso ' ) &&
464464 Zend_Locale::isLocale ($ type , null , false )) {
465465 $ locale = $ type ;
466466 $ type = null ;
@@ -1214,7 +1214,7 @@ public function getTimezoneFromString($zone)
12141214 }
12151215
12161216 preg_match ('/([+-]\d{2}):{0,1}\d{2}/ ' , $ zone , $ match );
1217- if (!empty ($ match ) and ($ match [count ($ match ) - 1 ] <= 14 ) and ($ match [count ($ match ) - 1 ] >= -12 )) {
1217+ if (!empty ($ match ) && ($ match [count ($ match ) - 1 ] <= 14 ) && ($ match [count ($ match ) - 1 ] >= -12 )) {
12181218 $ zone = "Etc/GMT " ;
12191219 $ zone .= ($ match [count ($ match ) - 1 ] < 0 ) ? "+ " : "- " ;
12201220 $ zone .= (int ) abs ($ match [count ($ match ) - 1 ]);
@@ -1223,7 +1223,7 @@ public function getTimezoneFromString($zone)
12231223
12241224 preg_match ('/([[:alpha:]\/_]{3,30})(?!.*([[:alpha:]\/]{3,30}))/ ' , $ zone , $ match );
12251225 try {
1226- if (!empty ($ match ) and (!is_int ($ match [count ($ match ) - 1 ]))) {
1226+ if (!empty ($ match ) && (!is_int ($ match [count ($ match ) - 1 ]))) {
12271227 $ oldzone = $ this ->getTimezone ();
12281228 $ this ->setTimezone ($ match [count ($ match ) - 1 ]);
12291229 $ result = $ this ->getTimezone ();
@@ -1273,7 +1273,7 @@ private function _assign($calc, $date, $comp = 0, $dst = false)
12731273 }
12741274
12751275 // dst-correction if 'fix_dst' = true and dst !== false but only for non UTC and non GMT
1276- if ((self ::$ _options ['fix_dst ' ] === true ) and ($ dst !== false ) and ($ this ->_dst === true )) {
1276+ if ((self ::$ _options ['fix_dst ' ] === true ) && ($ dst !== false ) && ($ this ->_dst === true )) {
12771277 $ hour = $ this ->toString (self ::HOUR , 'iso ' );
12781278 if ($ hour != $ dst ) {
12791279 if (($ dst == ($ hour + 1 )) or ($ dst == ($ hour - 23 ))) {
@@ -1528,7 +1528,7 @@ private function _calculate($calc, $date, $part, $locale)
15281528
15291529 case self ::WEEKDAY_8601 :
15301530 $ weekday = (int ) $ this ->toString (self ::WEEKDAY_8601 , 'iso ' , $ locale );
1531- if ((intval ($ date ) > 0 ) and (intval ($ date ) < 8 )) {
1531+ if ((intval ($ date ) > 0 ) && (intval ($ date ) < 8 )) {
15321532 return $ this ->_assign ($ calc , $ this ->mktime (0 , 0 , 0 , 1 , 1 + intval ($ date ), 1970 , true ),
15331533 $ this ->mktime (0 , 0 , 0 , 1 , 1 + $ weekday , 1970 , true ), $ hour );
15341534 }
@@ -1545,7 +1545,7 @@ private function _calculate($calc, $date, $part, $locale)
15451545
15461546 case self ::WEEKDAY_DIGIT :
15471547 $ weekday = (int ) $ this ->toString (self ::WEEKDAY_DIGIT , 'iso ' , $ locale );
1548- if (is_numeric ($ date ) and (intval ($ date ) >= 0 ) and (intval ($ date ) < 7 )) {
1548+ if (is_numeric ($ date ) && (intval ($ date ) >= 0 ) && (intval ($ date ) < 7 )) {
15491549 return $ this ->_assign ($ calc , $ this ->mktime (0 , 0 , 0 , 1 , 1 + $ date , 1970 , true ),
15501550 $ this ->mktime (0 , 0 , 0 , 1 , 1 + $ weekday , 1970 , true ), $ hour );
15511551 }
@@ -2084,7 +2084,7 @@ private function _calculate($calc, $date, $part, $locale)
20842084 if (empty ($ timematch )) {
20852085 preg_match ('/[T,\s]{0,1}(\d{2})(\d{2})(\d{2})/ ' , $ tmpdate , $ timematch );
20862086 }
2087- if (empty ($ datematch ) and empty ($ timematch )) {
2087+ if (empty ($ datematch ) && empty ($ timematch )) {
20882088 #require_once 'Zend/Date/Exception.php';
20892089 throw new Zend_Date_Exception ("unsupported ISO8601 format ( $ date) " , 0 , null , $ date );
20902090 }
@@ -2644,7 +2644,7 @@ private function _calculate($calc, $date, $part, $locale)
26442644 }
26452645
26462646 $ parsed = Zend_Locale_Format::getDate ($ date , array ('date_format ' => $ part , 'locale ' => $ locale , 'fix_date ' => true , 'format_type ' => 'iso ' ));
2647- if ((strpos (strtoupper ($ part ), 'YY ' ) !== false ) and (strpos (strtoupper ($ part ), 'YYYY ' ) === false )) {
2647+ if ((strpos (strtoupper ($ part ), 'YY ' ) !== false ) && (strpos (strtoupper ($ part ), 'YYYY ' ) === false )) {
26482648 $ parsed ['year ' ] = self ::getFullYear ($ parsed ['year ' ]);
26492649 }
26502650
@@ -2974,7 +2974,7 @@ private function _date($calc, $date, $format, $locale)
29742974 }
29752975
29762976 $ parsed = Zend_Locale_Format::getDate ($ date , array ('date_format ' => $ format , 'locale ' => $ locale , 'format_type ' => 'iso ' ));
2977- if ((strpos (strtoupper ($ format ), 'YY ' ) !== false ) and (strpos (strtoupper ($ format ), 'YYYY ' ) === false )) {
2977+ if ((strpos (strtoupper ($ format ), 'YY ' ) !== false ) && (strpos (strtoupper ($ format ), 'YYYY ' ) === false )) {
29782978 $ parsed ['year ' ] = self ::getFullYear ($ parsed ['year ' ]);
29792979 }
29802980 } catch (Zend_Locale_Exception $ e ) {
@@ -4800,34 +4800,34 @@ public static function isDate($date, $format = null, $locale = null)
48004800 $ parsed = $ date ;
48014801 }
48024802
4803- if (((strpos ($ format , 'Y ' ) !== false ) or (strpos ($ format , 'y ' ) !== false )) and
4803+ if (((strpos ($ format , 'Y ' ) !== false ) or (strpos ($ format , 'y ' ) !== false )) &&
48044804 (!isset ($ parsed ['year ' ]))) {
48054805 // Year expected but not found
48064806 return false ;
48074807 }
48084808
4809- if ((strpos ($ format , 'M ' ) !== false ) and (!isset ($ parsed ['month ' ]))) {
4809+ if ((strpos ($ format , 'M ' ) !== false ) && (!isset ($ parsed ['month ' ]))) {
48104810 // Month expected but not found
48114811 return false ;
48124812 }
48134813
4814- if ((strpos ($ format , 'd ' ) !== false ) and (!isset ($ parsed ['day ' ]))) {
4814+ if ((strpos ($ format , 'd ' ) !== false ) && (!isset ($ parsed ['day ' ]))) {
48154815 // Day expected but not found
48164816 return false ;
48174817 }
48184818
4819- if (((strpos ($ format , 'H ' ) !== false ) or (strpos ($ format , 'h ' ) !== false )) and
4819+ if (((strpos ($ format , 'H ' ) !== false ) or (strpos ($ format , 'h ' ) !== false )) &&
48204820 (!isset ($ parsed ['hour ' ]))) {
48214821 // Hour expected but not found
48224822 return false ;
48234823 }
48244824
4825- if ((strpos ($ format , 'm ' ) !== false ) and (!isset ($ parsed ['minute ' ]))) {
4825+ if ((strpos ($ format , 'm ' ) !== false ) && (!isset ($ parsed ['minute ' ]))) {
48264826 // Minute expected but not found
48274827 return false ;
48284828 }
48294829
4830- if ((strpos ($ format , 's ' ) !== false ) and (!isset ($ parsed ['second ' ]))) {
4830+ if ((strpos ($ format , 's ' ) !== false ) && (!isset ($ parsed ['second ' ]))) {
48314831 // Second expected but not found
48324832 return false ;
48334833 }
0 commit comments