Complex classes like SQLAuthenticator often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use SQLAuthenticator, and based on these observations, apply Extract Interface, too.
| 1 | <?php  | 
            ||
| 4 | class SQLAuthenticator extends Authenticator  | 
            ||
| 5 | { | 
            ||
| 6 | public $dataSet = null;  | 
            ||
| 7 | public $pendingDataSet = null;  | 
            ||
| 8 | private $dataTables = array();  | 
            ||
| 9 | private $params;  | 
            ||
| 10 | |||
| 11 | public function __construct($params)  | 
            ||
| 24 | |||
| 25 | /**  | 
            ||
| 26 |      * @SuppressWarnings("StaticAccess") | 
            ||
| 27 | */  | 
            ||
| 28 | private function getCurrentDataSet()  | 
            ||
| 36 | |||
| 37 | /**  | 
            ||
| 38 |      * @SuppressWarnings("StaticAccess") | 
            ||
| 39 | */  | 
            ||
| 40 | private function getPendingDataSet()  | 
            ||
| 48 | |||
| 49 | private function getDataTable($name, $pending = false)  | 
            ||
| 72 | |||
| 73 | /**  | 
            ||
| 74 | * Get the data table for Pending Users  | 
            ||
| 75 | *  | 
            ||
| 76 | * @return boolean|\Data\DataTable The Pending User Data Table  | 
            ||
| 77 | */  | 
            ||
| 78 | private function getPendingUserDataTable()  | 
            ||
| 86 | |||
| 87 | public function login($username, $password)  | 
            ||
| 106 | |||
| 107 | public function isLoggedIn($data)  | 
            ||
| 115 | |||
| 116 | public function getUser($data)  | 
            ||
| 124 | |||
| 125 | /**  | 
            ||
| 126 | * Get the specified entity from the specified database table  | 
            ||
| 127 | *  | 
            ||
| 128 | * @param string $tableName The name of the table to obtain data from  | 
            ||
| 129 | * @param string $filterStr The filter string to use to obtain the data  | 
            ||
| 130 | * @param string $className The class name to pass the data to  | 
            ||
| 131 | *  | 
            ||
| 132 | * @return stdClass The data as an object or null if not found  | 
            ||
| 133 | */  | 
            ||
| 134 | private function getEntityByFilter($tableName, $filterStr, $className)  | 
            ||
| 145 | |||
| 146 | public function getGroupByName($name)  | 
            ||
| 150 | |||
| 151 | public function getUserByName($name)  | 
            ||
| 155 | |||
| 156 | /**  | 
            ||
| 157 | * Get the specified entities from the specified database table  | 
            ||
| 158 | *  | 
            ||
| 159 | * @param string $dataTableName The name of the table to obtain data from  | 
            ||
| 160 | * @param boolean|\Data\Filter $filter The filter to use while searching the table  | 
            ||
| 161 | * @param boolean|array $select The array of properties to read  | 
            ||
| 162 | * @param boolean|integer $top The number of records to read  | 
            ||
| 163 | * @param boolean|integer $skip The number of records to skip  | 
            ||
| 164 | * @param boolean|array $orderby The properties to sort on  | 
            ||
| 165 | *  | 
            ||
| 166 | * @return array The SQL data returned by the filter  | 
            ||
| 167 | */  | 
            ||
| 168 | private function getDataByFilter($dataTableName, $filter, $select, $top, $skip, $orderby)  | 
            ||
| 173 | |||
| 174 | /**  | 
            ||
| 175 | * @param string $dataTableName The Data Table to serach  | 
            ||
| 176 | * @param string $className The class to obtain data in  | 
            ||
| 177 | * @param boolean|array $select The fields to read  | 
            ||
| 178 | * @param boolean|integer $top The number of entities to read  | 
            ||
| 179 | * @param boolean|integer $skip The number of entities to skip  | 
            ||
| 180 | * @param boolean|array $orderby The fields to sort by  | 
            ||
| 181 | */  | 
            ||
| 182 | private function convertDataToClass($dataTableName, $className, $filter, $select, $top, $skip, $orderby)  | 
            ||
| 196 | |||
| 197 | /**  | 
            ||
| 198 | * @param boolean|array $select The fields to read  | 
            ||
| 199 | * @param boolean|integer $top The number of entities to read  | 
            ||
| 200 | * @param boolean|integer $skip The number of entities to skip  | 
            ||
| 201 | * @param boolean|array $orderby The fields to sort by  | 
            ||
| 202 | */  | 
            ||
| 203 | public function getGroupsByFilter($filter, $select = false, $top = false, $skip = false, $orderby = false)  | 
            ||
| 207 | |||
| 208 | /**  | 
            ||
| 209 | * @param boolean|array $select The fields to read  | 
            ||
| 210 | * @param boolean|integer $top The number of entities to read  | 
            ||
| 211 | * @param boolean|integer $skip The number of entities to skip  | 
            ||
| 212 | * @param boolean|array $orderby The fields to sort by  | 
            ||
| 213 | */  | 
            ||
| 214 | public function getUsersByFilter($filter, $select = false, $top = false, $skip = false, $orderby = false)  | 
            ||
| 218 | |||
| 219 | public function getPendingUserCount()  | 
            ||
| 232 | |||
| 233 | /**  | 
            ||
| 234 | * Search all the pending users  | 
            ||
| 235 | *  | 
            ||
| 236 | * @param boolean|\Data\Filter $filter The filter to use while searching the table  | 
            ||
| 237 | * @param boolean|array $select The array of properties to read  | 
            ||
| 238 | * @param boolean|integer $top The number of records to read  | 
            ||
| 239 | * @param boolean|integer $skip The number of records to skip  | 
            ||
| 240 | * @param boolean|array $orderby The properties to sort on  | 
            ||
| 241 | *  | 
            ||
| 242 | * @return array The SQL data returned by the filter  | 
            ||
| 243 | */  | 
            ||
| 244 | private function searchPendingUsers($filter, $select, $top, $skip, $orderby)  | 
            ||
| 282 | |||
| 283 | /**  | 
            ||
| 284 | * @param \Data\Filter $filter The filter to read with  | 
            ||
| 285 | * @param boolean|array $select The fields to read  | 
            ||
| 286 | * @param boolean|integer $top The number of entities to read  | 
            ||
| 287 | * @param boolean|integer $skip The number of entities to skip  | 
            ||
| 288 | * @param boolean|array $orderby The fields to sort by  | 
            ||
| 289 | */  | 
            ||
| 290 | public function getPendingUsersByFilter($filter, $select = false, $top = false, $skip = false, $orderby = false)  | 
            ||
| 313 | |||
| 314 | public function createPendingUser($user)  | 
            ||
| 340 | |||
| 341 | public function getTempUserByHash($hash)  | 
            ||
| 350 | }  | 
            ||
| 351 | /* vim: set tabstop=4 shiftwidth=4 expandtab: */  | 
            ||
| 352 | 
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: