summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/sal/class.json-api-platform.php')
-rw-r--r--plugins/jetpack/sal/class.json-api-platform.php34
1 files changed, 29 insertions, 5 deletions
diff --git a/plugins/jetpack/sal/class.json-api-platform.php b/plugins/jetpack/sal/class.json-api-platform.php
index 42ba5b60..31a42117 100644
--- a/plugins/jetpack/sal/class.json-api-platform.php
+++ b/plugins/jetpack/sal/class.json-api-platform.php
@@ -1,11 +1,29 @@
-<?php
+<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
+/**
+ * SAL_Platform class which defines a token to later be associated with a Jetpack site
+ *
+ * @package automattic/jetpack
+ */
-require_once dirname( __FILE__ ) . '/class.json-api-token.php';
+require_once __DIR__ . '/class.json-api-token.php';
+/**
+ * Base class for SAL_Platform
+ */
abstract class SAL_Platform {
+ /**
+ * A token that will represent a SAL_Token instance, default is empty.
+ *
+ * @var SAL_Token
+ */
public $token;
- function __construct( $token ) {
+ /**
+ * Contructs the SAL_Platform instance
+ *
+ * @param SAL_Token $token The variable which will store the SAL_Token instance.
+ */
+ public function __construct( $token ) {
if ( is_array( $token ) ) {
$token = SAL_Token::from_rest_token( $token );
} else {
@@ -15,11 +33,17 @@ abstract class SAL_Platform {
$this->token = $token;
}
+ /**
+ * This is the get_site function declaration, initially not implemented.
+ *
+ * @param int $blog_id The sites Jetpack blog ID.
+ * @see class.json-api-platform-jetpack.php for the implementation of this function.
+ */
abstract public function get_site( $blog_id );
}
if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
- require_once dirname( __FILE__ ) . '/class.json-api-platform-wpcom.php';
+ require_once __DIR__ . '/class.json-api-platform-wpcom.php';
} else {
- require_once dirname( __FILE__ ) . '/class.json-api-platform-jetpack.php';
+ require_once __DIR__ . '/class.json-api-platform-jetpack.php';
}