Completed
Push — master ( b7739e...2077f6 )
by
unknown
22s queued 10s
created

MeCollection   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCollectionsList() 0 10 2
1
<?php
2
3
/*
4
 * This file is part of Phraseanet SDK.
5
 *
6
 * (c) Alchemy <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace PhraseanetSDK\Repository;
13
14
use PhraseanetSDK\AbstractRepository;
15
use PhraseanetSDK\Exception\NotFoundException;
16
use PhraseanetSDK\Exception\RuntimeException;
17
use PhraseanetSDK\Exception\UnauthorizedException;
18
19
class MeCollection extends AbstractRepository
20
{
21
	/**
22
	 * Return all collections available
23
	 *
24
	 * @return MeCollection[]
25
	 * @throws NotFoundException
26
	 * @throws UnauthorizedException
27
	 */
28
	public function getCollectionsList()
29
	{
30
		$response = $this->query('GET', 'v1/me/collections/');
31
32
		if ($response->hasProperty(('collections')) !== true) {
33
			throw new RuntimeException('Missing "collections" property in response content');
34
		}
35
36
		return \PhraseanetSDK\Entity\MeCollection::fromList($response->getProperty('collections'));
37
	}
38
}
39