Skip to content

Commit

Permalink
Code improvements and docblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Erkelens committed May 10, 2018
1 parent 2c67c1a commit bc9e29b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 0 additions & 2 deletions src/extensions/SiteConfigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Firesphere\PartialUserforms\Extensions;

use DateInterval;
use DateTime;
use Firesphere\PartialUserforms\Jobs\PartialSubmissionJob;
use Firesphere\PartialUserforms\Services\DateService;
use SilverStripe\Core\Injector\Injector;
Expand Down
18 changes: 11 additions & 7 deletions src/jobs/PartialSubmissionJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Firesphere\PartialUserforms\Jobs;

use DateInterval;
use DateTime;
use Firesphere\PartialUserforms\Models\PartialFieldSubmission;
use Firesphere\PartialUserforms\Models\PartialFormSubmission;
use Firesphere\PartialUserforms\Services\DateService;
Expand Down Expand Up @@ -148,8 +146,8 @@ protected function getParents()
}

/**
* @param $file
* @param $form
* @param string $file
* @param UserDefinedForm $form
*/
protected function buildCSV($file, $form)
{
Expand All @@ -169,9 +167,9 @@ protected function buildCSV($file, $form)
}

/**
* @param $form
* @param $submissions
* @param $resource
* @param UserDefinedForm $form
* @param PartialFormSubmission $submissions
* @param resource $resource
*/
protected function processSubmissions($form, $submissions, $resource)
{
Expand All @@ -193,6 +191,9 @@ protected function processSubmissions($form, $submissions, $resource)
}
}

/**
* Send out the email(s)
*/
protected function sendEmail()
{
/** @var Email $mail */
Expand Down Expand Up @@ -285,6 +286,9 @@ public function addAddress($address)
}
}

/**
* @return SiteConfig
*/
public function getConfig()
{
return $this->config;
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/SiteConfigHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
class SiteConfigHelper
{
public static function createSiteConfig($addresses = null, $from = null, $send = true, $cleanup = true)
public static function setupSiteConfig($addresses = null, $from = null, $send = true, $cleanup = true)
{
$config = SiteConfig::current_site_config();
$config->SendMailTo = $addresses;
Expand Down
1 change: 0 additions & 1 deletion tests/unit/PartialSubmissionTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Security\Member;
use SilverStripe\Security\Security;
use SilverStripe\SiteConfig\SiteConfig;
use Symbiote\QueuedJobs\Services\QueuedJobService;

class PartialSubmissionTaskTest extends SapphireTest
Expand Down

0 comments on commit bc9e29b

Please sign in to comment.