Completed
Push — develop ( f6ac94...a82602 )
by Paul
01:59
created

Media::getImagesPerPage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
namespace GeminiLabs\Castor\Helpers;
4
5
use GeminiLabs\Castor\Gallery;
6
use GeminiLabs\Castor\Image;
7
use GeminiLabs\Castor\Video;
8
9
class Media
10
{
11
	public $gallery;
12
	public $image;
13
	public $video;
14
15
	public function __construct( Gallery $gallery, Image $image, Video $video )
16
	{
17
		$this->gallery = $gallery;
18
		$this->image   = $image;
19
		$this->video   = $video;
20
	}
21
22
	/**
23
	 * @return void|string
24
	 */
25
	public function gallery( array $args = [] )
26
	{
27
		$gallery = $this->gallery->query( $args );
28
29
		if( $gallery->have_posts() ) {
30
			return $this->gallery->render( $gallery ) . $this->gallery->renderPagination( $gallery );
31
		}
32
	}
33
34
	/**
35
	 * @return WP_Query
36
	 */
37
	public function getGalleryQuery( array $args = [] )
38
	{
39
		return $this->gallery->query( $args );
40
	}
41
}
42