| Conditions | 7 |
| Paths | 9 |
| Total Lines | 35 |
| Code Lines | 19 |
| Lines | 16 |
| Ratio | 45.71 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 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 | $days = ( intval( $this->date_time->format( 'm' ) ) == 2 && |
||
| 83 | $this->config[ 'leap_year' ]( $this->date_time->format( 'Y' )) ) ? |
||
| 84 | $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ] + 1 : |
||
| 85 | $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ]; |
||
| 86 | |||
| 87 | break; |
||
| 88 | |||
| 89 | View Code Duplication | case 'jalali': |
|
| 90 | |||
| 91 | $days = ( intval( $this->date_time->format( 'm' ) ) == 12 && |
||
| 92 | $this->config[ 'leap_year' ]( $this->date_time->format( 'Y' )) ) ? |
||
| 93 | $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ] + 1 : |
||
| 94 | $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ]; |
||
| 95 | |||
| 96 | break; |
||
| 97 | |||
| 98 | default: |
||
| 99 | |||
| 100 | $days = $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ]; |
||
| 101 | |||
| 102 | break; |
||
| 103 | |||
| 104 | } |
||
| 105 | |||
| 106 | return $days; |
||
| 107 | |||
| 108 | } |
||
| 109 | } |
||
| 110 |