Skip to content

Commit

Permalink
REturn types
Browse files Browse the repository at this point in the history
  • Loading branch information
claytoncollie committed Apr 3, 2024
1 parent 44904d6 commit a78b08b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions wp/headless-wp/includes/classes/BaseToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static function generate( array $payload ): string {
/**
* Return the private key used to encode and decode tokens.
*
* @throws \Exception If the private key is not found.
* @throws Exception If the private key is not found.
*
* @return string
*/
Expand Down Expand Up @@ -70,9 +70,9 @@ private static function get_private_key() {
/**
* Decode capability tokens if present.
*
* @return object
* @return object|null
*/
public static function get_payload_from_token( $token = '' ) {
public static function get_payload_from_token( string $token = '' ) {
// Get HTTP Authorization Header.
$header = isset( $_SERVER['HTTP_AUTHORIZATION'] )
? sanitize_text_field( wp_unslash( $_SERVER['HTTP_AUTHORIZATION'] ) )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@
*/
class PolylangYoastPresenter extends Abstract_Indexable_Presenter {

/**
* Presentation
*
* @var object
*/
public $presentation;

/**
* Output the hreflang tags if they exist.
*/
public function present() {
public function present(): string {
if ( function_exists( 'pll_languages_list' ) ) {
$hreflangs = $this->get();

Expand All @@ -38,7 +44,7 @@ public function present() {
*
* @return string Hreflang tags or empty string.
*/
public function get() {
public function get(): string {
$source = $this->presentation->source;

if ( ! $source instanceof \WP_Post && ! $source instanceof \WP_Term ) {
Expand Down Expand Up @@ -142,7 +148,7 @@ public function get() {
*
* @return array List of homepage IDs.
*/
public function get_homepage_post_ids() {
public function get_homepage_post_ids(): array {
$home_id = get_option( 'page_on_front' );
if ( empty( $home_id ) ) {
return [];
Expand Down

0 comments on commit a78b08b

Please sign in to comment.