irishdan /
ResponsiveImageBundle
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * This file is part of the IrishDan\ResponsiveImageBundle package. |
||
| 4 | * |
||
| 5 | * (c) Daniel Byrne <[email protected]> |
||
| 6 | * |
||
| 7 | * For the full copyright and license information, please view the LICENSE file that was distributed with this source |
||
| 8 | * code. |
||
| 9 | */ |
||
| 10 | |||
| 11 | namespace IrishDan\ResponsiveImageBundle\EventSubscriber; |
||
| 12 | |||
| 13 | use IrishDan\ResponsiveImageBundle\Event\UploaderEvent; |
||
| 14 | use IrishDan\ResponsiveImageBundle\Event\UploaderEvents; |
||
| 15 | use League\Flysystem\FilesystemInterface; |
||
| 16 | use Psr\Log\LoggerInterface; |
||
| 17 | use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Class UploaderSubscriber |
||
| 21 | * |
||
| 22 | * @package IrishDan\ResponsiveImageBundle\EventSubscriber |
||
| 23 | */ |
||
| 24 | class UploaderSubscriber implements EventSubscriberInterface |
||
| 25 | { |
||
| 26 | /** |
||
| 27 | * @var FilesystemInterface |
||
| 28 | */ |
||
| 29 | private $fileSystem; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * UploaderSubscriber constructor. |
||
| 33 | * |
||
| 34 | * @param FilesystemInterface $fileSystem |
||
| 35 | */ |
||
| 36 | public function __construct(FilesystemInterface $fileSystem) |
||
| 37 | { |
||
| 38 | $this->fileSystem = $fileSystem; |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @return array |
||
| 43 | */ |
||
| 44 | public static function getSubscribedEvents() |
||
| 45 | { |
||
| 46 | return [ |
||
| 47 | UploaderEvents::UPLOADER_PRE_UPLOAD => 'onPreUpload', |
||
| 48 | UploaderEvents::UPLOADER_UPLOADED => 'onUploaded', |
||
| 49 | ]; |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @param UploaderEvent $event |
||
| 54 | */ |
||
| 55 | public function onPreUpload(UploaderEvent $event) |
||
| 56 | { |
||
| 57 | // This is how we can swap filesystems. |
||
| 58 | $uploader = $event->getUploader(); |
||
| 59 | |||
| 60 | if (empty($uploader->getFileSystem())) { |
||
|
0 ignored issues
–
show
|
|||
| 61 | $uploader->setFileSystem($this->fileSystem); |
||
|
0 ignored issues
–
show
The method
setFileSystem() does not seem to exist on object<IrishDan\Responsi...ndle\UploaderInterface>.
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. Loading history...
|
|||
| 62 | } |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @param UploaderEvent $event |
||
| 67 | */ |
||
| 68 | public function onUploaded(UploaderEvent $event) |
||
|
0 ignored issues
–
show
|
|||
| 69 | { |
||
| 70 | // @TODO: Implement |
||
| 71 | } |
||
| 72 | } |
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.