Skip to content

Commit

Permalink
Refectoring MslsAdminIcon and MslsAdminIconTaxonomy
Browse files Browse the repository at this point in the history
  • Loading branch information
lloc committed Aug 7, 2023
1 parent ef1a72a commit ecc4ddd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
9 changes: 3 additions & 6 deletions includes/MslsAdminIcon.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,18 @@ public function __toString() {
/**
* @codeCoverageIgnore
*
* @param null $type
* @param ?string $type
*
* @return MslsAdminIcon|MslsAdminIconTaxonomy
*/
public static function create( $type = null ) {
public static function create( ?string $type = null ) {
$obj = MslsContentTypes::create();

if ( ! $type ) {
$type = $obj->get_request();
}
if ( $obj->is_taxonomy() ) {
return new MslsAdminIconTaxonomy( $type );
}

return new MslsAdminIcon( $type );
return $obj->is_taxonomy() ? new MslsAdminIconTaxonomy( $type ) : new MslsAdminIcon( $type );
}

/**
Expand Down
6 changes: 1 addition & 5 deletions includes/MslsBlog.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
<?php
/**
* MslsBlog
* @author Dennis Ploetner <[email protected]>
* @since 0.9.8
*/

namespace lloc\Msls;

/**
* Internal representation of a blog
*
* @property int $userblog_id
* @package Msls
*/
Expand Down
1 change: 0 additions & 1 deletion tests/test-mslsadmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use lloc\Msls\MslsBlog;
use lloc\Msls\MslsOptions;
use lloc\Msls\MslsBlogCollection;
use Mockery\Mock;

class WP_Test_MslsAdmin extends Msls_UnitTestCase {

Expand Down

0 comments on commit ecc4ddd

Please sign in to comment.