| Conditions | 5 | 
| Paths | 6 | 
| Total Lines | 21 | 
| Code Lines | 13 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 13 | 
| CRAP Score | 5.009 | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php  | 
            ||
| 21 | 3 | public static function get()  | 
            |
| 22 |     { | 
            ||
| 23 | 3 |         if (static::$client !== null) { | 
            |
| 24 | return static::$client;  | 
            ||
| 25 | }  | 
            ||
| 26 | |||
| 27 | 3 |         if (ClientsHelper::$personalAccessClientId > 0) { | 
            |
| 28 | 1 | $client = ModelsHelper::clients()->findOne(ClientsHelper::$personalAccessClientId);  | 
            |
| 29 | 1 |             if ($client instanceof Client) { | 
            |
| 30 | 1 | static::$client = $client;  | 
            |
| 31 | 1 | return $client;  | 
            |
| 32 | }  | 
            ||
| 33 | }  | 
            ||
| 34 | 2 | $clients = ModelsHelper::clients()->findByRedirect(ClientsHelper::PERSONAL_ACCESS_REDIRECT_URI);  | 
            |
| 35 | 2 |         if (count($clients) === 1) { | 
            |
| 36 | 1 | static::$client = $clients->current();  | 
            |
| 37 | 1 | return $clients->current();  | 
            |
| 
                                                                                                    
                        
                         | 
                |||
| 38 | }  | 
            ||
| 39 | |||
| 40 | 1 | static::$client = static::create();  | 
            |
| 41 | 1 | return static::$client;  | 
            |
| 42 | }  | 
            ||
| 65 |