Commit 4f66ed20 authored by Erick Hitter's avatar Erick Hitter

PHPCS fixes

parent 0bc077ff
......@@ -62,12 +62,12 @@ function collapse_events_array( $events, $timestamp = null ) {
/**
* Convert simplified representation of cron events array to the format WordPress expects
*
* @param array $events
* @param array $events Flattened event list.
* @return array
*/
function inflate_collapsed_events_array( $events ) {
$inflated = array(
'version' => 2, // Core versions the cron array; without this, Core will attempt to "upgrade" the value
'version' => 2, // Core versions the cron array; without this, Core will attempt to "upgrade" the value.
);
if ( empty( $events ) ) {
......@@ -75,10 +75,10 @@ function inflate_collapsed_events_array( $events ) {
}
foreach ( $events as $event ) {
// Object for convenience
// Object for convenience.
$event = (object) $event;
// Set up where this event belongs in the overall structure
// Set up where this event belongs in the overall structure.
if ( ! isset( $inflated[ $event->timestamp ] ) ) {
$inflated[ $event->timestamp ] = array();
}
......@@ -87,7 +87,7 @@ function inflate_collapsed_events_array( $events ) {
$inflated[ $event->timestamp ][ $event->action ] = array();
}
// Store this event
// Store this event.
$inflated[ $event->timestamp ][ $event->action ][ $event->instance ] = $event->args;
}
......
......@@ -19,7 +19,7 @@ require_once $_tests_dir . '/includes/functions.php';
function _manually_load_plugin() {
define( 'WP_CRON_CONTROL_SECRET', 'testtesttest' );
// Nonsense values to test constraints and aid testing
// Nonsense values to test constraints and aid testing.
define( 'CRON_CONTROL_CACHE_BUCKET_SIZE', 0 );
define( 'CRON_CONTROL_MAX_CACHE_BUCKETS', PHP_INT_MAX / 2 );
......
<?php
/**
* Class Utils_Tests
* Test plugin's utility functions
*
* @package Automattic_Cron_Control
* @package a8c_Cron_Control
*/
namespace Automattic\WP\Cron_Control\Tests;
use Automattic\WP\Cron_Control;
/**
* Sample test case.
* Class Utils_Tests
*/
class Utils_Tests extends \WP_UnitTestCase {
/**
......@@ -19,7 +18,7 @@ class Utils_Tests extends \WP_UnitTestCase {
function setUp() {
parent::setUp();
// make sure the schedule is clear
// make sure the schedule is clear.
_set_cron_array( array() );
}
......@@ -27,7 +26,7 @@ class Utils_Tests extends \WP_UnitTestCase {
* Clean up after our tests
*/
function tearDown() {
// make sure the schedule is clear
// make sure the schedule is clear.
_set_cron_array( array() );
parent::tearDown();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment