Skip to content

Commit

Permalink
Finish clean Meta builder, CS, PHPStan level 5, clean Api models
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitriBouteille committed Jan 19, 2024
1 parent 02a9a63 commit eb5574f
Show file tree
Hide file tree
Showing 25 changed files with 473 additions and 621 deletions.
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
level: 2
level: 5
paths:
- src
excludePaths:
Expand Down
199 changes: 0 additions & 199 deletions src/Api/CommentInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,7 @@

namespace Dbout\WpOrm\Api;

use Carbon\Carbon;
use Dbout\WpOrm\Models\Comment;
use Dbout\WpOrm\Models\Post;
use Dbout\WpOrm\Models\User;

/**
* @method Comment setCommentAuthor(?string $author)
* @method string|null getCommentAuthor()
* @method Comment setCommentAuthorEmail(?string $email)
* @method string|null getCommentAuthorEmail()
* @method Comment setCommentAuthorUrl(?string $url)
* @method string|null getCommentAuthorUrl()
* @method Comment setCommentAuthorIP(?string $ip)
* @method string|null getCommentAuthorIP()
* @method Comment setCommentContent(?string $content)
* @method string|null getCommentContent()
* @method Comment setCommentKarma(?int $karma)
* @method int|null getCommentKarma()
* @method Comment setCommentApproved(string $approved)
* @method string getCommentApproved()
* @method Comment setCommentAgent(?string $agent)
* @method string|null getCommentAgent()
* @method Comment setCommentType(?string $type)
* @method string|null getCommentType()
* @method Comment setUserId(?int $userId)
* @method int|null getUserId()
* @method Comment setCommentDate(mixed $date)
* @method Carbon|null getCommentDate()
* @method Comment setCommentDateGmt(mixed $date)
* @method Carbon|null getCommentDateGmt()
*
* @property-read User|null $user
* @property-read Post|null $post
* @property-read Comment|null $parent
*
* @since 3.0.0
*/
interface CommentInterface
Expand All @@ -62,169 +28,4 @@ interface CommentInterface
public const TYPE = 'comment_type';
public const PARENT = 'comment_parent';
public const USER_ID = 'user_id';

/**
* @param string $author
* @return self
* @deprecated Remove in next version
* @see setCommentAuthor()
*/
public function setAuthor(string $author): self;

/**
* @return string|null
* @deprecated Remove in next version
* @see getCommentAuthor()
*/
public function getAuthor(): ?string;

/**
* @param string|null $email
* @return self
* @deprecated Remove in next version
* @see setCommentAuthorEmail()
*/
public function setAuthorEmail(?string $email): self;

/**
* @return string|null
* @deprecated Remove in next version
* @see getCommentAuthorEmail()
*/
public function getAuthorEmail(): ?string;

/**
* @param string|null $url
* @return self
* @deprecated Remove in next version
* @see setCommentAuthorUrl()
*/
public function setAuthorUrl(?string $url): self;

/**
* @return string|null
* @deprecated Remove in next version
* @see getCommentAuthorUrl()
*/
public function getAuthorUrl(): ?string;

/**
* @param string|null $ip
* @return self
* @deprecated Remove in next version
* @see setCommentAuthorIP()
*/
public function setAuthorIp(?string $ip): self;

/**
* @return string|null
* @deprecated Remove in next version
* @see getCommentAuthorIP()
*/
public function getAuthorIp(): ?string;

/**
* @param string|null $content
* @return self
* @deprecated Remove in next version
* @see setCommentContent()
*/
public function setContent(?string $content): self;

/**
* @return string|null
* @deprecated Remove in next version
* @see gsetCommentContent()
*/
public function getContent(): ?string;

/**
* @param int|null $karma
* @return self
* @deprecated Remove in next version
* @see setCommentKarma()
*/
public function setKarma(?int $karma): self;

/**
* @return int|null
* @deprecated Remove in next version
* @see getCommentKarma()
*/
public function getKarma(): ?int;

/**
* @param string|null $agent
* @return self
* @deprecated Remove in next version
* @see setCommentAgent()
*/
public function setAgent(?string $agent): self;

/**
* @return string|null
* @deprecated Remove in next version
* @see getCommentAgent()
*/
public function getAgent(): ?string;

/**
* @param string|null $type
* @return self
* @deprecated Remove in next version
* @see setCommentType()
*/
public function setType(?string $type): self;

/**
* @return string|null
* @deprecated Remove in next version
* @see getCommentType()
*/
public function getType(): ?string;

/**
* @param string|null $approved
* @return self
* @deprecated Remove in next version
* @see setCommentApproved()
*/
public function setApproved(?string $approved): self;

/**
* @return string|null
* @deprecated Remove in next version
* @see getCommentApproved()
*/
public function getApproved(): ?string;

/**
* @param mixed $date
* @return self
* @deprecated Remove in next version
* @see setCommentDate()
*/
public function setDate(mixed $date): self;

/**
* @return Carbon|null
* @deprecated Remove in next version
* @see getCommentDate()
*/
public function getDate(): ?Carbon;

/**
* @param mixed $date
* @return self
* @deprecated Remove in next version
* @see setCommentDateGmt()
*/
public function setDateGMT(mixed $date): self;

/**
* @return Carbon|null
* @deprecated Remove in next version
* @see getCommentDateGmt()
*/
public function getDateGMT(): ?Carbon;
}
18 changes: 0 additions & 18 deletions src/Api/OptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,7 @@

namespace Dbout\WpOrm\Api;

use Dbout\WpOrm\Enums\YesNo;
use Dbout\WpOrm\Models\Option;

/**
* @method Option setOptionName(string $name)
* @method string getOptionName()
* @method Option setOptionValue($value)
* @method mixed getOptionValue()
* @method Option setAutoload(string|YesNo $autoload)
* @method string getAutoload()
*
* @since 3.0.0
*/
interface OptionInterface
Expand All @@ -27,12 +17,4 @@ interface OptionInterface
public const NAME = 'option_name';
public const VALUE = 'option_value';
public const AUTOLOAD = 'autoload';

/**
* Find one option by name
*
* @param string $optionName
* @return self|null
*/
public static function findOneByName(string $optionName): ?self;
}
50 changes: 0 additions & 50 deletions src/Api/PostInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,49 +8,7 @@

namespace Dbout\WpOrm\Api;

use Carbon\Carbon;
use Dbout\WpOrm\Models\Post;

/**
* @method Post setPostDate($date)
* @method Carbon|null getPostDate()
* @method Post setPostDateGMT($date)
* @method Carbon|null getPostDateGMT()
* @method Post setPostContent(?string $content)
* @method string|null getPostContent()
* @method Post setPostType(string $type)
* @method string|null getPostType()
* @method Post setGuid(?string $guid)
* @method string|null getGuid()
* @method Post setPostTitle(?string $title)
* @method string|null getPostTitle()
* @method Post setPostExcerpt(?string $excerpt)
* @method string|null getPostExcerpt()
* @method Post setPostStatus(?string $status)
* @method string|null getPostStatus()
* @method Post setCommentStatus(string $status)
* @method string|null getCommentStatus()
* @method Post setPingStatus(string $status)
* @method string|null getPingStatus()
* @method Post setPostPassword(?string $password)
* @method string|null getPostPassword()
* @method Post setPostName(?string $name)
* @method string|null getPostName()
* @method Post setToPing(?string $toPing)
* @method string|null getToPing()
* @method Post setPinged(?string $pinged)
* @method string|null getPinged()
* @method Post setPostModified($modified)
* @method Carbon|null getPostModified()
* @method Post setPostModifiedGMT($modified)
* @method Carbon|null getPostModifiedGMT()
* @method setPostMimeType(?string $mimeType)
* @method string|null getPostMimeType()
* @method Post setMenuOrder(?int $order)
* @method int|null getMenuOrder()
* @method Post setPostContentFiltered($content)
* @method string|null getPostContentFiltered()
*
* @since 3.0.0
*/
interface PostInterface
Expand Down Expand Up @@ -78,12 +36,4 @@ interface PostInterface
public const TYPE = 'post_type';
public const MIME_TYPE = 'post_mime_type';
public const COMMENT_COUNT = 'comment_count';

/**
* Find post by name
*
* @param string|null $name
* @return Post|null
*/
public function findOneByName(?string $name): ?Post;
}
9 changes: 0 additions & 9 deletions src/Api/TermInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,7 @@

namespace Dbout\WpOrm\Api;

use Dbout\WpOrm\Models\Term;

/**
* @method string|null getName()
* @method Term setName(?string $name);
* @method string|null getSlug()
* @method Term setSlug(?string $slug)
* @method int|null getTermGroup()
* @method Term setTermGroup(?int $group)
*
* @since 3.0.0
*/
interface TermInterface
Expand Down
9 changes: 0 additions & 9 deletions src/Api/TermRelationshipInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,7 @@

namespace Dbout\WpOrm\Api;

use Dbout\WpOrm\Models\TermRelationship;

/**
* @method int|null getTermOrder()
* @method TermRelationship setTermOrder(?int $order)
* @method int|null getTermTaxonomyId()
* @method TermRelationship setTermTaxonomyId(?int $id)
* @method int|null getObjectId()
* @method TermRelationship setObjectId(?int $id)
*
* @since 3.0.0
*/
interface TermRelationshipInterface
Expand Down
13 changes: 0 additions & 13 deletions src/Api/TermTaxonomyInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,7 @@

namespace Dbout\WpOrm\Api;

use Dbout\WpOrm\Models\TermTaxonomy;

/**
* @method int|null getTermId()
* @method TermTaxonomy setTermId(int $id)
* @method string getTaxonomy()
* @method TermTaxonomy setTaxonomy(string $taxonomy)
* @method string|null getDescription()
* @method TermTaxonomy setDescription(?string $description)
* @method int|null getParent()
* @method TermTaxonomy setParent($parent)
* @method int|null getCount()
* @method TermTaxonomy setCount(int $count)
*
* @since 3.0.0
*/
interface TermTaxonomyInterface
Expand Down
Loading

0 comments on commit eb5574f

Please sign in to comment.