for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class AddImageExtension extends DataExtension {
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.
private static $has_one = array(
$has_one
This check marks private properties in classes that are never used. Those properties can be removed.
'MainImage' => 'Image'
);
/*
Add a Location tab containing the map
*/
public function updateCMSFields(FieldList $fields) {
$fields->addFieldToTab('Root.Image', $uf = new UploadField('MainImage',
_t('PageWithImage.MAIN_IMAGE', 'Main Image')));
$uf->setFolderName('pagewithimage');
}
public function getPortletTitle() {
return $this->owner->Title;
public function getPortletImage() {
return $this->owner->MainImage();
public function getPortletCaption() {
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.