| 1 | <?php |
||
| 16 | class CacheMaintenanceSQL implements RobotsTxtInterface, SQLInterface, SQLMaintenanceInterface |
||
| 17 | { |
||
| 18 | use SQLTrait; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var PDO |
||
| 22 | */ |
||
| 23 | private $pdo; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Maintenance constructor. |
||
| 27 | * |
||
| 28 | * @param PDO $pdo |
||
| 29 | */ |
||
| 30 | public function __construct(PDO $pdo) |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Clean the cache table |
||
| 37 | * |
||
| 38 | * @param int $delay - in seconds |
||
| 39 | * @return bool |
||
| 40 | */ |
||
| 41 | public function clean($delay = self::CACHE_TIME) |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Create SQL table |
||
| 54 | * |
||
| 55 | * @return bool |
||
| 56 | * @throws SQLException |
||
| 57 | */ |
||
| 58 | public function setup() |
||
| 65 | } |
||
| 66 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.