| 1 | <?php |
||
| 13 | class GitHub extends AbstractContent |
||
| 14 | { |
||
| 15 | private static $tagsGithub = "https://api.github.com/repos/pedro151/orm-generator/tags"; |
||
| 16 | private static $listVersion = array (); |
||
| 17 | private $phar = "https://raw.githubusercontent.com/pedro151/orm-generator/%s/bin/orm-generator.phar"; |
||
| 18 | //private $phar = "https://github.com/pedro151/orm-generator/blob/%s/bin/orm-generator.phar?raw=true"; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @return mixed |
||
| 22 | */ |
||
| 23 | public function getInfo () |
||
| 27 | |||
| 28 | /** |
||
| 29 | * |
||
| 30 | */ |
||
| 31 | protected function init () |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @return mixed |
||
| 44 | */ |
||
| 45 | public function getLastVersion () |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @return mixed |
||
| 52 | */ |
||
| 53 | public function getLastPhar () |
||
| 54 | { |
||
| 55 | reset ( self::$listVersion ); |
||
| 56 | |||
| 57 | return current ( self::$listVersion ); |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @param $version |
||
| 62 | * |
||
| 63 | * @return mixed |
||
| 64 | */ |
||
| 65 | public function getPharByVersion ( $version ) |
||
| 69 | |||
| 70 | public function hasPharByVersion ( $version ) |
||
| 74 | |||
| 75 | } |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.