Skip to content

Commit

Permalink
refactor: rewrite all classes to php 7.4 and apply new lint styles
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Support only PHP 7.4+, Rename almost all classes, Fix
some bugs
  • Loading branch information
elvishp2006 committed May 8, 2020
1 parent d8a0ec8 commit f477622
Show file tree
Hide file tree
Showing 31 changed files with 301 additions and 925 deletions.
48 changes: 0 additions & 48 deletions src/Entities/AbstractPost.php

This file was deleted.

48 changes: 0 additions & 48 deletions src/Entities/AbstractTerm.php

This file was deleted.

147 changes: 0 additions & 147 deletions src/Entities/Collection.php

This file was deleted.

25 changes: 0 additions & 25 deletions src/Entities/CollectionInterface.php

This file was deleted.

15 changes: 0 additions & 15 deletions src/Entities/EntityInterface.php

This file was deleted.

7 changes: 7 additions & 0 deletions src/Entities/IEntity.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php declare(strict_types = 1);

namespace WPSteak\Entities;

interface IEntity {

}
9 changes: 9 additions & 0 deletions src/Entities/IPost.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php declare(strict_types = 1);

namespace WPSteak\Entities;

interface IPost extends IEntity {

public function get_post(): \WP_Post;

}
9 changes: 9 additions & 0 deletions src/Entities/ITerm.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php declare(strict_types = 1);

namespace WPSteak\Entities;

interface ITerm extends IEntity {

public function get_term(): \WP_Term;

}
19 changes: 19 additions & 0 deletions src/Entities/Post.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php declare(strict_types = 1);

namespace WPSteak\Entities;

abstract class Post implements IPost {

public const POST_TYPE = 'post';

protected \WP_Post $post;

public function __construct( \WP_Post $post ) {
$this->post = $post;
}

public function get_post(): \WP_Post {
return $this->post;
}

}
31 changes: 0 additions & 31 deletions src/Entities/PostInterface.php

This file was deleted.

19 changes: 19 additions & 0 deletions src/Entities/Term.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php declare(strict_types = 1);

namespace WPSteak\Entities;

abstract class Term implements ITerm {

public const TAXONOMY = 'category';

protected \WP_Term $term;

public function __construct( \WP_Term $term ) {
$this->term = $term;
}

public function get_term(): \WP_Term {
return $this->term;
}

}
Loading

0 comments on commit f477622

Please sign in to comment.