for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class ElectronicDownloadProductCleanUp extends BuildTask
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.
{
protected $title = "Remove expired downloads from the download folder.";
protected $description = "Removes all the expired downloads from the download folder.";
public function run($request)
$items = ElectronicDelivery_OrderLog::get()->filter(array("Completed" => 0));
foreach ($items as $item) {
if ($item->IsExpired()) {
//a simple write will take care of all the deletion process...
$item->deleteFolderIfExpired();
} else {
else
This check looks for the else branches of if statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.
if
These else branches can be removed.
if (rand(1, 6) > 3) { print "Check failed"; } else { //print "Check succeeded"; }
could be turned into
if (rand(1, 6) > 3) { print "Check failed"; }
This is much more concise to read.
//do nothing
}
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.