| @@ -1,10 +1,10 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Integration interface | |
| 3 | + * Integrations: Abstract base class for all integration implementations | |
| 4 | 4 | * |
| 5 | - * @package Parsely\Integrations | |
| 6 | - * @since 2.6.0 | |
| 5 | + * @package Parsely | |
| 6 | + * @since 2.6.0 | |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | declare(strict_types=1); |
| 10 | 10 | |
| @@ -9,17 +9,37 @@ | ||
| 9 | 9 | declare(strict_types=1); |
| 10 | 10 | |
| 11 | 11 | namespace Parsely\Integrations; |
| 12 | 12 | |
| 13 | +use Parsely\Parsely; | |
| 14 | + | |
| 13 | 15 | /** |
| 14 | - * Integration classes are expected to implement this interface. | |
| 16 | + * Base class that all integrations should extend from. | |
| 15 | 17 | * |
| 16 | 18 | * @since 2.6.0 |
| 19 | + * @since 3.5.2 Converted from interface to abstract class. | |
| 17 | 20 | */ |
| 18 | -interface Integration { | |
| 21 | +abstract class Integration { | |
| 19 | 22 | /** |
| 20 | - * Apply the hooks that integrate the plugin or theme with the Parse.ly plugin. | |
| 23 | + * Instance of Parsely class. | |
| 21 | 24 | * |
| 25 | + * @var Parsely | |
| 26 | + */ | |
| 27 | + protected static $parsely; | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * Constructor. | |
| 31 | + * | |
| 32 | + * @param Parsely $parsely Instance of Parsely class. | |
| 33 | + */ | |
| 34 | + public function __construct( Parsely $parsely ) { | |
| 35 | + self::$parsely = $parsely; | |
| 36 | + } | |
| 37 | + | |
| 38 | + /** | |
| 39 | + * Applies the hooks that integrate the plugin or theme with the Parse.ly | |
| 40 | + * plugin. | |
| 41 | + * | |
| 22 | 42 | * @since 2.6.0 |
| 23 | 43 | */ |
| 24 | - public function integrate(): void; | |
| 44 | + abstract public function integrate(): void; | |
| 25 | 45 | } |