Completed
Pull Request — master (#886)
by
unknown
04:11 queued 01:17
created
lib/timber-site.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
 
65 65
 	/** @api
66 66
 	 * @var string for people who like trackback spam
67
-	*/
67
+	 */
68 68
 	public $pingback_url;
69 69
 	public $siteurl;
70 70
 	/**
Please login to merge, or discard this patch.
lib/timber-term.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -333,7 +333,7 @@
 block discarded – undo
333 333
 		$suffix = '</p>';
334 334
 		$desc = term_description( $this->ID, $this->taxonomy );
335 335
 		if (substr($desc, 0, strlen($prefix)) == $prefix) {
336
-    		$desc = substr($desc, strlen($prefix));
336
+			$desc = substr($desc, strlen($prefix));
337 337
 		}
338 338
 		$desc = preg_replace('/'. preg_quote('</p>', '/') . '$/', '', $desc);
339 339
 		return trim($desc);
Please login to merge, or discard this patch.
lib/image/timber-image-operation-resize.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
-	 * Changes image to new size, by shrinking/enlarging
4
-	 * then cropping to respect new ratio.
5
-	 *
6
-	 * Arguments:
7
-	 * - width of new image
8
-	 * - height of new image
9
-	 * - crop method
10
-	 */
3
+ * Changes image to new size, by shrinking/enlarging
4
+ * then cropping to respect new ratio.
5
+ *
6
+ * Arguments:
7
+ * - width of new image
8
+ * - height of new image
9
+ * - crop method
10
+ */
11 11
 class TimberImageOperationResize extends TimberImageOperation {
12 12
 
13 13
    private $w, $h, $crop;
Please login to merge, or discard this patch.
lib/image/timber-image-operation-retina.php 1 patch
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Contains the class for running image retina-izing operations
4
- */
3
+	 * Contains the class for running image retina-izing operations
4
+	 */
5 5
 
6 6
 /**
7 7
  * Increases image size by a given factor
@@ -11,64 +11,64 @@  discard block
 block discarded – undo
11 11
  */
12 12
 class TimberImageOperationRetina extends TimberImageOperation {
13 13
 
14
-    private $factor;
14
+	private $factor;
15 15
 
16
-    /**
17
-     * Construct our operation
18
-     * @param float   $factor to multiply original dimensions by
19
-     */
20
-    function __construct($factor) {
21
-        $this->factor = $factor;
22
-    }
16
+	/**
17
+	 * Construct our operation
18
+	 * @param float   $factor to multiply original dimensions by
19
+	 */
20
+	function __construct($factor) {
21
+		$this->factor = $factor;
22
+	}
23 23
 
24
-    /**
25
-     * Generates the final filename based on the source's name and extension
26
-     *
27
-     * @param   string    $src_filename     the basename of the file (ex: my-awesome-pic)
28
-     * @param   string    $src_extension    the extension (ex: .jpg)
29
-     * @return  string    the final filename to be used (ex: [email protected])
30
-     */
31
-    function filename($src_filename, $src_extension) {
32
-        $newbase = $src_filename . '@' . $this->factor . 'x'; // add @2x, @3x, @1.5x, etc.
33
-        $new_name = $newbase . '.' . $src_extension;
34
-        return $new_name;
35
-    }
24
+	/**
25
+	 * Generates the final filename based on the source's name and extension
26
+	 *
27
+	 * @param   string    $src_filename     the basename of the file (ex: my-awesome-pic)
28
+	 * @param   string    $src_extension    the extension (ex: .jpg)
29
+	 * @return  string    the final filename to be used (ex: [email protected])
30
+	 */
31
+	function filename($src_filename, $src_extension) {
32
+		$newbase = $src_filename . '@' . $this->factor . 'x'; // add @2x, @3x, @1.5x, etc.
33
+		$new_name = $newbase . '.' . $src_extension;
34
+		return $new_name;
35
+	}
36 36
 
37
-    /**
38
-     * Performs the actual image manipulation,
39
-     * including saving the target file.
40
-     *
41
-     * @param  string $load_filename filepath (not URL) to source file
42
-     *                               (ex: /src/var/www/wp-content/uploads/my-pic.jpg)
43
-     * @param  string $save_filename filepath (not URL) where result file should be saved
44
-     *                               (ex: /src/var/www/wp-content/uploads/[email protected])
45
-     * @return bool                  true if everything went fine, false otherwise
46
-     */
47
-    function run($load_filename, $save_filename){
48
-        $image = wp_get_image_editor( $load_filename );
49
-        if ( !is_wp_error( $image ) ) {
50
-            $current_size = $image->get_size();
51
-            $src_w = $current_size['width'];
52
-            $src_h = $current_size['height'];
53
-            // Get ratios
54
-            $w = $src_w * $this->factor;
55
-            $h = $src_h * $this->factor;
56
-            $image->crop( 0, 0, $src_w, $src_h, $w, $h );
57
-            $result = $image->save( $save_filename );
58
-            if ( is_wp_error( $result ) ) {
59
-            	// @codeCoverageIgnoreStart
37
+	/**
38
+	 * Performs the actual image manipulation,
39
+	 * including saving the target file.
40
+	 *
41
+	 * @param  string $load_filename filepath (not URL) to source file
42
+	 *                               (ex: /src/var/www/wp-content/uploads/my-pic.jpg)
43
+	 * @param  string $save_filename filepath (not URL) where result file should be saved
44
+	 *                               (ex: /src/var/www/wp-content/uploads/[email protected])
45
+	 * @return bool                  true if everything went fine, false otherwise
46
+	 */
47
+	function run($load_filename, $save_filename){
48
+		$image = wp_get_image_editor( $load_filename );
49
+		if ( !is_wp_error( $image ) ) {
50
+			$current_size = $image->get_size();
51
+			$src_w = $current_size['width'];
52
+			$src_h = $current_size['height'];
53
+			// Get ratios
54
+			$w = $src_w * $this->factor;
55
+			$h = $src_h * $this->factor;
56
+			$image->crop( 0, 0, $src_w, $src_h, $w, $h );
57
+			$result = $image->save( $save_filename );
58
+			if ( is_wp_error( $result ) ) {
59
+				// @codeCoverageIgnoreStart
60 60
 				TimberHelper::error_log( 'Error resizing image' );
61 61
 				TimberHelper::error_log( $result );
62 62
 				return false;
63 63
 				// @codeCoverageIgnoreEnd
64
-            } else {
65
-                return true;
66
-            }
67
-        } else if ( isset( $image->error_data['error_loading_image'] ) ) {
68
-            TimberHelper::error_log( 'Error loading ' . $image->error_data['error_loading_image'] );
69
-        } else {
70
-            TimberHelper::error_log( $image );
71
-        }
72
-        return false;
73
-    }
64
+			} else {
65
+				return true;
66
+			}
67
+		} else if ( isset( $image->error_data['error_loading_image'] ) ) {
68
+			TimberHelper::error_log( 'Error loading ' . $image->error_data['error_loading_image'] );
69
+		} else {
70
+			TimberHelper::error_log( $image );
71
+		}
72
+		return false;
73
+	}
74 74
 }
Please login to merge, or discard this patch.
timber.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@
 block discarded – undo
15 15
 // then in the wp-content dir (site install).
16 16
 // and finally in the current themes directories.
17 17
 if (   file_exists( $composer_autoload = __DIR__ . '/vendor/autoload.php' ) /* check in self */
18
-    || file_exists( $composer_autoload = WP_CONTENT_DIR.'/vendor/autoload.php') /* check in wp-content */
19
-    || file_exists( $composer_autoload = plugin_dir_path( __FILE__ ).'vendor/autoload.php') /* check in plugin directory */
20
-    || file_exists( $composer_autoload = get_stylesheet_directory().'/vendor/autoload.php') /* check in child theme */
21
-    || file_exists( $composer_autoload = get_template_directory().'/vendor/autoload.php') /* check in parent theme */
18
+	|| file_exists( $composer_autoload = WP_CONTENT_DIR.'/vendor/autoload.php') /* check in wp-content */
19
+	|| file_exists( $composer_autoload = plugin_dir_path( __FILE__ ).'vendor/autoload.php') /* check in plugin directory */
20
+	|| file_exists( $composer_autoload = get_stylesheet_directory().'/vendor/autoload.php') /* check in child theme */
21
+	|| file_exists( $composer_autoload = get_template_directory().'/vendor/autoload.php') /* check in parent theme */
22 22
 ) {
23
-    require_once $composer_autoload;
23
+	require_once $composer_autoload;
24 24
 }
25 25
 
26 26
 $timber = new Timber();
Please login to merge, or discard this patch.
lib/timber-archives.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -1,35 +1,35 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * The TimberArchives class is used to generate a menu based on the date archives of your posts. The [Nieman Foundation News site](http://nieman.harvard.edu/news/) has an example of how the output can be used in a real site ([screenshot](https://cloud.githubusercontent.com/assets/1298086/9610076/3cdca596-50a5-11e5-82fd-acb74c09c482.png)).
4
- * @example
5
- * ```php
6
- * $context['archives'] = new TimberArchives( $args );
7
- * ```
8
- * ```twig
9
- * <ul>
10
- * {% for item in archives.items %}
11
- *     <li><a href="{{item.link}}">{{item.name}}</a></li>
12
- *     {% for child in item.children %}
13
- *         <li class="child"><a href="{{child.link}}">{{child.name}}</a></li>
14
- *     {% endfor %}
15
- * {% endfor %}
16
- * </ul>
17
- * ```
18
- * ```html
19
- * <ul>
20
- *     <li>2015</li>
21
- *     <li class="child">May</li>
22
- *     <li class="child">April</li>
23
- *     <li class="child">March</li>
24
- *     <li class="child">February</li>
25
- *     <li class="child">January</li>
26
- *     <li>2014</li>
27
- *     <li class="child">December</li>
28
- *     <li class="child">November</li>
29
- *     <li class="child">October</li>
30
- * </ul>
31
- * ```
32
- */
3
+	 * The TimberArchives class is used to generate a menu based on the date archives of your posts. The [Nieman Foundation News site](http://nieman.harvard.edu/news/) has an example of how the output can be used in a real site ([screenshot](https://cloud.githubusercontent.com/assets/1298086/9610076/3cdca596-50a5-11e5-82fd-acb74c09c482.png)).
4
+	 * @example
5
+	 * ```php
6
+	 * $context['archives'] = new TimberArchives( $args );
7
+	 * ```
8
+	 * ```twig
9
+	 * <ul>
10
+	 * {% for item in archives.items %}
11
+	 *     <li><a href="{{item.link}}">{{item.name}}</a></li>
12
+	 *     {% for child in item.children %}
13
+	 *         <li class="child"><a href="{{child.link}}">{{child.name}}</a></li>
14
+	 *     {% endfor %}
15
+	 * {% endfor %}
16
+	 * </ul>
17
+	 * ```
18
+	 * ```html
19
+	 * <ul>
20
+	 *     <li>2015</li>
21
+	 *     <li class="child">May</li>
22
+	 *     <li class="child">April</li>
23
+	 *     <li class="child">March</li>
24
+	 *     <li class="child">February</li>
25
+	 *     <li class="child">January</li>
26
+	 *     <li>2014</li>
27
+	 *     <li class="child">December</li>
28
+	 *     <li class="child">November</li>
29
+	 *     <li class="child">October</li>
30
+	 * </ul>
31
+	 * ```
32
+	 */
33 33
 class TimberArchives extends TimberCore {
34 34
 
35 35
 	public $base = '';
Please login to merge, or discard this patch.
lib/timber-post.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -231,13 +231,13 @@
 block discarded – undo
231 231
 	 	$can_preview = array();
232 232
 
233 233
 		foreach( $can as $type ) {
234
-		     if( current_user_can( $type ) ) {
235
-		        $can_preview[] = true;
236
-		     }
234
+			 if( current_user_can( $type ) ) {
235
+				$can_preview[] = true;
236
+			 }
237 237
 		}
238 238
 
239 239
 		if ( count( $can_preview ) !== count( $can ) ) {
240
-		     return;
240
+			 return;
241 241
 		}
242 242
 
243 243
 		$revisions = wp_get_post_revisions( $query->queried_object_id );
Please login to merge, or discard this patch.