Skip to content
This repository has been archived by the owner on Jan 23, 2019. It is now read-only.

Commit

Permalink
Removed Enum base class. Moved isValid() to Capability.
Browse files Browse the repository at this point in the history
  • Loading branch information
theantichris committed Aug 14, 2014
1 parent b384d0d commit a0ec997
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 28 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Now supports multiple fields per meta box
* Fixed saving for checkboxes
* Fields are created for the meta box by using static methods in the meta box's view file
* Moved isValid() method to Capbilitiy class
* Removed Enum class

### 4.0.0

Expand Down
16 changes: 15 additions & 1 deletion src/Capability.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @package theantichris\SPF
* @since 3.0.0
*/
abstract class Capability extends Enum
abstract class Capability
{
const switch_themes = 'switch_themes';
const edit_themes = 'edit_themes';
Expand Down Expand Up @@ -71,4 +71,18 @@ abstract class Capability extends Enum
const manage_network_users = 'manage_network_users';
const manage_network_themes = 'manage_network_themes';
const manage_network_options = 'manage_network_options';

/**
* Checks if a given value is a valid member of the fake enum.
*
* @since 3.0.0
*
* @param string $value
*
* @return bool
*/
public static function isValid($value)
{
return defined("self::{$value}");
}
}
27 changes: 0 additions & 27 deletions src/Enum.php

This file was deleted.

0 comments on commit a0ec997

Please sign in to comment.