1 | <?php |
||
16 | class Swift_Attachment extends Swift_Mime_Attachment |
||
|
|||
17 | { |
||
18 | /** |
||
19 | * Create a new Attachment. |
||
20 | * |
||
21 | * Details may be optionally provided to the constructor. |
||
22 | * |
||
23 | * @param string|Swift_OutputByteStream $data |
||
24 | * @param string $filename |
||
25 | * @param string $contentType |
||
26 | */ |
||
27 | 6 | public function __construct($data = null, $filename = null, $contentType = null) |
|
28 | { |
||
29 | call_user_func_array( |
||
30 | 6 | array($this, 'Swift_Mime_Attachment::__construct'), |
|
31 | 6 | Swift_DependencyContainer::getInstance()->createDependenciesFor('mime.attachment') |
|
32 | ); |
||
33 | |||
34 | $this->setBody($data); |
||
35 | $this->setFilename($filename); |
||
36 | if ($contentType) { |
||
37 | $this->setContentType($contentType); |
||
38 | } |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * Create a new Attachment. |
||
43 | * |
||
44 | * @param string|Swift_OutputByteStream $data |
||
45 | * @param string $filename |
||
46 | * @param string $contentType |
||
47 | * |
||
48 | * @return Swift_Mime_Attachment |
||
49 | */ |
||
50 | 6 | public static function newInstance($data = null, $filename = null, $contentType = null) |
|
54 | |||
55 | /** |
||
56 | * Create a new Attachment from a filesystem path. |
||
57 | * |
||
58 | * @param string $path |
||
59 | * @param string $contentType optional |
||
60 | * |
||
61 | * @return Swift_Mime_Attachment |
||
62 | */ |
||
63 | public static function fromPath($path, $contentType = null) |
||
70 | } |
||
71 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.