2017 © Pedro Peláez
 

library feed

Supply ordered feeds of articles.

image

graze/feed

Supply ordered feeds of articles.

  • Tuesday, February 13, 2018
  • by graze
  • Repository
  • 23 Watchers
  • 0 Stars
  • 9,121 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 6 % Grown

The README.md

graze/feed

Latest Stable Version Build Status Minimum PHP Version, (*1)

This is a very simple library designed to facilitate the implementation of simple, lightweight article feeds, where articles can be anything you like., (*2)

It can be installed in whichever way you prefer, but we recommend Composer., (*3)

$ composer require graze/feed

The interface

The core of the library is Graze\Feed\FeedInterface which looks like this:, (*4)

interface FeedInterface
{
    /**
     * @param integer $number
     * @return boolean
     */
    public function supports($number);

    /**
     * @param integer $number
     * @return array
     */
    public function supply($number);
}

The idea being that any feed which you create can be queried to see if it supports a given number of articles (supports($number)) and, if so, can supply those articles (supply($number))., (*5)

The abstract class

The Graze\Feed\AbstractFeed class is designed to let you implement a single protected method (getArticles) and then handles some boilerplate around 'supporting' and 'supplying' these articles. N.B. this class will throw a LogicException if you request more articles than are supported by its supports method - always check if the feed 'supports' a given number of articles before telling it to give you them., (*6)

Some batteries included

There's also an implementation of a basic article feed, and a random article feed, as well as a stack feed, that takes an array of Graze\Feed\FeedInterface as the only argument to its constructor and lets you create a meta-feed that will defer to each of the provided feeds in turn until it finds a supported one., (*7)

Contributing

Contributions are accepted via Pull Request, but passing unit tests must be included before it will be considered for merge., (*8)

$ composer install
$ vendor/bin/phpunit

License

The content of this library is released under the MIT License by Nature Delivered Ltd.., (*9)

You can find a copy of this license at http://www.opensource.org/licenses/mit or in LICENSE., (*10)

The Versions

13/02 2018

dev-master

9999999-dev https://github.com/graze/feed

Supply ordered feeds of articles.

  Sources   Download

MIT

The Requires

  • php ~5.5

 

The Development Requires

feed feeds

27/01 2015

0.0.2

0.0.2.0 https://github.com/graze/feed

supply ordered feeds of articles

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

feed feeds

27/01 2015

0.0.1

0.0.1.0 https://github.com/graze/feed

supply ordered feeds of things

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires