Complex classes like JobsMulti 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 JobsMulti, and based on these observations, apply Extract Interface, too.
| 1 | <?php namespace JobApis\Jobs\Client;  | 
            ||
| 6 | class JobsMulti  | 
            ||
| 7 | { | 
            ||
| 8 | /**  | 
            ||
| 9 | * Job board API query objects  | 
            ||
| 10 | *  | 
            ||
| 11 | * @var AbstractQuery  | 
            ||
| 12 | */  | 
            ||
| 13 | protected $queries = [];  | 
            ||
| 14 | |||
| 15 | /**  | 
            ||
| 16 | * Creates query objects for each provider and creates this unified client.  | 
            ||
| 17 | *  | 
            ||
| 18 | * @param array $providers  | 
            ||
| 19 | */  | 
            ||
| 20 | 18 | public function __construct($providers = [])  | 
            |
| 28 | |||
| 29 | /**  | 
            ||
| 30 | * Overrides get<Provider>Jobs() methods  | 
            ||
| 31 | *  | 
            ||
| 32 | * @param $method  | 
            ||
| 33 | * @param $args  | 
            ||
| 34 | *  | 
            ||
| 35 | * @return mixed  | 
            ||
| 36 | */  | 
            ||
| 37 | 2 | public function __call($method, $args)  | 
            |
| 49 | |||
| 50 | /**  | 
            ||
| 51 | * Instantiates a Query object and adds it to the queries array.  | 
            ||
| 52 | *  | 
            ||
| 53 | * @param $key string Query name  | 
            ||
| 54 | * @param $className string Query class name  | 
            ||
| 55 | * @param $options array Parameters to add to constructor  | 
            ||
| 56 | *  | 
            ||
| 57 | * @return $this  | 
            ||
| 58 | */  | 
            ||
| 59 | 18 | public function addQuery($key, $className, $options = [])  | 
            |
| 64 | |||
| 65 | /**  | 
            ||
| 66 | * Gets jobs from all providers in a single go and returns an array of Collection objects.  | 
            ||
| 67 | *  | 
            ||
| 68 | * @return array  | 
            ||
| 69 | */  | 
            ||
| 70 | public function getAllJobs()  | 
            ||
| 78 | |||
| 79 | /**  | 
            ||
| 80 | * Gets jobs from a single provider and hydrates a new jobs collection.  | 
            ||
| 81 | *  | 
            ||
| 82 | * @return \JobApis\Jobs\Client\Collection  | 
            ||
| 83 | */  | 
            ||
| 84 | 2 | public function getJobsByProvider($provider)  | 
            |
| 94 | |||
| 95 | /**  | 
            ||
| 96 | * Sets a keyword on the query for each provider.  | 
            ||
| 97 | *  | 
            ||
| 98 | * @param $keyword string  | 
            ||
| 99 | *  | 
            ||
| 100 | * @return $this  | 
            ||
| 101 | */  | 
            ||
| 102 | 2 | public function setKeyword($keyword)  | 
            |
| 142 | |||
| 143 | /**  | 
            ||
| 144 | * Sets a location on the query for each provider.  | 
            ||
| 145 | *  | 
            ||
| 146 | * @param $location  | 
            ||
| 147 | *  | 
            ||
| 148 | * @return $this  | 
            ||
| 149 | */  | 
            ||
| 150 | 4 | public function setLocation($location)  | 
            |
| 200 | |||
| 201 | /**  | 
            ||
| 202 | * Sets a page number and number of results per page for each provider.  | 
            ||
| 203 | *  | 
            ||
| 204 | * @param $page integer  | 
            ||
| 205 | * @param $perPage integer  | 
            ||
| 206 | *  | 
            ||
| 207 | * @return $this  | 
            ||
| 208 | */  | 
            ||
| 209 | 2 | public function setPage($page = 1, $perPage = 10)  | 
            |
| 259 | |||
| 260 | /**  | 
            ||
| 261 | * Instantiates a provider using a query object.  | 
            ||
| 262 | *  | 
            ||
| 263 | * @param null $name  | 
            ||
| 264 | * @param AbstractQuery $query  | 
            ||
| 265 | *  | 
            ||
| 266 | * @return AbstractProvider  | 
            ||
| 267 | */  | 
            ||
| 268 | 2 | public static function createProvider($name, AbstractQuery $query)  | 
            |
| 272 | |||
| 273 | /**  | 
            ||
| 274 | * Gets a start from count for APIs that use per_page and start_from pattern.  | 
            ||
| 275 | *  | 
            ||
| 276 | * @param int $page  | 
            ||
| 277 | * @param int $perPage  | 
            ||
| 278 | *  | 
            ||
| 279 | * @return int  | 
            ||
| 280 | */  | 
            ||
| 281 | 2 | private function getStartFrom($page = 1, $perPage = 10)  | 
            |
| 285 | |||
| 286 | /**  | 
            ||
| 287 | * Tests whether location string follows valid convention (City, ST).  | 
            ||
| 288 | *  | 
            ||
| 289 | * @param string $location  | 
            ||
| 290 | *  | 
            ||
| 291 | * @return bool  | 
            ||
| 292 | */  | 
            ||
| 293 | 4 | private function isValidLocation($location = null)  | 
            |
| 298 | |||
| 299 | /**  | 
            ||
| 300 | * Tests whether the method is a valid get<Provider>Jobs() method.  | 
            ||
| 301 | *  | 
            ||
| 302 | * @param $method  | 
            ||
| 303 | *  | 
            ||
| 304 | * @return bool  | 
            ||
| 305 | */  | 
            ||
| 306 | 2 | private function isGetJobsByProviderMethod($method)  | 
            |
| 310 | |||
| 311 | /**  | 
            ||
| 312 | * Get the provider name from the method.  | 
            ||
| 313 | *  | 
            ||
| 314 | * @param $method  | 
            ||
| 315 | *  | 
            ||
| 316 | * @return string  | 
            ||
| 317 | */  | 
            ||
| 318 | private function getProviderFromMethod($method)  | 
            ||
| 323 | }  | 
            ||
| 324 |