Completed
Push — master ( 1de9b7...830752 )
by Kristof
38:46 queued 24:09
created

ArticleBundle/Entity/AbstractArticlePage.php (1 issue)

Checks whether return doc types can be made more specific.

Documentation Informational

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Kunstmaan\ArticleBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Kunstmaan\ArticleBundle\Form\AbstractArticlePageAdminType;
7
use Kunstmaan\ArticleBundle\PagePartAdmin\AbstractArticlePagePagePartAdminConfigurator;
8
use Kunstmaan\NodeBundle\Entity\AbstractPage;
9
use Kunstmaan\PagePartBundle\Helper\HasPagePartsInterface;
10
11
abstract class AbstractArticlePage extends AbstractPage implements HasPagePartsInterface
12
{
13
    /**
14
     * The article's date, set automatically to 'now' before persisting when empty
15
     *
16
     * @var \DateTime
17
     *
18
     * @ORM\Column(type="datetime")
19
     */
20
    protected $date;
21
22
    /**
23
     * @var string
24
     *
25
     * @ORM\Column(name="summary", type="text", nullable=true)
26
     */
27
    protected $summary;
28
29
    /**
30
     * Return the date of this article
31
     *
32
     * @param \DateTime $date
33
     */
34
    public function setDate($date)
35
    {
36
        $this->date = $date;
37
    }
38
39
    /**
40
     * Set the date of the article
41
     *
42
     * @return \DateTime
43
     */
44
    public function getDate()
45
    {
46
        return $this->date;
47
    }
48
49
    /**
50
     * Set the summary of this article
51
     *
52
     * @param $summary
53
     */
54
    public function setSummary($summary)
55
    {
56
        $this->summary = $summary;
57
    }
58
59
    /**
60
     * Returns the summary of this article
61
     *
62
     * @return string
63
     */
64
    public function getSummary()
65
    {
66
        return $this->summary;
67
    }
68
69
    /**
70
     * @return array
71
     */
72
    public function getPossibleChildTypes()
73
    {
74
        return array();
75
    }
76
77
    /**
78
     * {@inheritdoc}
79
     */
80
    public function getDefaultAdminType()
81
    {
82
        return AbstractArticlePageAdminType::class;
83
    }
84
85
    public function getAdminType()
86
    {
87
        return $this->getDefaultAdminType();
88
    }
89
90
    /**
91
     * @return array
0 ignored issues
show
Consider making the return type a bit more specific; maybe use AbstractArticlePagePagePartAdminConfigurator[].

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
92
     */
93
    public function getPagePartAdminConfigurations()
94
    {
95
        return array(new AbstractArticlePagePagePartAdminConfigurator());
96
    }
97
}
98