Development

Changeset 2971

You must first sign up to be able to contribute.

Changeset 2971

Show
Ignore:
Timestamp:
12/08/06 13:14:14 (2 years ago)
Author:
fabien
Message:

changed method declarations to be more compliant with symfony coding standard

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/action/sfAction.class.php

    r2956 r2971  
    6666   * By Default, this method is empty. 
    6767   */ 
    68   public function preExecute () 
     68  public function preExecute() 
    6969  { 
    7070  } 
     
    7575   * By Default, this method is empty. 
    7676   */ 
    77   public function postExecute () 
     77  public function postExecute() 
    7878  { 
    7979  } 
     
    8383   * 
    8484   */ 
    85   public function forward404 ($message = '') 
     85  public function forward404($message = '') 
    8686  { 
    8787    throw new sfError404Exception($message); 
     
    9494   * @param bool A condition that evaluates to true or false. 
    9595   */ 
    96   public function forward404Unless ($condition, $message = '') 
     96  public function forward404Unless($condition, $message = '') 
    9797  { 
    9898    if (!$condition) 
     
    108108   * @param bool A condition that evaluates to true or false. 
    109109   */ 
    110   public function forward404If ($condition, $message = '') 
     110  public function forward404If($condition, $message = '') 
    111111  { 
    112112    if ($condition) 
     
    120120   * 
    121121   */ 
    122   public function redirect404 () 
     122  public function redirect404() 
    123123  { 
    124124    return $this->redirect('/'.sfConfig::get('sf_error_404_module').'/'.sfConfig::get('sf_error_404_action')); 
     
    136136   * @throws sfStopException always 
    137137   */ 
    138   public function forward ($module, $action) 
     138  public function forward($module, $action) 
    139139  { 
    140140    if (sfConfig::get('sf_logging_enabled')) $this->getContext()->getLogger()->info('{sfAction} forward to action "'.$module.'/'.$action.'"'); 
     
    160160   * @throws sfStopException always 
    161161   */ 
    162   public function forwardIf ($condition, $module, $action) 
     162  public function forwardIf($condition, $module, $action) 
    163163  { 
    164164    if ($condition) 
     
    183183   * @throws sfStopException always 
    184184   */ 
    185   public function forwardUnless ($condition, $module, $action) 
     185  public function forwardUnless($condition, $module, $action) 
    186186  { 
    187187    if (!$condition) 
     
    299299   * @throws sfStopException always 
    300300   */ 
    301   public function redirectIf ($condition, $url) 
     301  public function redirectIf($condition, $url) 
    302302  { 
    303303    if ($condition) 
     
    320320   * @throws sfStopException always 
    321321   */ 
    322   public function redirectUnless ($condition, $url) 
     322  public function redirectUnless($condition, $url) 
    323323  { 
    324324    if (!$condition) 
     
    353353   *               - The view that will be executed. 
    354354   */ 
    355   public function getDefaultView () 
     355  public function getDefaultView() 
    356356  { 
    357357    return sfView::INPUT; 
     
    370370   * @see sfRequest 
    371371   */ 
    372   public function getRequestMethods () 
     372  public function getRequestMethods() 
    373373  { 
    374374    return sfRequest::GET | sfRequest::POST | sfRequest::NONE; 
     
    386386   *               - The view that will be executed. 
    387387   */ 
    388   public function handleError () 
     388  public function handleError() 
    389389  { 
    390390    return sfView::ERROR; 
     
    398398   * @return void 
    399399   */ 
    400   public function registerValidators ($validatorManager) 
     400  public function registerValidators($validatorManager) 
    401401  { 
    402402  } 
     
    407407   * @return bool true, if validation completes successfully, otherwise false. 
    408408   */ 
    409   public function validate () 
     409  public function validate() 
    410410  { 
    411411    return true; 
  • trunk/lib/action/sfActionStack.class.php

    r2195 r2971  
    3535   * @return sfActionStackEntry sfActionStackEntry instance 
    3636   */ 
    37   public function addEntry ($moduleName, $actionName, $actionInstance) 
     37  public function addEntry($moduleName, $actionName, $actionInstance) 
    3838  { 
    3939    // create our action stack entry and add it to our stack 
     
    5252   * @return sfActionStackEntry An action stack entry implementation. 
    5353   */ 
    54   public function getEntry ($index) 
     54  public function getEntry($index) 
    5555  { 
    5656    $retval = null; 
     
    7171   * @return sfActionStackEntry An action stack entry implementation. 
    7272   */ 
    73   public function popEntry () 
     73  public function popEntry() 
    7474  { 
    7575    return array_pop($this->stack); 
     
    8181   * @return sfActionStackEntry An action stack entry implementation. 
    8282   */ 
    83   public function getFirstEntry () 
     83  public function getFirstEntry() 
    8484  { 
    8585    $retval = null; 
     
    9898   * @return sfActionStackEntry An action stack entry implementation. 
    9999   */ 
    100   public function getLastEntry () 
     100  public function getLastEntry() 
    101101  { 
    102102    $count  = count($this->stack); 
     
    116116   * @return int The size of this stack. 
    117117   */ 
    118   public function getSize () 
     118  public function getSize() 
    119119  { 
    120120    return count($this->stack); 
  • trunk/lib/action/sfActionStackEntry.class.php

    r2195 r2971  
    3939   * @return void 
    4040   */ 
    41   public function __construct ($moduleName, $actionName, $actionInstance) 
     41  public function __construct($moduleName, $actionName, $actionInstance) 
    4242  { 
    4343    $this->actionName     = $actionName; 
     
    5151   * @return string An action name. 
    5252   */ 
    53   public function getActionName () 
     53  public function getActionName() 
    5454  { 
    5555    return $this->actionName; 
     
    6161   * @return sfAction An action implementation instance. 
    6262   */ 
    63   public function getActionInstance () 
     63  public function getActionInstance() 
    6464  { 
    6565    return $this->actionInstance; 
     
    7171   * @return sfView A view implementation instance. 
    7272   */ 
    73   public function getViewInstance () 
     73  public function getViewInstance() 
    7474  { 
    7575    return $this->viewInstance; 
     
    8383   * @return void 
    8484   */ 
    85   public function setViewInstance ($viewInstance) 
     85  public function setViewInstance($viewInstance) 
    8686  { 
    8787    $this->viewInstance = $viewInstance; 
     
    9393   * @return string A module name. 
    9494   */ 
    95   public function getModuleName () 
     95  public function getModuleName() 
    9696  { 
    9797    return $this->moduleName; 
     
    118118   * @return void 
    119119   */ 
    120   public function setPresentation (&$presentation) 
     120  public function setPresentation(&$presentation) 
    121121  { 
    122122    $this->presentation =& $presentation; 
  • trunk/lib/action/sfComponent.class.php

    r2953 r2971  
    4444   *               - The view that will be executed. 
    4545   */ 
    46   abstract function execute (); 
     46  abstract function execute(); 
    4747 
    4848  /** 
     
    6969   * @return sfContext The current sfContext instance. 
    7070   */ 
    71   public final function getContext () 
     71  public final function getContext() 
    7272  { 
    7373    return $this->context; 
     
    7979   * @return sfLogger The current sfLogger instance. 
    8080   */ 
    81   public final function getLogger () 
     81  public final function getLogger() 
    8282  { 
    8383    return $this->context->getLogger(); 
     
    9191   *               (available priorities: emerg, alert, crit, err, warning, notice, info, debug). 
    9292   */ 
    93   public function logMessage ($message, $priority = 'info') 
     93  public function logMessage($message, $priority = 'info') 
    9494  { 
    9595    if (sfConfig::get('sf_logging_enabled')) 
     
    104104   * @param string The message text. 
    105105   */ 
    106   public function debugMessage ($message) 
     106  public function debugMessage($message) 
    107107  { 
    108108    if (sfConfig::get('sf_web_debug')) 
  • trunk/lib/cache/sfFunctionCache.class.php

    r1697 r2971  
    3535   * @access public 
    3636   */ 
    37   public function call () 
     37  public function call() 
    3838  { 
    3939    $arguments = func_get_args(); 
  • trunk/lib/config/sfConfig.class.php

    r2654 r2971  
    3030   * @return mixed A config parameter value, if the config parameter exists, otherwise null. 
    3131   */ 
    32   public static function get ($name, $default = null) 
     32  public static function get($name, $default = null) 
    3333  { 
    3434    return isset(self::$config[$name]) ? self::$config[$name] : $default; 
     
    4242   * @return bool true, if the config parameter exists, otherwise false. 
    4343   */ 
    44   public static function has ($name) 
     44  public static function has($name) 
    4545  { 
    4646    return array_key_exists($name, self::$config); 
     
    5757   * @return void 
    5858   */ 
    59   public static function set ($name, $value) 
     59  public static function set($name, $value) 
    6060  { 
    6161    self::$config[$name] = $value; 
     
    7272   * @return void 
    7373   */ 
    74   public static function add ($parameters = array()) 
     74  public static function add($parameters = array()) 
    7575  { 
    7676    self::$config = array_merge(self::$config, $parameters); 
     
    8282   * @return array An associative array of configuration parameters. 
    8383   */ 
    84   public static function getAll () 
     84  public static function getAll() 
    8585  { 
    8686    return self::$config; 
     
    9292   * @return void 
    9393   */ 
    94   public static function clear () 
     94  public static function clear() 
    9595  { 
    9696    self::$config = null; 
  • trunk/lib/controller/sfConsoleController.class.php

    r2170 r2971  
    2626   * @return void 
    2727   */ 
    28   public function dispatch ($moduleName, $actionName, $parameters = array()) 
     28  public function dispatch($moduleName, $actionName, $parameters = array()) 
    2929  { 
    3030    try 
  • trunk/lib/controller/sfController.class.php

    r2950 r2971  
    3636   * @return bool true, if the component exists, otherwise false. 
    3737   */ 
    38   public function componentExists ($moduleName, $componentName) 
     38  public function componentExists($moduleName, $componentName) 
    3939  { 
    4040    return $this->controllerExists($moduleName, $componentName, 'component', false); 
     
    4949   * @return bool true, if the action exists, otherwise false. 
    5050   */ 
    51   public function actionExists ($moduleName, $actionName) 
     51  public function actionExists($moduleName, $actionName) 
    5252  { 
    5353    return $this->controllerExists($moduleName, $actionName, 'action', false); 
     
    7070   * @return boolean true if the controller exists; false otherwise 
    7171   */ 
    72   protected function controllerExists ($moduleName, $controllerName, $extension, $throwExceptions) 
     72  protected function controllerExists($moduleName, $controllerName, $extension, $throwExceptions) 
    7373  { 
    7474    $dirs = sfLoader::getControllerDirs($moduleName); 
     
    160160   * @throws <b>sfSecurityException</b> If the action requires security but the user implementation is not of type sfSecurityUser. 
    161161   */ 
    162   public function forward ($moduleName, $actionName) 
     162  public function forward($moduleName, $actionName) 
    163163  { 
    164164    // replace unwanted characters 
     
    316316   * @return Action An Action implementation instance, if the action exists, otherwise null. 
    317317   */ 
    318   public function getAction ($moduleName, $actionName) 
     318  public function getAction($moduleName, $actionName) 
    319319  { 
    320320    return $this->getController($moduleName, $actionName, 'action'); 
     
    329329   * @return Component A Component implementation instance, if the component exists, otherwise null. 
    330330   */ 
    331   public function getComponent ($moduleName, $componentName) 
     331  public function getComponent($moduleName, $componentName) 
    332332  { 
    333333    return $this->getController($moduleName, $componentName, 'component'); 
    334334  } 
    335335 
    336   protected function getController ($moduleName, $controllerName, $extension) 
     336  protected function getController($moduleName, $controllerName, $extension) 
    337337  { 
    338338    $classSuffix = ucfirst(strtolower($extension)); 
     
    360360   * @return sfActionStack An sfActionStack instance, if the action stack is enabled, otherwise null. 
    361361   */ 
    362   public function getActionStack () 
     362  public function getActionStack() 
    363363  { 
    364364    return $this->context->getActionStack(); 
     
    370370   * @return Context A Context instance. 
    371371   */ 
    372   public function getContext () 
     372  public function getContext() 
    373373  { 
    374374    return $this->context; 
     
    382382   *             - sfView::RENDER_VAR 
    383383   */ 
    384   public function getRenderMode () 
     384  public function getRenderMode() 
    385385  { 
    386386    return $this->renderMode; 
     
    396396   * @return View A View implementation instance, if the view exists, otherwise null. 
    397397   */ 
    398   public function getView ($moduleName, $actionName, $viewName) 
     398  public function getView($moduleName, $actionName, $viewName) 
    399399  { 
    400400    // user view exists? 
     
    430430   * @return void 
    431431   */ 
    432   public function initialize ($context) 
     432  public function initialize($context) 
    433433  { 
    434434    $this->context = $context; 
     
    452452   * @throws sfFactoryException If a new controller implementation instance cannot be created. 
    453453   */ 
    454   public static function newInstance ($class) 
     454  public static function newInstance($class) 
    455455  { 
    456456    try 
     
    485485   * @throws sfRenderException - If an invalid render mode has been set. 
    486486   */ 
    487   public function setRenderMode ($mode) 
     487  public function setRenderMode($mode) 
    488488  { 
    489489    if ($mode == sfView::RENDER_CLIENT || $mode == sfView::RENDER_VAR || $mode == sfView::RENDER_NONE) 
  • trunk/lib/controller/sfFrontWebController.class.php

    r2808 r2971  
    3131   * @return void 
    3232   */ 
    33   public function dispatch () 
     33  public function dispatch() 
    3434  { 
    3535    try 
  • trunk/lib/controller/sfWebController.class.php

    r2689 r2971  
    203203   * @return void 
    204204   */ 
    205   public function redirect ($url, $delay = 0, $statusCode = 302) 
     205  public function redirect($url, $delay = 0, $statusCode = 302) 
    206206  { 
    207207    $response = $this->getContext()->getResponse(); 
  • trunk/lib/database/sfCreoleDatabase.class.php

    r2137 r2971  
    5656   * @throws <b>sfDatabaseException</b> If a connection could not be created. 
    5757   */ 
    58   public function connect () 
     58  public function connect() 
    5959  { 
    6060    try 
     
    203203   * @throws <b>sfDatabaseException</b> If an error occurs while shutting down this database. 
    204204   */ 
    205   public function shutdown () 
     205  public function shutdown() 
    206206  { 
    207207    if ($this->connection !== null) 
  • trunk/lib/database/sfDatabase.class.php

    r2953 r2971  
    3232   * @throws <b>sfDatabaseException</b> If a connection could not be created. 
    3333   */ 
    34   abstract function connect (); 
     34  abstract function connect(); 
    3535 
    3636  /** 
     
    4444   * @throws <b>sfDatabaseException</b> If a connection could not be retrieved. 
    4545   */ 
    46   public function getConnection () 
     46  public function getConnection() 
    4747  { 
    4848    if ($this->connection == null) 
     
    6161   * @throws <b>sfDatabaseException</b> If a resource could not be retrieved. 
    6262   */ 
    63   public function getResource () 
     63  public function getResource() 
    6464  { 
    6565    if ($this->resource == null) 
     
    8080   * @throws <b>sfInitializationException</b> If an error occurs while initializing this Database. 
    8181   */ 
    82   public function initialize ($parameters = array()) 
     82  public function initialize($parameters = array()) 
    8383  { 
    8484    $this->parameterHolder = new sfParameterHolder(); 
     
    113113   * @throws <b>sfDatabaseException</b> If an error occurs while shutting down this database. 
    114114   */ 
    115   abstract function shutdown (); 
     115  abstract function shutdown(); 
    116116} 
  • trunk/lib/database/sfDatabaseManager.class.php

    r2325 r2971  
    3636   * @throws <b>sfDatabaseException</b> If the requested database name does not exist. 
    3737   */ 
    38   public function getDatabase ($name = 'default') 
     38  public function getDatabase($name = 'default') 
    3939  { 
    4040    if (isset($this->databases[$name])) 
     
    5757   * @throws <b>sfInitializationException</b> If an error occurs while initializing this DatabaseManager. 
    5858   */ 
    59   public function initialize () 
     59  public function initialize() 
    6060  { 
    6161    // load database configuration 
     
    7070   * @throws <b>sfDatabaseException</b> If an error occurs while shutting down this DatabaseManager. 
    7171   */ 
    72   public function shutdown () 
     72  public function shutdown() 
    7373  { 
    7474    // loop through databases and shutdown connections 
  • trunk/lib/database/sfMySQLDatabase.class.php

    r2195 r2971  
    4343   * @throws <b>sfDatabaseException</b> If a connection could not be created. 
    4444   */ 
    45   public function connect () 
     45  public function connect() 
    4646  { 
    4747 
     
    157157   * @throws <b>sfDatabaseException</b> If an error occurs while shutting down this database. 
    158158   */ 
    159   public function shutdown () 
     159  public function shutdown() 
    160160  { 
    161161    if ($this->connection != null) 
  • trunk/lib/database/sfPDODatabase.class.php

    r2400 r2971  
    2727   * @throws <b>sfDatabaseException</b> If a connection could not be created. 
    2828   */ 
    29   public function connect () 
     29  public function connect() 
    3030  { 
    3131    // determine how to get our parameters 
     
    7979   * @throws <b>sfDatabaseException</b> If an error occurs while shutting down this database. 
    8080   */ 
    81   public function shutdown () 
     81  public function shutdown() 
    8282  { 
    8383    if ($this->connection !== null) 
  • trunk/lib/database/sfPostgreSQLDatabase.class.php

    r2195 r2971  
    4545   * @throws <b>sfDatabaseException</b> If a connection could not be created. 
    4646   */ 
    47   public function connect () 
     47  public function connect() 
    4848  { 
    4949    // determine how to get our parameters 
     
    115115   * @return string A connection string. 
    116116   */ 
    117   protected function loadParameters (&$array) 
     117  protected function loadParameters(&$array) 
    118118  { 
    119119    $database = $this->getParameter('database'); 
     
    140140   * @throws <b>sfDatabaseException</b> If an error occurs while shutting down this database. 
    141141   */ 
    142   public function shutdown () 
     142  public function shutdown() 
    143143  { 
    144144    if ($this->connection != null) 
  • trunk/lib/database/sfPropelDatabase.class.php

    r2881 r2971  
    3131  static $config = array(); 
    3232 
    33   public function initialize ($parameters = null, $name = null) 
     33  public function initialize($parameters = null, $name = null) 
    3434  { 
    3535    parent::initialize($parameters); 
     
    5151  } 
    5252 
    53   public function setDefaultConfig () 
     53  public function setDefaultConfig() 
    5454  { 
    5555    self::$config['propel']['datasources']['default'] = $this->getParameter('datasource'); 
    5656  } 
    5757 
    58   public function addConfig () 
     58  public function addConfig() 
    5959  { 
    6060    $dsn = $this->getParameter('dsn'); 
     
    9494  } 
    9595 
    96   public static function getConfiguration () 
     96  public static function getConfiguration() 
    9797  { 
    9898    return self::$config; 
    9999  } 
    100100 
    101   public function setConnectionParameter ($key, $value) 
     101  public function setConnectionParameter($key, $value) 
    102102  { 
    103103    if ($key == 'host') 
  • trunk/lib/exception/sfActionException.class.php

    r1415 r2971  
    2727   * @param int    The error code. 
    2828   */ 
    29   public function __construct ($message = null, $code = 0) 
     29  public function __construct($message = null, $code = 0) 
    3030  { 
    3131    $this->setName('sfActionException'); 
  • trunk/lib/exception/sfAutoloadException.class.php

    r1415 r2971  
    2727   * @param int    The error code. 
    2828   */ 
    29   public function __construct ($message = null, $code = 0) 
     29  public function __construct($message = null, $code = 0) 
    3030  { 
    3131    $this->setName('sfAutoloadException'); 
  • trunk/lib/exception/sfCacheException.class.php

    r1415 r2971  
    2727   * @param int    The error code. 
    2828   */ 
    29   public function __construct ($message = null, $code = 0) 
     29  public function __construct($message = null, $code = 0) 
    3030  { 
    3131    $this->setName('sfCacheException'); 
  • trunk/lib/exception/sfConfigurationException.class.php

    r1415 r2971  
    2828   * @param int    The error code. 
    2929   */ 
    30   public function __construct ($message = null, $code = 0) 
     30  public function __construct($message = null, $code = 0) 
    3131  { 
    3232    $this->setName('sfConfigurationException'); 
  • trunk/lib/exception/sfContextException.class.php

    r1415 r2971  
    2626   * @param int    The error code. 
    2727   */ 
    28   public function __construct ($message = null, $code = 0) 
     28  public function __construct($message = null, $code = 0) 
    2929  { 
    3030    parent::__construct($message, $code); 
  • trunk/lib/exception/sfControllerException.class.php

    r1415 r2971  
    2828   * @param int    The error code. 
    2929   */ 
    30   public function __construct ($message = null, $code = 0) 
     30  public function __construct($message = null, $code = 0) 
    3131  { 
    3232    $this->setName('sfControllerException'); 
  • trunk/lib/exception/sfDatabaseException.class.php

    r1415 r2971  
    2727   * @param int    The error code. 
    2828   */ 
    29   public function __construct ($message = null, $code = 0) 
     29  public function __construct($message = null, $code = 0) 
    3030  { 
    3131    $this->setName('sfDatabaseException'); 
  • trunk/lib/exception/sfError404Exception.class.php

    r1415 r2971  
    2525   * @param int    The error code. 
    2626   */ 
    27   public function __construct ($message = null, $code = 0) 
     27  public function __construct($message = null, $code = 0) 
    2828  { 
    2929    $this->setName('sfError404Exception'); 
     
    3131  } 
    3232 
    33   public function printStackTrace ($exception = null) 
     33  public function printStackTrace($exception = null) 
    3434  { 
    3535    sfContext::getInstance()->getController()->forward(sfConfig::get('sf_error_404_module'), sfConfig::get('sf_error_404_action')); 
  • trunk/lib/exception/sfException.class.php

    r2808 r2971  
    3232   * @param int    The error code. 
    3333   */ 
    34   public function __construct ($message = null, $code = 0) 
     34  public function __construct($message = null, $code = 0) 
    3535  { 
    3636    if ($this->getName() === null) 
     
    5252   * @return string This exception's name. 
    5353   */ 
    54   public function getName () 
     54  public function getName() 
    5555  { 
    5656    return $this->name; 
     
    6060   * Print the stack trace for this exception. 
    6161   */ 
    62   public function printStackTrace ($exception = null) 
     62  public function printStackTrace($exception = null) 
    6363  { 
    6464    if (!$exception) 
     
    252252   * @param string An exception name. 
    253253   */ 
    254   protected function setName ($name) 
     254  protected function setName($name) 
    255255  { 
    256256    $this->name = $name; 
  • trunk/lib/exception/sfFactoryException.class.php

    r141