Skip to content

Commit

Permalink
Remove final from the class, use it in the methods
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzap committed May 11, 2021
1 parent b059e34 commit 4fe60a2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/WpContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Inpsyde;

final class WpContext implements \JsonSerializable
class WpContext implements \JsonSerializable
{
public const AJAX = 'ajax';
public const BACKOFFICE = 'backoffice';
Expand Down Expand Up @@ -43,15 +43,15 @@ final class WpContext implements \JsonSerializable
/**
* @return WpContext
*/
public static function new(): WpContext
final public static function new(): WpContext
{
return new self(array_fill_keys(self::ALL, false));
}

/**
* @return WpContext
*/
public static function determine(): WpContext
final public static function determine(): WpContext
{
$installing = defined('WP_INSTALLING') && WP_INSTALLING;
$xmlRpc = defined('XMLRPC_REQUEST') && XMLRPC_REQUEST;
Expand Down Expand Up @@ -156,7 +156,7 @@ private function __construct(array $data)
* @param string $context
* @return WpContext
*/
public function force(string $context): WpContext
final public function force(string $context): WpContext
{
if (!in_array($context, self::ALL, true)) {
throw new \LogicException("'{$context}' is not a valid context.");
Expand All @@ -178,7 +178,7 @@ public function force(string $context): WpContext
/**
* @return WpContext
*/
public function withCli(): WpContext
final public function withCli(): WpContext
{
$this->data[self::CLI] = true;

Expand All @@ -190,7 +190,7 @@ public function withCli(): WpContext
* @param string ...$contexts
* @return bool
*/
public function is(string $context, string ...$contexts): bool
final public function is(string $context, string ...$contexts): bool
{
array_unshift($contexts, $context);

Expand Down

0 comments on commit 4fe60a2

Please sign in to comment.