| Total Complexity | 12 |
| Total Lines | 60 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | class SVGExtension extends DataExtension |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * Check file extension SVG |
||
| 19 | * @return boolean |
||
| 20 | */ |
||
| 21 | public function isSVG(){ |
||
| 22 | if($this->owner->getExtension()=='svg') return true; |
||
| 23 | return false; |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * |
||
| 28 | * SVG RAW LINE |
||
| 29 | * @return string|boolean |
||
| 30 | */ |
||
| 31 | public function SVGRAW(){ |
||
| 32 | if($this->owner->getExtension() != 'svg'){ |
||
| 33 | return false; |
||
| 34 | } |
||
| 35 | $metadata = $this->owner->File->getMetadata(); |
||
|
|
|||
| 36 | if(array_key_exists('path', $metadata)){ |
||
| 37 | $filePath = ASSETS_PATH . DIRECTORY_SEPARATOR . $metadata['path']; |
||
| 38 | if (file_exists($filePath)) { |
||
| 39 | |||
| 40 | $data = file_get_contents($filePath); |
||
| 41 | if(strpos($data, 'svg') !== false){ |
||
| 42 | $buffer = trim(preg_replace( "/\r|\n/", "",$data)); |
||
| 43 | $html = DBHTMLText::create(); |
||
| 44 | $html->setValue($buffer); |
||
| 45 | return $html; |
||
| 46 | } |
||
| 47 | } |
||
| 48 | |||
| 49 | } |
||
| 50 | return false; |
||
| 51 | } |
||
| 52 | |||
| 53 | |||
| 54 | public function ImageOrSVG(){ |
||
| 59 | } |
||
| 60 | |||
| 61 | public function getThumbnail(){ |
||
| 75 | } |
||
| 76 | } |
||
| 78 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.