@@ -4,8 +4,7 @@ discard block |
||
| 4 | 4 | * @package deploynaut |
| 5 | 5 | * @subpackage control |
| 6 | 6 | */ |
| 7 | -class EmailMessagingService implements ConfirmationMessagingService |
|
| 8 | -{ |
|
| 7 | +class EmailMessagingService implements ConfirmationMessagingService { |
|
| 9 | 8 | |
| 10 | 9 | /** |
| 11 | 10 | * @config |
@@ -19,8 +18,7 @@ discard block |
||
| 19 | 18 | */ |
| 20 | 19 | private static $default_subject = 'Deploynaut notification'; |
| 21 | 20 | |
| 22 | - public function sendMessage($source, $message, $recipients, $arguments = array()) |
|
| 23 | - { |
|
| 21 | + public function sendMessage($source, $message, $recipients, $arguments = array()) { |
|
| 24 | 22 | $from = empty($arguments['from']) |
| 25 | 23 | ? Config::inst()->get(get_class($this), 'default_from') |
| 26 | 24 | : $arguments['from']; |
@@ -42,8 +40,7 @@ discard block |
||
| 42 | 40 | * @param string $subject |
| 43 | 41 | * @return boolean True if success |
| 44 | 42 | */ |
| 45 | - protected function sendIndividualMessages($source, $message, $recipients, $from, $subject) |
|
| 46 | - { |
|
| 43 | + protected function sendIndividualMessages($source, $message, $recipients, $from, $subject) { |
|
| 47 | 44 | // Split recipients that are comma separated |
| 48 | 45 | if (is_string($recipients) && stripos($recipients, ',')) { |
| 49 | 46 | $recipients = explode(',', $recipients); |
@@ -77,8 +74,7 @@ discard block |
||
| 77 | 74 | * @param string $subject |
| 78 | 75 | * @param string $body |
| 79 | 76 | */ |
| 80 | - protected function sendMessageTo($source, $from, $to, $subject, $body) |
|
| 81 | - { |
|
| 77 | + protected function sendMessageTo($source, $from, $to, $subject, $body) { |
|
| 82 | 78 | if ($to instanceof Member) { |
| 83 | 79 | $to = $to->Email; |
| 84 | 80 | } |
@@ -94,8 +90,7 @@ discard block |
||
| 94 | 90 | * @param string $subject |
| 95 | 91 | * @param string $body |
| 96 | 92 | */ |
| 97 | - protected function sendViaEmail($source, $from, $to, $subject, $body) |
|
| 98 | - { |
|
| 93 | + protected function sendViaEmail($source, $from, $to, $subject, $body) { |
|
| 99 | 94 | $email = new Email($from, $to, $subject, $body); |
| 100 | 95 | if ($source->getDryRun()) { |
| 101 | 96 | $source->log("[Skipped] Sent message to $to (subject: $subject)"); |
@@ -1,7 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -class PipelineController extends Controller |
|
| 4 | -{ |
|
| 3 | +class PipelineController extends Controller { |
|
| 5 | 4 | |
| 6 | 5 | private static $allowed_actions = array( |
| 7 | 6 | 'abort', |
@@ -13,8 +12,7 @@ discard block |
||
| 13 | 12 | |
| 14 | 13 | protected $pipeline = null; |
| 15 | 14 | |
| 16 | - public function __construct($controller, Pipeline $pipeline) |
|
| 17 | - { |
|
| 15 | + public function __construct($controller, Pipeline $pipeline) { |
|
| 18 | 16 | $this->controller = $controller; |
| 19 | 17 | parent::__construct(); |
| 20 | 18 | $this->pipeline = $pipeline; |
@@ -23,8 +21,7 @@ discard block |
||
| 23 | 21 | /** |
| 24 | 22 | * Shows status of this pipeline |
| 25 | 23 | */ |
| 26 | - public function index() |
|
| 27 | - { |
|
| 24 | + public function index() { |
|
| 28 | 25 | return $this->controller->customise(new ArrayData(array( |
| 29 | 26 | 'Pipeline' => $this->pipeline |
| 30 | 27 | )))->renderWith('DNRoot_pipeline'); |
@@ -33,8 +30,7 @@ discard block |
||
| 33 | 30 | /** |
| 34 | 31 | * Get log for this pipeline |
| 35 | 32 | */ |
| 36 | - public function log() |
|
| 37 | - { |
|
| 33 | + public function log() { |
|
| 38 | 34 | $log = $this->pipeline->getLogger(); |
| 39 | 35 | if ($log->exists()) { |
| 40 | 36 | $content = $log->content(); |
@@ -61,8 +57,7 @@ discard block |
||
| 61 | 57 | /** |
| 62 | 58 | * Aborts the current pipeline |
| 63 | 59 | */ |
| 64 | - public function abort() |
|
| 65 | - { |
|
| 60 | + public function abort() { |
|
| 66 | 61 | if ($this->pipeline->canAbort()) { |
| 67 | 62 | $this->pipeline->markAborted(); |
| 68 | 63 | } |
@@ -72,8 +67,7 @@ discard block |
||
| 72 | 67 | /** |
| 73 | 68 | * Perform an action on the current pipeline step |
| 74 | 69 | */ |
| 75 | - public function step() |
|
| 76 | - { |
|
| 70 | + public function step() { |
|
| 77 | 71 | $action = $this->request->param('ID'); |
| 78 | 72 | $step = $this->pipeline->CurrentStep(); |
| 79 | 73 | |
@@ -1,14 +1,12 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -class GitSHA extends Varchar |
|
| 4 | -{ |
|
| 3 | +class GitSHA extends Varchar { |
|
| 5 | 4 | |
| 6 | 5 | /** |
| 7 | 6 | * @param string|null $name |
| 8 | 7 | * @param array $options |
| 9 | 8 | */ |
| 10 | - public function __construct($name = null, $options = array()) |
|
| 11 | - { |
|
| 9 | + public function __construct($name = null, $options = array()) { |
|
| 12 | 10 | // Size should probably be 40, but to avoid schema change leave for now |
| 13 | 11 | parent::__construct($name, 255, $options); |
| 14 | 12 | } |
@@ -16,16 +14,14 @@ discard block |
||
| 16 | 14 | /** |
| 17 | 15 | * @return string |
| 18 | 16 | */ |
| 19 | - public function FullHash() |
|
| 20 | - { |
|
| 17 | + public function FullHash() { |
|
| 21 | 18 | return $this->value; |
| 22 | 19 | } |
| 23 | 20 | |
| 24 | 21 | /** |
| 25 | 22 | * @return string |
| 26 | 23 | */ |
| 27 | - public function ShortHash() |
|
| 28 | - { |
|
| 24 | + public function ShortHash() { |
|
| 29 | 25 | return substr($this->value, 0, 7); |
| 30 | 26 | } |
| 31 | 27 | } |
@@ -1,7 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -interface DeploynautEventInterface extends \League\Event\EventInterface |
|
| 4 | -{ |
|
| 3 | +interface DeploynautEventInterface extends \League\Event\EventInterface { |
|
| 5 | 4 | |
| 6 | 5 | /** |
| 7 | 6 | * Should return the event name, e.g 'event.name' |
@@ -20,8 +20,7 @@ discard block |
||
| 20 | 20 | * |
| 21 | 21 | * See more on how to use the event system here: http://event.thephpleague.com/2.0/ |
| 22 | 22 | */ |
| 23 | -class GenericEvent extends AbstractEvent implements DeploynautEventInterface |
|
| 24 | -{ |
|
| 23 | +class GenericEvent extends AbstractEvent implements DeploynautEventInterface { |
|
| 25 | 24 | |
| 26 | 25 | /** |
| 27 | 26 | * @var string |
@@ -39,8 +38,7 @@ discard block |
||
| 39 | 38 | * |
| 40 | 39 | * @return GenericEvent |
| 41 | 40 | */ |
| 42 | - public static function create($name, array $data) |
|
| 43 | - { |
|
| 41 | + public static function create($name, array $data) { |
|
| 44 | 42 | return Injector::inst()->createWithArgs(get_called_class(), [$name, $data]); |
| 45 | 43 | } |
| 46 | 44 | |
@@ -50,8 +48,7 @@ discard block |
||
| 50 | 48 | * @param string $eventName - e.g. 'event.name' |
| 51 | 49 | * @param array $data |
| 52 | 50 | */ |
| 53 | - public function __construct($eventName, array $data) |
|
| 54 | - { |
|
| 51 | + public function __construct($eventName, array $data) { |
|
| 55 | 52 | $this->name = $eventName; |
| 56 | 53 | $this->data = $data; |
| 57 | 54 | } |
@@ -61,8 +58,7 @@ discard block |
||
| 61 | 58 | * |
| 62 | 59 | * @return string |
| 63 | 60 | */ |
| 64 | - public function getName() |
|
| 65 | - { |
|
| 61 | + public function getName() { |
|
| 66 | 62 | return $this->name; |
| 67 | 63 | } |
| 68 | 64 | |
@@ -73,8 +69,7 @@ discard block |
||
| 73 | 69 | * |
| 74 | 70 | * @return string |
| 75 | 71 | */ |
| 76 | - public function get($keyname) |
|
| 77 | - { |
|
| 72 | + public function get($keyname) { |
|
| 78 | 73 | if (array_key_exists($keyname, $this->data)) { |
| 79 | 74 | return $this->data[$keyname]; |
| 80 | 75 | } |
@@ -86,8 +81,7 @@ discard block |
||
| 86 | 81 | * |
| 87 | 82 | * @return array |
| 88 | 83 | */ |
| 89 | - public function asArray() |
|
| 90 | - { |
|
| 84 | + public function asArray() { |
|
| 91 | 85 | $payload = $this->data; |
| 92 | 86 | $payload['event'] = $this->getName(); |
| 93 | 87 | return $payload; |
@@ -98,8 +92,7 @@ discard block |
||
| 98 | 92 | * |
| 99 | 93 | * @return string - returns the data as json |
| 100 | 94 | */ |
| 101 | - public function asJSON() |
|
| 102 | - { |
|
| 95 | + public function asJSON() { |
|
| 103 | 96 | return json_encode($this->asArray()); |
| 104 | 97 | } |
| 105 | 98 | } |
@@ -1,14 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | -class DeploynautFileExtension extends DataExtension |
|
| 3 | -{ |
|
| 2 | +class DeploynautFileExtension extends DataExtension { |
|
| 4 | 3 | /** |
| 5 | 4 | * If this file is attached to a {@link DNDataArchive}, then we need to check security permissions, to ensure the |
| 6 | 5 | * currently logged in {@link Member} can download the file. |
| 7 | 6 | * |
| 8 | 7 | * This uses the secureassets module to provide the security of these assets. |
| 9 | 8 | */ |
| 10 | - public function canDownload() |
|
| 11 | - { |
|
| 9 | + public function canDownload() { |
|
| 12 | 10 | $member = Member::currentUser(); |
| 13 | 11 | $file = $this->owner; |
| 14 | 12 | $archive = DNDataArchive::get()->filter('ArchiveFileID', $file->ID)->First(); |
@@ -1,10 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -class DeploynautSecurityExtension extends Extension |
|
| 4 | -{ |
|
| 3 | +class DeploynautSecurityExtension extends Extension { |
|
| 5 | 4 | |
| 6 | - public function onAfterInit() |
|
| 7 | - { |
|
| 5 | + public function onAfterInit() { |
|
| 8 | 6 | // the 'ping' action is called via AJAX from the /admin and will cause |
| 9 | 7 | // the admin section to 'grow' over time. We only need the css and js |
| 10 | 8 | // for login, reset, logout and so on. |
@@ -1,10 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -class FrontendLink extends DataExtension |
|
| 4 | -{ |
|
| 3 | +class FrontendLink extends DataExtension { |
|
| 5 | 4 | |
| 6 | - public function updateItemEditForm($form) |
|
| 7 | - { |
|
| 5 | + public function updateItemEditForm($form) { |
|
| 8 | 6 | if ($this->owner->record->hasMethod('Link')) { |
| 9 | 7 | $link = sprintf( |
| 10 | 8 | '<a style="margin: 0.5em" target="deploynaut-frontend" href="%s">Preview »</a>', |
@@ -1,7 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -class ProjectMemberExtension extends DataExtension |
|
| 4 | -{ |
|
| 3 | +class ProjectMemberExtension extends DataExtension { |
|
| 5 | 4 | |
| 6 | 5 | /** |
| 7 | 6 | * @var array |