| Conditions | 5 | 
| Paths | 4 | 
| Total Lines | 29 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php  | 
            ||
| 30 | public function run($request)  | 
            ||
| 31 |     { | 
            ||
| 32 | $versionless = File::get()->leftJoin(  | 
            ||
| 33 | 'FileVersion',  | 
            ||
| 34 | '"FileVersion"."FileID" = "File"."ID"'  | 
            ||
| 35 |         )->where('"File"."ClassName" <> \'Folder\' AND "FileVersion"."FileID" IS NULL'); | 
            ||
| 36 | $createdVersions = 0;  | 
            ||
| 37 | |||
| 38 |         if ($versionless) { | 
            ||
| 39 |             foreach ($versionless as $file) { | 
            ||
| 40 |                 if ($file->createVersion()) { | 
            ||
| 41 | ++$createdVersions;  | 
            ||
| 42 | }  | 
            ||
| 43 | }  | 
            ||
| 44 | }  | 
            ||
| 45 | |||
| 46 |         if ($createdVersions) { | 
            ||
| 47 | echo _t(  | 
            ||
| 48 | 'FileVersionCreationTask.Created',  | 
            ||
| 49 |                 "Created {count} file version records.", | 
            ||
| 50 |                 array('count' => $createdVersions) | 
            ||
| 
                                                                                                    
                        
                         | 
                |||
| 51 | );  | 
            ||
| 52 |         } else { | 
            ||
| 53 | echo _t(  | 
            ||
| 54 | 'FileVersionCreationTask.NoCreated',  | 
            ||
| 55 | 'No file version records created.'  | 
            ||
| 56 | );  | 
            ||
| 57 | }  | 
            ||
| 58 | }  | 
            ||
| 59 | }  | 
            ||
| 60 | 
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: