Skip to content

Commit

Permalink
Code review feedback, relax version constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinfodness committed Jul 23, 2024
1 parent 1dcd4b8 commit ec47f9c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<exclude-pattern>vendor/</exclude-pattern>

<!-- The version set here matches the minimum version tested in CI. -->
<config name="minimum_supported_wp_version" value="6.6" />
<config name="minimum_supported_wp_version" value="6.0" />

<!-- Define the prefixes that can be used by the plugin -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Tags: alleyinteractive, wp-video-sync

Stable tag: 0.1.0

Requires at least: 6.6
Requires at least: 6.0

Tested up to: 6.6

Expand Down
4 changes: 2 additions & 2 deletions src/adapters/class-jw-player-7-for-wp.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ class JW_Player_7_For_WP implements Adapter {
/**
* The date of the last modification to the last batch of videos.
*
* @var DateTimeImmutable
* @var ?DateTimeImmutable
*/
private DateTimeImmutable $last_modified_date;
private ?DateTimeImmutable $last_modified_date;

/**
* Fetches the date of the last modification to the last batch of videos.
Expand Down
9 changes: 7 additions & 2 deletions src/class-sync-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class Sync_Manager {
/**
* The adapter to use for fetching videos.
*
* @var Adapter
* @var ?Adapter
*/
public Adapter $adapter;
public ?Adapter $adapter;

/**
* A callback to run for each result when the sync runs.
Expand Down Expand Up @@ -75,6 +75,11 @@ public function maybe_schedule_sync(): void {
* @throws Error If unable to parse the last sync as a DateTimeImmutable object.
*/
public function sync_videos(): void {
// If there isn't a valid adapter, bail.
if ( ! $this->adapter instanceof Adapter ) {
throw new Error( esc_html__( 'WP Video Sync: Unable to sync videos without a valid adapter.', 'wp-video-sync' ) );
}

// If there isn't a valid callback, bail.
if ( ! is_callable( $this->callback ) ) {
throw new Error( esc_html__( 'WP Video Sync: Unable to execute provided callback.', 'wp-video-sync' ) );
Expand Down

0 comments on commit ec47f9c

Please sign in to comment.