Completed
Push — master ( 06c1ce...67d37c )
by Jeroen
06:20
created

MediaBundle/Helper/Media/AbstractMediaHandler.php (5 issues)

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\MediaBundle\Helper\Media;
4
5
use Kunstmaan\MediaBundle\Entity\Media;
6
7
abstract class AbstractMediaHandler
8
{
9
    private $priority;
10
11
    /**
12
     * @param int $priority
13
     */
14 21
    public function __construct($priority = 0)
15
    {
16 21
        $this->priority = $priority;
17 21
    }
18
19
    /**
20
     * @return int
21
     */
22 7
    public function getPriority()
23
    {
24 7
        return $this->priority;
25
    }
26
27
    /**
28
     * Return the default form type options
29
     *
30
     * @return array
31
     */
32
    public function getFormTypeOptions()
33
    {
34
        return array();
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    abstract public function getName();
41
42
    /**
43
     * @return string
44
     */
45
    abstract public function getType();
46
47
    /**
48
     * @return string
49
     */
50
    abstract public function getFormType();
51
52
    /**
53
     * @param mixed $media
54
     */
55
    abstract public function canHandle($media);
0 ignored issues
show
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
56
57
    /**
58
     * @param Media $media
59
     *
60
     * @return mixed
61
     */
62
    abstract public function getFormHelper(Media $media);
63
64
    /**
65
     * @param Media $media
66
     */
67
    abstract public function prepareMedia(Media $media);
0 ignored issues
show
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
68
69
    /**
70
     * @param Media $media
71
     */
72
    abstract public function saveMedia(Media $media);
0 ignored issues
show
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
73
74
    /**
75
     * @param Media $media
76
     */
77
    abstract public function updateMedia(Media $media);
0 ignored issues
show
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
78
79
    /**
80
     * @param Media $media
81
     */
82
    abstract public function removeMedia(Media $media);
0 ignored issues
show
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
83
84
    /**
85
     * @param mixed $data
86
     *
87
     * @return Media
88
     */
89
    abstract public function createNew($data);
90
91
    public function getShowTemplate(Media $media)
92
    {
93
        return '@KunstmaanMedia/Media/show.html.twig';
94
    }
95
96
    /**
97
     * @param Media  $media    The media entity
98
     * @param string $basepath The base path
99
     *
100
     * @return string
101
     */
102
    public function getImageUrl(Media $media, $basepath)
103
    {
104
        return null;
105
    }
106
107
    /**
108
     * @return array
109
     */
110
    abstract public function getAddFolderActions();
111
}
112