Declaring an abstract property from a subset
<p>I'm building a Feed Reader abstract class to further declare adapters to read from various data sources. I would like to declare one of the properties (format) to be only within the selected subset (json, xml in this case) when defining the extended classes i.e.:</p>

<pre><code>abstract Class FeedReader {
  public $url;
  //This is the line where I would like to define the type, but available only from a subset (json or xml).

  abstract function getData();
}


class BBCFeed extends FeedReader {
  public $type = 'json'; //I want this value to be restricted to be only json or xml

  function getData() {
    //curl code to get the data
  }
}
</code></pre>

<p>What is the most efficient (and correct) way of declaring the $type in the abstract class?. I want to restrict the $type to be only within a declared subset from the abstract class.</p>

<p>Thank you.</p>