Completed
Push — master ( 15d0ea...6b379c )
by
unknown
11s
created
src/DayOf.php 1 patch
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -7,30 +7,30 @@  discard block
 block discarded – undo
7 7
  */
8 8
 class DayOf
9 9
 {
10
-	/**
11
-     * @var object
12
-     */
10
+  /**
11
+   * @var object
12
+   */
13 13
     protected $date_time;
14 14
 
15
-	/**
16
-     * @var array
17
-     */
15
+  /**
16
+   * @var array
17
+   */
18 18
     protected $config;
19 19
 
20
-	/**
21
-	 * @var string
22
-	 */
23
-	protected $calendar_type;
20
+  /**
21
+   * @var string
22
+   */
23
+  protected $calendar_type;
24 24
 
25
-	/**
26
-   	 * Constructor of DayOf class
27
-     */
25
+  /**
26
+   * Constructor of DayOf class
27
+   */
28 28
     public function __construct($date_time, $calendar_type = 'gregorian')
29 29
     {
30 30
 
31
-		$this->config = include __DIR__.'/CalendarSettings/' . ucfirst($calendar_type) . '.php';
31
+    $this->config = include __DIR__.'/CalendarSettings/' . ucfirst($calendar_type) . '.php';
32 32
 
33
-		$this->calendar_type = $calendar_type;
33
+    $this->calendar_type = $calendar_type;
34 34
 
35 35
         $this->date_time = $date_time;
36 36
 
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
     }
40 40
 
41 41
     /**
42
-   * Which day of year is current day.
43
-   *
44
-   * @since  Aug, 03 2015
45
-   * @return integer
46
-   */
42
+     * Which day of year is current day.
43
+     *
44
+     * @since  Aug, 03 2015
45
+     * @return integer
46
+     */
47 47
     public function year()
48 48
     {
49 49
 
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
 
54 54
 
55 55
     /**
56
-   * Which day of week is current day.
57
-   *
58
-   * @since  Aug, 09 2015
59
-   * @return integer
60
-   */
56
+     * Which day of week is current day.
57
+     *
58
+     * @since  Aug, 09 2015
59
+     * @return integer
60
+     */
61 61
     public function week()
62 62
     {
63 63
 
@@ -65,47 +65,47 @@  discard block
 block discarded – undo
65 65
 
66 66
     }
67 67
 
68
-	/**
69
-	 * Return last day of current month
70
-	 *
71
-	 * @since  Oct, 18 2016
72
-	 * @return integer
73
-	 */
74
-	public function lastDayMonth() {
68
+  /**
69
+   * Return last day of current month
70
+   *
71
+   * @since  Oct, 18 2016
72
+   * @return integer
73
+   */
74
+  public function lastDayMonth() {
75 75
 
76
-		$days = 0;
76
+    $days = 0;
77 77
 
78
-		switch ( $this->calendar_type ) {
78
+    switch ( $this->calendar_type ) {
79 79
 
80
-			case 'gregorian':
80
+      case 'gregorian':
81 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' ) ) ];
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 87
 
88
-				break;
88
+        break;
89 89
 
90
-			case 'jalali':
90
+      case 'jalali':
91 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' ) ) ];
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 97
 
98
-			  	break;
98
+          break;
99 99
 
100
-		  default:
100
+      default:
101 101
 
102
-			$days = $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ];
102
+      $days = $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ];
103 103
 
104
-			break;
104
+      break;
105 105
 
106
-		}
106
+    }
107 107
 
108
-		return $days;
108
+    return $days;
109 109
 
110
-	}
110
+  }
111 111
 }
Please login to merge, or discard this patch.