<?php
/**
+ * Helper class for userOptions.php script.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
* @file
* @ingroup Maintenance
*/
$options = array( 'list', 'nowarn', 'quiet', 'usage', 'dry' );
$optionsWithArgs = array( 'old', 'new' );
-require_once( dirname( __FILE__ ) . '/commandLine.inc' );
+require_once( __DIR__ . '/commandLine.inc' );
/**
* @ingroup Maintenance
}
- /** This is used to check options. Only needed on construction */
+ /**
+ * This is used to check options. Only needed on construction
+ *
+ * @param $opts array
+ * @param $args array
+ *
+ * @return bool
+ */
private function checkOpts( $opts, $args ) {
// The three possible ways to run the script:
$list = isset( $opts['list'] );
return $isValid;
}
- /** load script options in the object */
+ /**
+ * load script options in the object
+ *
+ * @param $opts array
+ * @param $args array
+ *
+ * @return bool
+ */
private function initializeOpts( $opts, $args ) {
$this->mQuick = isset( $opts['nowarn'] );
return false;
}
- $this-> { $this->mMode } ( );
-
+ $this->{ $this->mMode } ( );
+ return true;
}
#
}
}
-
- /** Return an array of option names */
+ /**
+ * Return an array of option names
+ * @return array
+ */
public static function getDefaultOptionsNames() {
$def = User::getDefaultOptions();
$ret = array();
return $ret;
}
-
#
# Helper methods
#
exit( 0 );
}
- /** The warning message and countdown */
+ /**
+ * The warning message and countdown
+ * @return bool
+ */
public function warn() {
if ( $this->mQuick ) {