Unify code style for short syntax arrays
authorMatthias Schmidt <gravatronics@live.com>
Thu, 7 Apr 2016 16:23:01 +0000 (18:23 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Thu, 7 Apr 2016 16:23:01 +0000 (18:23 +0200)
22 files changed:
wcfsetup/install/files/lib/acp/form/AbstractBulkProcessingForm.class.php
wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php
wcfsetup/install/files/lib/core.functions.php
wcfsetup/install/files/lib/data/clipboard/item/ClipboardItemAction.class.php
wcfsetup/install/files/lib/data/cronjob/CronjobEditor.class.php
wcfsetup/install/files/lib/data/tag/TagAction.class.php
wcfsetup/install/files/lib/system/background/BackgroundQueueHandler.class.php
wcfsetup/install/files/lib/system/bulk/processing/user/AbstractUserBulkProcessingAction.class.php
wcfsetup/install/files/lib/system/bulk/processing/user/AbstractUserGroupsUserBulkProcessingAction.class.php
wcfsetup/install/files/lib/system/cache/builder/TemplateListenerCodeCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/UserGroupPermissionCacheBuilder.class.php
wcfsetup/install/files/lib/system/clipboard/action/MediaClipboardAction.class.php
wcfsetup/install/files/lib/system/clipboard/action/TagClipboardAction.class.php
wcfsetup/install/files/lib/system/condition/AbstractObjectTextPropertyCondition.class.php
wcfsetup/install/files/lib/system/condition/AbstractTimestampCondition.class.php
wcfsetup/install/files/lib/system/cronjob/BackgroundQueueCleanUpCronjob.class.php
wcfsetup/install/files/lib/system/database/exception/DatabaseQueryExecutionException.class.php
wcfsetup/install/files/lib/system/email/Email.class.php
wcfsetup/install/files/lib/system/email/mime/AbstractMimePart.class.php
wcfsetup/install/files/lib/system/email/mime/AttachmentMimePart.class.php
wcfsetup/install/files/lib/system/email/transport/SmtpEmailTransport.class.php
wcfsetup/install/files/lib/system/upload/DefaultUploadFileSaveStrategy.class.php

index 6dc51d4210179c58c3b2f247f81ccc8722de738c..8574c0d7095f6a9f1e8672b94649ca4a759b7054 100644 (file)
@@ -100,7 +100,7 @@ abstract class AbstractBulkProcessingForm extends AbstractForm {
                foreach ($conditionObjectTypes as $objectType) {
                        if ($objectType->conditiongroup) {
                                if (!isset($this->conditions[$objectType->conditiongroup])) {
-                                       $this->conditions[$objectType->conditiongroup] = [ ];
+                                       $this->conditions[$objectType->conditiongroup] = [];
                                }
                                
                                $this->conditions[$objectType->conditiongroup][$objectType->objectTypeID] = $objectType;
index e270a5576b57272f12ba2975b9fc26aa27ba357c..c3b916eb6e7871ace58a302f30f92c6dc4b09488 100755 (executable)
@@ -143,7 +143,7 @@ class UserSearchForm extends UserOptionListForm {
                        if (!$objectType->conditiongroup) continue;
                        
                        if (!isset($this->conditions[$objectType->conditiongroup])) {
-                               $this->conditions[$objectType->conditiongroup] = [ ];
+                               $this->conditions[$objectType->conditiongroup] = [];
                        }
                        
                        $this->conditions[$objectType->conditiongroup][$objectType->objectTypeID] = $objectType;
index b7929b326d1958039093e5e6cda46162edd2c649..8b1b80639854ff46093e7e7cd86337352c4a6d63 100644 (file)
@@ -10,13 +10,13 @@ namespace {
        use wcf\system\WCF;
 
        // set exception handler
-       set_exception_handler([ WCF::class, 'handleException' ]);
+       set_exception_handler([WCF::class, 'handleException']);
        // set php error handler
-       set_error_handler([ WCF::class, 'handleError' ], E_ALL);
+       set_error_handler([WCF::class, 'handleError'], E_ALL);
        // set shutdown function
-       register_shutdown_function([ WCF::class, 'destruct' ]);
+       register_shutdown_function([WCF::class, 'destruct']);
        // set autoload function
-       spl_autoload_register([ WCF::class, 'autoload' ]);
+       spl_autoload_register([WCF::class, 'autoload']);
 
        // define escape string shortcut
        function escapeString($string) {
index dfda53652ddb5deeebc9684fa414e02609e78fae..5decb765ba060e378cb1d578e38902e0bdfaa6d6 100644 (file)
@@ -109,7 +109,7 @@ class ClipboardItemAction extends AbstractDatabaseObjectAction {
        public function unmarkAll() {
                ClipboardHandler::getInstance()->unmarkAll($this->objectTypeID);
                
-               return [ 'objectType' => $this->parameters['objectType'] ];
+               return ['objectType' => $this->parameters['objectType']];
        }
        
        /**
@@ -158,7 +158,7 @@ class ClipboardItemAction extends AbstractDatabaseObjectAction {
                                        'actionName' => $item->getName(),
                                        'internalData' => $item->getInternalData(),
                                        'parameters' => $item->getParameters(),
-                                       'label' => WCF::getLanguage()->getDynamicVariable('wcf.clipboard.item.' . $item->getName(), [ 'count' => $item->getCount() ]),
+                                       'label' => WCF::getLanguage()->getDynamicVariable('wcf.clipboard.item.' . $item->getName(), ['count' => $item->getCount()]),
                                        'url' => $item->getURL()
                                ];
                        }
index 9ac7b9eb6b0a797b06e7317ece9c65afbf702168..567020c5bc60aed3d82c21694c4472cf82575049 100644 (file)
@@ -96,7 +96,7 @@ class CronjobEditor extends DatabaseObjectEditor implements IEditableCachedObjec
                        $sql = "DELETE FROM     wcf".WCF_N."_language_item
                                WHERE           languageItem = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute([ 'wcf.acp.cronjob.description.cronjob'.$this->cronjobID ]);
+                       $statement->execute(['wcf.acp.cronjob.description.cronjob'.$this->cronjobID]);
                }
                
                // save new descriptions
index b2fcee0534d295f9ec563ad8627875a312dde3f1..c41754f2e07ed3c38e32b0edb6a391be2d77dfda 100644 (file)
@@ -109,7 +109,7 @@ class TagAction extends AbstractDatabaseObjectAction implements ISearchAction {
         * @since       2.2
         */
        public function validateSetAsSynonyms() {
-               WCF::getSession()->checkPermissions([ 'admin.content.tag.canManageTag' ]);
+               WCF::getSession()->checkPermissions(['admin.content.tag.canManageTag']);
                if (empty($this->objects)) {
                        $this->readObjects();
                        
index 067df51e14b187b3d9414e90c8f4319fa857a21e..b457446b46f82f1afd7f81dc0fc4b49511b24a0c 100644 (file)
@@ -54,7 +54,7 @@ class BackgroundQueueHandler extends SingletonFactory {
                if ($time < TIME_NOW) {
                        throw new SystemException("You may not schedule a job in the past (".$time." is smaller than the current timestamp ".TIME_NOW.").");
                }
-               if (!is_array($jobs)) $jobs = [ $jobs ];
+               if (!is_array($jobs)) $jobs = [$jobs];
                foreach ($jobs as $job) {
                        if (!($job instanceof AbstractBackgroundJob)) {
                                throw new SystemException('$jobs contains an item that does not extend \wcf\system\background\job\AbstractBackgroundJob.');
@@ -194,7 +194,7 @@ class BackgroundQueueHandler extends SingletonFactory {
                        $sql = "DELETE FROM     wcf".WCF_N."_background_job
                                WHERE           jobID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute([ $row['jobID'] ]);
+                       $statement->execute([$row['jobID']]);
                }
        }
        
@@ -212,7 +212,7 @@ class BackgroundQueueHandler extends SingletonFactory {
                        WHERE           status = ?
                                AND     time <= ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute([ 'ready', TIME_NOW ]);
+               $statement->execute(['ready', TIME_NOW]);
                
                return $statement->fetchSingleColumn();
        }
index 2c0aa34c203a1168424dcf37e7f07747ad165e12..0c9741238070d09c14914cc11bcd7b1cd060715e 100644 (file)
@@ -36,7 +36,7 @@ abstract class AbstractUserBulkProcessingAction extends AbstractBulkProcessingAc
        protected function getAccessibleUsers(UserList $userList) {
                // fetch user group ids of all users
                $conditionBuilder = new PreparedStatementConditionBuilder();
-               $conditionBuilder->add('userID IN (?)', [ $userList->getObjectIDs() ]);
+               $conditionBuilder->add('userID IN (?)', [$userList->getObjectIDs()]);
                
                $sql = "SELECT  userID, groupID
                        FROM    wcf".WCF_N."_user_to_group
index e9eddd6007646ffdfba744cc6fa325bfc5284d5e..31970183962960bdaa17de6d166471f23a547179 100644 (file)
@@ -27,7 +27,7 @@ abstract class AbstractUserGroupsUserBulkProcessingAction extends AbstractUserBu
         * list of available user groups
         * @var UserGroup[]
         */
-       public $availableUserGroups = [ ];
+       public $availableUserGroups = [];
        
        /**
         * name of the inputs used to store the selected user group ids
@@ -39,7 +39,7 @@ abstract class AbstractUserGroupsUserBulkProcessingAction extends AbstractUserBu
         * ids of selected user groups
         * @var integer[]
         */
-       public $userGroupIDs = [ ];
+       public $userGroupIDs = [];
        
        /**
         * @see \wcf\data\DatabaseObjectDecorator::__construct()
@@ -47,7 +47,7 @@ abstract class AbstractUserGroupsUserBulkProcessingAction extends AbstractUserBu
        public function __construct(DatabaseObject $object) {
                parent::__construct($object);
                
-               $this->availableUserGroups = UserGroup::getAccessibleGroups([ ], [ UserGroup::GUESTS, UserGroup::EVERYONE, UserGroup::USERS ]);
+               $this->availableUserGroups = UserGroup::getAccessibleGroups([], [UserGroup::GUESTS, UserGroup::EVERYONE, UserGroup::USERS]);
                
                uasort($this->availableUserGroups, function(UserGroup $groupA, UserGroup $groupB) {
                        return strcmp($groupA->getName(), $groupB->getName());
@@ -110,7 +110,7 @@ abstract class AbstractUserGroupsUserBulkProcessingAction extends AbstractUserBu
         * @see \wcf\system\bulk\processing\IBulkProcessingAction::reset()
         */
        public function reset() {
-               $this->userGroupIDs = [ ];
+               $this->userGroupIDs = [];
        }
        
        /**
index 81bff15522702aee9dfee71e8cd4124978fe5200..1bde544370ae96f733bcf144a59f46da35081b15 100644 (file)
@@ -35,7 +35,7 @@ class TemplateListenerCodeCacheBuilder extends AbstractCacheBuilder {
                        if ($templateListener->options || $templateListener->permissions) {
                                $templateCode = '{if ';
                                
-                               $options = $permissions = [ ];
+                               $options = $permissions = [];
                                if ($templateListener->options) {
                                        $options = explode(',', strtoupper($templateListener->options));
                                        
index df0f49fc7992205cf784434c34c86a50728b2433..d0ff5ab55bde63b44cc05eebddc622c6609ca688 100644 (file)
@@ -31,7 +31,7 @@ class UserGroupPermissionCacheBuilder extends AbstractCacheBuilder {
                
                // get option values
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("option_value.groupID IN (?)", [ $parameters ]);
+               $conditions->add("option_value.groupID IN (?)", [$parameters]);
                
                $sql = "SELECT          option_table.optionName, option_table.optionType, option_value.optionValue
                        FROM            wcf".WCF_N."_user_group_option_value option_value
@@ -42,7 +42,7 @@ class UserGroupPermissionCacheBuilder extends AbstractCacheBuilder {
                $statement->execute($conditions->getParameters());
                while ($row = $statement->fetchArray()) {
                        if (!isset($data[$row['optionName']])) {
-                               $data[$row['optionName']] = [ 'type' => $row['optionType'], 'values' => [] ];
+                               $data[$row['optionName']] = ['type' => $row['optionType'], 'values' => []];
                        }
                        
                        $data[$row['optionName']]['values'][] = $row['optionValue'];
index 79a7898e334cb95eb043f698e5b21e6c82b098fc..f999d532165ef2607f5fae9426be456b53d41bd7 100644 (file)
@@ -19,7 +19,7 @@ class MediaClipboardAction extends AbstractClipboardAction {
        /**
         * @inheritdoc
         */
-       protected $actionClassActions = [ 'delete' ];
+       protected $actionClassActions = ['delete'];
        
        /**
         * @inheritdoc
index dc15c2dce86e93548dc7975ba51eb9a7f9991a98..5ad1fa1cc42214fb6eb1adfd7374b88c6d119799 100644 (file)
@@ -74,7 +74,7 @@ class TagClipboardAction extends AbstractClipboardAction {
         */
        protected function validateDelete() {
                if (!WCF::getSession()->getPermission('admin.content.tag.canManageTag')) {
-                       return [ ];
+                       return [];
                }
                
                return array_keys($this->objects);
@@ -87,11 +87,11 @@ class TagClipboardAction extends AbstractClipboardAction {
         */
        protected function validateSetAsSynonyms() {
                if (!WCF::getSession()->getPermission('admin.content.tag.canManageTag')) {
-                       return [ ];
+                       return [];
                }
                
                if (count($this->objects) < 2) {
-                       return [ ];
+                       return [];
                }
                
                return array_keys($this->objects);
index 8ae5aec7dae3cb12d75b2588450be7d5163ab70a..33c73b1ec05fa61db2a60a205f3579669d6fcfcb 100644 (file)
@@ -43,10 +43,10 @@ abstract class AbstractObjectTextPropertyCondition extends AbstractTextCondition
                if (!($objectList instanceof $className)) return;
                
                if ($this->supportsMultipleValues) {
-                       $objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias().'.'.$this->getPropertyName().' IN (?)', [ $conditionData[$this->fieldName] ]);
+                       $objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias().'.'.$this->getPropertyName().' IN (?)', [$conditionData[$this->fieldName]]);
                }
                else {
-                       $objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias().'.'.$this->getPropertyName().' = ?', [ $conditionData[$this->fieldName] ]);
+                       $objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias().'.'.$this->getPropertyName().' = ?', [$conditionData[$this->fieldName]]);
                }
        }
        
index cbcf45f3f0d292239e2f262828a584fd81c862d5..34208c7ac49d51a289564d2756dc815a94171fd6 100644 (file)
@@ -50,12 +50,12 @@ abstract class AbstractTimestampCondition extends AbstractSingleFieldCondition i
                $className = $this->getListClassName();
                if (!($objectList instanceof $className)) return;
                
-               $objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias().'.'.$this->getPropertyName().' <> ?', [ 0 ]);
+               $objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias().'.'.$this->getPropertyName().' <> ?', [0]);
                if (isset($conditionData['endTime'])) {
-                       $objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias().'.'.$this->getPropertyName().' < ?', [ strtotime($conditionData['endTime']) + 86400 ]);
+                       $objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias().'.'.$this->getPropertyName().' < ?', [strtotime($conditionData['endTime']) + 86400]);
                }
                if (isset($conditionData['startTime'])) {
-                       $objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias().'.'.$this->getPropertyName().' >= ?', [ strtotime($conditionData['startTime']) ]);
+                       $objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias().'.'.$this->getPropertyName().' >= ?', [strtotime($conditionData['startTime'])]);
                }
        }
        
index c028f2c1380f4fb3ea09d3cfa36c888ba8f5ccd3..a37faf7aba63886f70928ef41f8eacc5f536bd69 100644 (file)
@@ -38,7 +38,7 @@ class BackgroundQueueCleanUpCronjob extends AbstractCronjob {
                                TIME_NOW - 600 // running longer than 10 minutes
                        ]);
                        
-                       $jobIDs = [ ];
+                       $jobIDs = [];
                        while ($row = $statement->fetchArray()) {
                                $jobIDs[] = $row['jobID'];
                                
@@ -67,7 +67,7 @@ class BackgroundQueueCleanUpCronjob extends AbstractCronjob {
                        
                        // delete jobs
                        $condition = new PreparedStatementConditionBuilder();
-                       $condition->add('jobID IN (?)', [ $jobIDs ]);
+                       $condition->add('jobID IN (?)', [$jobIDs]);
                        $sql = "DELETE FROM     wcf".WCF_N."_background_job ".$condition;
                        $statement = WCF::getDB()->prepareStatement($sql);
                        $statement->execute($condition->getParameters());
index e2c8c65c9333e7385cdc6562adf0e600cf8989ec..84e1b90b9cfda13c3953c3f4f41aa5eb6bdef299 100644 (file)
@@ -44,7 +44,7 @@ class DatabaseQueryExecutionException extends DatabaseQueryException implements
        public function getExtraInformation() {
                return array_map(function ($val) {
                        static $i = 0;
-                       return [ 'Query Parameter '.(++$i), $val ];
+                       return ['Query Parameter '.(++$i), $val];
                }, $this->getParameters());
        }
 }
index 09a5996f6080b29e3cec24985a770b9c4a84728f..d6db5801e679cfbab3be482cfa721fd4bc654c88 100644 (file)
@@ -39,7 +39,7 @@ class Email {
         * Recipients of this email.
         * @var array
         */
-       protected $recipients = [ ];
+       protected $recipients = [];
        
        /**
         * Message-Id header
@@ -51,13 +51,13 @@ class Email {
         * References header
         * @var Mailbox[]
         */
-       protected $references = [ ];
+       protected $references = [];
        
        /**
         * In-Reply-To header
         * @var Mailbox[]
         */
-       protected $inReplyTo = [ ];
+       protected $inReplyTo = [];
        
        /**
         * Date header
@@ -75,19 +75,19 @@ class Email {
         * User specified X-* headers
         * @var array
         */
-       protected $extraHeaders = [ ];
+       protected $extraHeaders = [];
        
        /**
         * Text parts of this email
         * @var array
         */
-       protected $text = [ ];
+       protected $text = [];
        
        /**
         * Attachments of this email
         * @var array
         */
-       protected $attachments = [ ];
+       protected $attachments = [];
        
        /**
         * Boundary between the 'Text' parts of this email
@@ -338,7 +338,7 @@ class Email {
                                throw new SystemException("The given type '".$type."' is invalid. Must be one of 'to', 'cc', 'bcc'.");
                }
                
-               $this->recipients[$recipient->getAddress()] = [ $type, $recipient ];
+               $this->recipients[$recipient->getAddress()] = [$type, $recipient];
        }
        
        /**
@@ -372,7 +372,7 @@ class Email {
                        throw new SystemException("The header '".$header."' may not be set. You may only set user defined headers (starting with 'X-').");
                }
                
-               $this->extraHeaders[] = [ $header, EmailGrammar::encodeQuotedPrintableHeader($value) ];
+               $this->extraHeaders[] = [$header, EmailGrammar::encodeQuotedPrintableHeader($value)];
        }
        
        /**
@@ -406,10 +406,10 @@ class Email {
                }
                
                if ($part instanceof TextMimePart) {
-                       $this->text[] = [ $priority, $part ];
+                       $this->text[] = [$priority, $part];
                }
                else {
-                       $this->attachments[] = [ $priority, $part ];
+                       $this->attachments[] = [$priority, $part];
                }
        }
        
@@ -440,58 +440,58 @@ class Email {
         * @throws      SystemException
         */
        public function getHeaders() {
-               $headers = [ ];
-               $to = [ ];
-               $cc = [ ];
+               $headers = [];
+               $to = [];
+               $cc = [];
                foreach ($this->getRecipients() as $recipient) {
                        if ($recipient[0] == 'to') $to[] = $recipient[1];
                        else if ($recipient[0] == 'cc') $cc[] = $recipient[1];
                }
-               $headers[] = [ 'from', (string) $this->getSender() ];
+               $headers[] = ['from', (string) $this->getSender()];
                if ($this->getReplyTo()->getAddress() !== $this->getSender()->getAddress()) {
-                       $headers[] = [ 'reply-to', (string) $this->getReplyTo() ];
+                       $headers[] = ['reply-to', (string) $this->getReplyTo()];
                }
                
                if ($to) {
-                       $headers[] = [ 'to', implode(",\r\n   ", $to) ];
+                       $headers[] = ['to', implode(",\r\n   ", $to)];
                }
                else {
                        throw new SystemException("Cannot generate message headers, you must specify a recipient.");
                }
                
                if ($cc) {
-                       $headers[] = [ 'cc', implode(",\r\n   ", $cc) ];
+                       $headers[] = ['cc', implode(",\r\n   ", $cc)];
                }
                if ($this->getSubject()) {
-                       $headers[] = [ 'subject', EmailGrammar::encodeQuotedPrintableHeader($this->getSubject()) ];
+                       $headers[] = ['subject', EmailGrammar::encodeQuotedPrintableHeader($this->getSubject())];
                }
                else {
                        throw new SystemException("Cannot generate message headers, you must specify a subject.");
                }
                
-               $headers[] = [ 'date', $this->getDate()->format(\DateTime::RFC2822) ];
-               $headers[] = [ 'message-id', $this->getMessageID() ];
+               $headers[] = ['date', $this->getDate()->format(\DateTime::RFC2822)];
+               $headers[] = ['message-id', $this->getMessageID()];
                if ($this->getReferences()) {
-                       $headers[] = [ 'references', implode(' ', $this->getReferences()) ];
+                       $headers[] = ['references', implode(' ', $this->getReferences())];
                }
                if ($this->getInReplyTo()) {
-                       $headers[] = [ 'in-reply-to', implode(' ', $this->getInReplyTo()) ];
+                       $headers[] = ['in-reply-to', implode(' ', $this->getInReplyTo())];
                }
-               $headers[] = [ 'mime-version', '1.0' ];
+               $headers[] = ['mime-version', '1.0'];
                
                if (!$this->text) {
                        throw new SystemException("Cannot generate message headers, you must specify at least one 'Text' part.");
                }
                if ($this->attachments) {
-                       $headers[] = [ 'content-type', "multipart/mixed;\r\n   boundary=\"".$this->mimeBoundary."\"" ];
+                       $headers[] = ['content-type', "multipart/mixed;\r\n   boundary=\"".$this->mimeBoundary."\""];
                }
                else {
                        if (count($this->text) > 1) {
-                               $headers[] = [ 'content-type', "multipart/alternative;\r\n   boundary=\"".$this->textBoundary."\"" ];
+                               $headers[] = ['content-type', "multipart/alternative;\r\n   boundary=\"".$this->textBoundary."\""];
                        }
                        else {
-                               $headers[] = [ 'content-type', $this->text[0][1]->getContentType() ];
-                               $headers[] = [ 'content-transfer-encoding', $this->text[0][1]->getContentTransferEncoding() ];
+                               $headers[] = ['content-type', $this->text[0][1]->getContentType()];
+                               $headers[] = ['content-transfer-encoding', $this->text[0][1]->getContentTransferEncoding()];
                                $headers = array_merge($headers, $this->text[0][1]->getAdditionalHeaders());
                        }
                }
@@ -599,7 +599,7 @@ class Email {
         * @return      AbstractBackgroundJob[]
         */
        public function getJobs() {
-               $jobs = [ ];
+               $jobs = [];
                
                // ensure every header is filled in
                $this->getHeaders();
@@ -615,7 +615,7 @@ class Email {
                                if ($mimePart[1] instanceof IRecipientAwareMimePart) $mimePart[1]->setRecipient($recipient[1]);
                        }
                        
-                       $data = [ 'mail' => $mail, 'recipient' => $recipient, 'skip' => false ];
+                       $data = ['mail' => $mail, 'recipient' => $recipient, 'skip' => false];
                        EventHandler::getInstance()->fireAction($this, 'getJobs', $data);
                        
                        // an event decided that this email should be skipped
index e91c7323775ee8c587364557d33f1039ab77bb67..6c88d891073fef5690c0afcd5b9e5a824b239b13 100644 (file)
@@ -38,7 +38,7 @@ abstract class AbstractMimePart {
         * @return      array
         */
        public function getAdditionalHeaders() {
-               return [ ];
+               return [];
        }
        
        /**
index acae82d59ac38f686ca3993cef945c4bb8a91ea2..ead796a40b2aef87fa6388fd6dfb60d5dab383e5 100644 (file)
@@ -80,7 +80,7 @@ class AttachmentMimePart extends AbstractMimePart {
         */
        public function getAdditionalHeaders() {
                return [ 
-                       [ 'Content-Disposition', 'attachment; filename='.EmailGrammar::encodeHeader($this->filename) ]
+                       ['Content-Disposition', 'attachment; filename='.EmailGrammar::encodeHeader($this->filename)]
                ];
        }
        
index b31d245a8d6b5b6b6033d98bd2bd9deecbd1843f..66c2560708c4f538944b3eccacd52e38ce55d4ed 100644 (file)
@@ -66,7 +66,7 @@ class SmtpEmailTransport implements EmailTransport {
         * ESMTP features advertised by the server
         * @var string[]
         */
-       protected $features = [ ];
+       protected $features = [];
        
        /**
         * if this property is an instance of \Exception email delivery will be locked
@@ -158,7 +158,7 @@ class SmtpEmailTransport implements EmailTransport {
                }
                while (true);
                
-               return [ $code, $reply ];
+               return [$code, $reply];
        }
        
        /**
@@ -177,11 +177,11 @@ class SmtpEmailTransport implements EmailTransport {
         */
        protected function connect() {
                $this->connection = new RemoteFile($this->host, $this->port);
-               $this->read([ 220 ]);
+               $this->read([220]);
                
                try {
                        $this->write('EHLO '.Email::getHost());
-                       $this->features = array_map('strtolower', explode("\n", StringUtil::unifyNewlines($this->read([ 250 ])[1])));
+                       $this->features = array_map('strtolower', explode("\n", StringUtil::unifyNewlines($this->read([250])[1])));
                }
                catch (SystemException $e) {
                        if ($this->starttls == 'encrypt') {
@@ -189,7 +189,7 @@ class SmtpEmailTransport implements EmailTransport {
                        }
                        
                        $this->write('HELO '.Email::getHost());
-                       $this->features = [ ];
+                       $this->features = [];
                }
                
                switch ($this->starttls) {
@@ -201,7 +201,7 @@ class SmtpEmailTransport implements EmailTransport {
                                $this->starttls();
                                
                                $this->write('EHLO '.Email::getHost());
-                               $this->features = array_map('strtolower', explode("\n", StringUtil::unifyNewlines($this->read([ 250 ])[1])));
+                               $this->features = array_map('strtolower', explode("\n", StringUtil::unifyNewlines($this->read([250])[1])));
                        break;
                        case 'may':
                                if (in_array('starttls', $this->features)) {
@@ -211,7 +211,7 @@ class SmtpEmailTransport implements EmailTransport {
                                        catch (SystemException $e) { }
                                        
                                        $this->write('EHLO '.Email::getHost());
-                                       $this->features = array_map('strtolower', explode("\n", StringUtil::unifyNewlines($this->read([ 250 ])[1])));
+                                       $this->features = array_map('strtolower', explode("\n", StringUtil::unifyNewlines($this->read([250])[1])));
                                }
                        break;
                        case 'none':
@@ -224,7 +224,7 @@ class SmtpEmailTransport implements EmailTransport {
         */
        protected function starttls() {
                $this->write("STARTTLS");
-               $this->read([ 220 ]);
+               $this->read([220]);
                
                if (!$this->connection->setTLS(true)) {
                        throw new TransientFailure('enabling TLS failed');
@@ -243,13 +243,13 @@ class SmtpEmailTransport implements EmailTransport {
                        
                        if ($parameters[0] == 'auth') {
                                // try mechanisms in order of preference
-                               foreach ([ 'login', 'plain' ] as $method) {
+                               foreach (['login', 'plain'] as $method) {
                                        if (in_array($method, $parameters)) {
                                                switch ($method) {
                                                        case 'login':
                                                                try {
                                                                        $this->write('AUTH LOGIN');
-                                                                       $this->read([ 334 ]);
+                                                                       $this->read([334]);
                                                                }
                                                                catch (SystemException $e) {
                                                                        // try next authentication method
@@ -257,17 +257,17 @@ class SmtpEmailTransport implements EmailTransport {
                                                                }
                                                                $this->write(base64_encode($this->username));
                                                                $this->lastWrite = '*redacted*';
-                                                               $this->read([ 334 ]);
+                                                               $this->read([334]);
                                                                $this->write(base64_encode($this->password));
                                                                $this->lastWrite = '*redacted*';
-                                                               $this->read([ 235 ]);
+                                                               $this->read([235]);
                                                                return;
                                                        break;
                                                        case 'plain':
                                                                // RFC 4616
                                                                try {
                                                                        $this->write('AUTH PLAIN');
-                                                                       $this->read([ 334 ]);
+                                                                       $this->read([334]);
                                                                }
                                                                catch (SystemException $e) {
                                                                        // try next authentication method
@@ -275,7 +275,7 @@ class SmtpEmailTransport implements EmailTransport {
                                                                }
                                                                $this->write(base64_encode("\0".$this->username."\0".$this->password));
                                                                $this->lastWrite = '*redacted*';
-                                                               $this->read([ 235 ]);
+                                                               $this->read([235]);
                                                                return;
                                                }
                                        }
@@ -339,13 +339,13 @@ class SmtpEmailTransport implements EmailTransport {
                }
                
                $this->write('RSET');
-               $this->read([ 250 ]);
+               $this->read([250]);
                $this->write('MAIL FROM:<'.$email->getSender()->getAddress().'>');
-               $this->read([ 250 ]);
+               $this->read([250]);
                $this->write('RCPT TO:<'.$envelopeTo->getAddress().'>');
-               $this->read([ 250, 251 ]);
+               $this->read([250, 251]);
                $this->write('DATA');
-               $this->read([ 354 ]);
+               $this->read([354]);
                $this->connection->write(implode("\r\n", array_map(function ($item) {
                        // 4.5.2 Transparency
                        // o  Before sending a line of mail text, the SMTP client checks the
@@ -356,6 +356,6 @@ class SmtpEmailTransport implements EmailTransport {
                        return $item;
                }, explode("\r\n", $email))));
                $this->write(".");
-               $this->read([ 250 ]);
+               $this->read([250]);
        }
 }
index 0083a84275de0bd16f386ff11667e00e8455ebf8..03e41e2b322bb59210b3c64af1fe854986412a3f 100644 (file)
@@ -63,7 +63,7 @@ class DefaultUploadFileSaveStrategy implements IUploadFileSaveStrategy {
         * @param       array           $data
         * @throws      SystemException
         */
-       public function __construct($actionClassName, array $options = [ ], array $data = [ ]) {
+       public function __construct($actionClassName, array $options = [], array $data = []) {
                $this->actionClassName = $actionClassName;
                $this->options = $options;
                $this->data = $data;
@@ -72,13 +72,13 @@ class DefaultUploadFileSaveStrategy implements IUploadFileSaveStrategy {
                        throw new SystemException("'".$this->actionClassName."' does not extend '".AbstractDatabaseObjectAction::class."'");
                }
                
-               $this->editorClassName = (new $this->actionClassName([ ], ''))->getClassName();
-               $baseClass = call_user_func([ $this->editorClassName, 'getBaseClass' ]);
+               $this->editorClassName = (new $this->actionClassName([], ''))->getClassName();
+               $baseClass = call_user_func([$this->editorClassName, 'getBaseClass']);
                if (!is_subclass_of($baseClass, IFile::class)) {
                        throw new SystemException("'".$this->editorClassName."' does not implement '".IFile::class."'");
                }
                if (is_subclass_of($baseClass, IThumbnailFile::class)) {
-                       $this->options['thumbnailSizes'] = call_user_func([ $baseClass, 'getThumbnailSizes' ]);
+                       $this->options['thumbnailSizes'] = call_user_func([$baseClass, 'getThumbnailSizes']);
                }
        }
        
@@ -115,7 +115,7 @@ class DefaultUploadFileSaveStrategy implements IUploadFileSaveStrategy {
                        }
                }
                
-               $action = new $this->actionClassName([ ], 'create', [
+               $action = new $this->actionClassName([], 'create', [
                        'data' => $data
                ]);
                $object = $action->executeAction()['returnValues'];
@@ -212,7 +212,7 @@ class DefaultUploadFileSaveStrategy implements IUploadFileSaveStrategy {
                $adapter = ImageHandler::getInstance()->getAdapter();
                $adapter->loadFile($file->getLocation());
                
-               $updateData = [ ];
+               $updateData = [];
                foreach ($this->options['thumbnailSizes'] as $type => $sizeData) {
                        $prefix = 'thumbnail';
                        if (!empty($type)) {