Skip to content

Commit

Permalink
Compatible with PHP5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
litefeel committed Aug 8, 2017
1 parent bba8859 commit f7f1656
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
8 changes: 5 additions & 3 deletions lib/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,11 @@ public function import_master( $user_id ) {
/**
* Export all the posts in the database to GitHub.
*
* @return boolean
*/
public function export_all( $user_id, bool $force = false ) {
* @param int $user_id
* @param boolean $force
* @return boolean
*/
public function export_all( $user_id, $force = false ) {
if ( ! $this->app->semaphore()->is_open() ) {
return $this->app->response()->error( new WP_Error(
'semaphore_locked',
Expand Down
2 changes: 1 addition & 1 deletion lib/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct( Writing_On_GitHub $app ) {
* @param bool $force
* @return Writing_On_GitHub_Post[]|WP_Error
*/
public function fetch_all_supported( bool $force = false ) {
public function fetch_all_supported( $force = false ) {
$args = array(
'post_type' => $this->get_whitelisted_post_types(),
'post_status' => $this->get_whitelisted_post_statuses(),
Expand Down
7 changes: 4 additions & 3 deletions lib/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ public function __construct( Writing_On_GitHub $app ) {
/**
* Updates all of the current posts in the database on master.
*
* @return string|WP_Error
*/
public function full( bool $force_all = false ) {
* @param bool $force_all
* @return string|WP_Error
*/
public function full( $force_all = false ) {
$posts = $this->app->database()->fetch_all_supported($force_all);

if ( is_wp_error( $posts ) ) {
Expand Down
5 changes: 3 additions & 2 deletions writing-on-github.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,9 @@ public static function write_log( $msg, $write = 'line' ) {
/**
* Kicks of an import or export cronjob.
*
* @param $type
*/
* @param bool $force
* @param string $type
*/
protected function start_cron( $type, $force = false ) {
update_option( '_wogh_' . $type . '_started', 'yes' );
$user_id = get_current_user_id();
Expand Down

0 comments on commit f7f1656

Please sign in to comment.