Blog   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 5
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 72
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getPostsRepository() 0 4 1
A setPostsRepository() 0 4 1
A getCategoriesRepository() 0 4 1
A setCategoriesRepository() 0 4 1
1
<?php namespace jlourenco\blog;
2
3
use jlourenco\blog\Repositories\BlogPostRepositoryInterface;
4
use jlourenco\blog\Repositories\BlogCategoryRepositoryInterface;
5
6
class Blog
7
{
8
9
    /**
10
     * The Post repository.
11
     *
12
     * @var \jlourenco\blog\Repositories\BlogPostRepositoryInterface
13
     */
14
    protected $posts;
15
16
    /**
17
     * The Category repository.
18
     *
19
     * @var \jlourenco\blog\Repositories\BlogCategoryRepositoryInterface
20
     */
21
    protected $categories;
22
23
    /**
24
     * Create a new Blog instance.
25
     *
26
     * @param  \jlourenco\blog\Repositories\BlogPostRepositoryInterface  $posts
27
     * @param  \jlourenco\blog\Repositories\BlogCategoryRepositoryInterface  $categories
28
     */
29
    public function __construct(BlogPostRepositoryInterface $posts, BlogCategoryRepositoryInterface $categories)
30
    {
31
        $this->categories = $categories;
32
        $this->posts = $posts;
33
    }
34
35
    /**
36
     * Returns the posts repository.
37
     *c
38
     * @return \jlourenco\blog\Repositories\BlogPostRepositoryInterface
39
     */
40
    public function getPostsRepository()
41
    {
42
        return $this->posts;
43
    }
44
45
    /**
46
     * Sets the posts repository.
47
     *
48
     * @param  \jlourenco\blog\Repositories\BlogPostRepositoryInterface $posts
49
     * @return void
50
     */
51
    public function setPostsRepository(BlogPostRepositoryInterface $posts)
52
    {
53
        $this->posts = $posts;
54
    }
55
56
    /**
57
     * Returns the categories repository.
58
     *c
59
     * @return \jlourenco\blog\Repositories\BlogCategoryRepositoryInterface
60
     */
61
    public function getCategoriesRepository()
62
    {
63
        return $this->categories;
64
    }
65
66
    /**
67
     * Sets the categories repository.
68
     *
69
     * @param  \jlourenco\blog\Repositories\BlogCategoryRepositoryInterface $categories
70
     * @return void
71
     */
72
    public function setCategoriesRepository(BlogCategoryRepositoryInterface $categories)
73
    {
74
        $this->categories = $categories;
75
    }
76
77
}
78