| Conditions | 7 |
| Paths | 5 |
| Total Lines | 37 |
| Code Lines | 21 |
| Lines | 18 |
| Ratio | 48.65 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 74 | public function lastDayMonth() { |
||
| 75 | |||
| 76 | $days = 0; |
||
| 77 | |||
| 78 | switch ( $this->calendar_type ) { |
||
| 79 | |||
| 80 | View Code Duplication | case 'gregorian': |
|
| 81 | |||
| 82 | if ( intval( $this->date_time->format( 'm' ) ) == 2 && |
||
| 83 | $this->config[ 'leap_year' ]( $this->date_time->format( 'Y' )) ) |
||
| 84 | $days = $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ] + 1; |
||
| 85 | else |
||
| 86 | $days = $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ]; |
||
| 87 | |||
| 88 | break; |
||
| 89 | |||
| 90 | View Code Duplication | case 'jalali': |
|
| 91 | |||
| 92 | if ( intval( $this->date_time->format( 'm' ) ) == 12 && |
||
| 93 | $this->config[ 'leap_year' ]( $this->date_time->format( 'Y' )) ) |
||
| 94 | $days = $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ] + 1; |
||
| 95 | else |
||
| 96 | $days = $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ]; |
||
| 97 | |||
| 98 | break; |
||
| 99 | |||
| 100 | default: |
||
| 101 | |||
| 102 | $days = $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ]; |
||
| 103 | |||
| 104 | break; |
||
| 105 | |||
| 106 | } |
||
| 107 | |||
| 108 | return $days; |
||
| 109 | |||
| 110 | } |
||
| 111 | } |
||
| 112 |