INFRA-132 add full stops
[civicrm-core.git] / CRM / Core / QuickForm / Action / Upload.php
index 1cf3f15e4611e0a478ac4d01a27b2b39a7898e2f..63fd54335d173a871621ff1aed9d7d5049664062 100644 (file)
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  * Redefine the upload action.
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action {
 
   /**
-   * The array of uploaded file names
+   * The array of uploaded file names.
    * @var array
    */
   protected $_uploadNames;
 
   /**
-   * The directory to store the uploaded files
+   * The directory to store the uploaded files.
    * @var string
    */
   protected $_uploadDir;
 
   /**
-   * Class constructor
+   * Class constructor.
    *
-   * @param object $stateMachine reference to state machine object
-   * @param string $uploadDir directory to store the uploaded files
-   * @param array $uploadNames element names of the various uploadable files
+   * @param object $stateMachine
+   *   Reference to state machine object.
+   * @param string $uploadDir
+   *   Directory to store the uploaded files.
+   * @param array $uploadNames
+   *   Element names of the various uploadable files.
    *
    * @return \CRM_Core_QuickForm_Action_Upload
-  @access public
    */
   public function __construct(&$stateMachine, $uploadDir, $uploadNames) {
     parent::__construct($stateMachine);
@@ -65,15 +66,16 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action {
   }
 
   /**
-   * Upload and move the file if valid to the uploaded directory
-   *
-   * @param CRM_Core_Form $page       the CRM_Core_Form object
-   * @param object $data       the QFC data container
-   * @param string $pageName   the name of the page which index the data container with
-   * @param string $uploadName the name of the uploaded file
+   * Upload and move the file if valid to the uploaded directory.
    *
-   * @return void
-   * @access private
+   * @param CRM_Core_Form $page
+   *   The CRM_Core_Form object.
+   * @param object $data
+   *   The QFC data container.
+   * @param string $pageName
+   *   The name of the page which index the data container with.
+   * @param string $uploadName
+   *   The name of the uploaded file.
    */
   public function upload(&$page, &$data, $pageName, $uploadName) {
     // make sure uploadName exists in the QF array
@@ -94,7 +96,10 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action {
         $newName = CRM_Utils_File::makeFileName($value['name']);
         $status = $element->moveUploadedFile($this->_uploadDir, $newName);
         if (!$status) {
-          CRM_Core_Error::statusBounce(ts('We could not move the uploaded file %1 to the upload directory %2. Please verify that the \'Temporary Files\' setting points to a valid path which is writable by your web server.', array(1 => $value['name'], 2 => $this->_uploadDir)));
+          CRM_Core_Error::statusBounce(ts('We could not move the uploaded file %1 to the upload directory %2. Please verify that the \'Temporary Files\' setting points to a valid path which is writable by your web server.', array(
+                1 => $value['name'],
+                2 => $this->_uploadDir,
+              )));
         }
         if (!empty($data['values'][$pageName][$uploadName]['name'])) {
           @unlink($this->_uploadDir . $data['values'][$pageName][$uploadName]);
@@ -111,11 +116,10 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action {
   /**
    * Processes the request.
    *
-   * @param  CRM_Core_Form    $page       CRM_Core_Form the current form-page
-   * @param  string    $actionName Current action name, as one Action object can serve multiple actions
-   *
-   * @return void
-   * @access public
+   * @param CRM_Core_Form $page
+   *   CRM_Core_Form the current form-page.
+   * @param string $actionName
+   *   Current action name, as one Action object can serve multiple actions.
    */
   public function perform(&$page, $actionName) {
     // like in Action_Next
@@ -125,11 +129,15 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action {
     // the above buildForm potentially changes the action function with different args
     // so basically the rug might have been pulled from us, so we actually just check
     // and potentially call the right one
-    // this allows standalong form uploads to work nicely
+    // this allows standalone form uploads to work nicely
     $page->controller->_actions['upload']->realPerform($page, $actionName);
   }
 
   /**
+   * Real perform.
+   *
+   * @todo document what I do.
+   *
    * @param CRM_Core_Form $page
    * @param string $actionName
    *
@@ -167,5 +175,5 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action {
       return $state->handleNextState($page);
     }
   }
-}
 
+}