for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class GalleryImageShortCodeHandler
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
public static function parse_gallery_image($arguments, $caption = null, $parser = null)
$caption
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$parser
// first things first, if we dont have an ID, then we don't need to
// go any further
if (empty($arguments['id'])) {
return;
}
$customise = array();
$galleryImage = DataObject::get_by_id('GalleryImage', $arguments['id']);
if (!$galleryImage) {
return 'image not found';
$customise['Image'] = $galleryImage->Image();
$customise['Aperture'] = $galleryImage->Aperture;
$customise['ShutterSpeed'] = $galleryImage->ShutterSpeed;
//set the caption
$customise['Title'] = $galleryImage->Title;
//overide the defaults with the arguments supplied
$customise = array_merge($customise, $arguments);
//get our YouTube template
$template = new SSViewer('ShortCodeGalleryImage');
//return the customised template
return $template->process(new ArrayData($customise));
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.