-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from ruudvdd/element-aware-interface-refactor
Refactor node and element implement a ElementsAwareInterface interface for type checking
- Loading branch information
Showing
6 changed files
with
74 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
/* | ||
* This file is part of the feed-io package. | ||
* | ||
* (c) Alexandre Debril <alex.debril@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace FeedIo\Feed; | ||
|
||
use FeedIo\Feed\Node\ElementInterface; | ||
use FeedIo\Feed\Node\ElementIterator; | ||
|
||
interface ElementsAwareInterface | ||
{ | ||
/** | ||
* @return ElementInterface | ||
*/ | ||
public function newElement(); | ||
|
||
/** | ||
* @param string $name element name | ||
* @return ElementIterator | ||
*/ | ||
public function getElementIterator($name); | ||
|
||
/** | ||
* @param string $name element name | ||
* @return boolean true if the element exists | ||
*/ | ||
public function hasElement($name); | ||
|
||
/** | ||
* @param ElementInterface $element | ||
* @return $this | ||
*/ | ||
public function addElement(ElementInterface $element); | ||
|
||
/** | ||
* Returns all the item's optional elements | ||
* @return \ArrayIterator | ||
*/ | ||
public function getAllElements(); | ||
|
||
/** | ||
* Returns the item's optional elements tag names | ||
* @return array | ||
*/ | ||
public function listElements(); | ||
|
||
/** | ||
* @return \Generator | ||
*/ | ||
public function getElementsGenerator(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters