Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php namespace Arcanedev\GeoIP\Tasks; |
||
28 | public static function run($url, $path) |
||
29 | { |
||
30 | $path = static::checkDestinationPath($path); |
||
|
|||
31 | |||
32 | static::checkUrl($url); |
||
33 | |||
34 | $tmpFile = tempnam(sys_get_temp_dir(), 'maxmind'); |
||
35 | file_put_contents($tmpFile, fopen($url, 'r')); |
||
36 | |||
37 | file_put_contents($path, gzopen($tmpFile, 'r')); |
||
38 | |||
39 | unlink($tmpFile); |
||
40 | |||
41 | return true; |
||
42 | } |
||
43 | |||
77 |
Let’s assume you have a class which uses late-static binding:
}
The code above will run fine in your PHP runtime. However, if you now create a sub-class and call the
getSomeVariable()
on that sub-class, you will receive a runtime error:In the case above, it makes sense to update
SomeClass
to useself
instead: