Browse Source

Re-organize namespace

master
J. King 6 years ago
parent
commit
a6219a95b2
  1. 6
      lib/Person/Collection.php
  2. 2
      lib/Person/Person.php
  3. 7
      lib/XML/Construct.php
  4. 11
      lib/XML/Feed.php
  5. 7
      lib/XML/Primitives/Construct.php
  6. 6
      lib/XML/Primitives/Entry.php
  7. 6
      lib/XML/Primitives/Feed.php

6
lib/PersonCollection.php → lib/Person/Collection.php

@ -4,9 +4,9 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Lax;
namespace JKingWeb\Lax\Person;
class PersonCollection extends Collection {
class Collection extends \JKingWeb\Lax\Collection {
protected static $ranks = [
'webmaster' => 10,
'editor' => 20,
@ -62,7 +62,7 @@ class PersonCollection extends Collection {
*
* The returned collection is the original instance, modified
*/
public function merge(PersonCollection ...$coll): self {
public function merge(Collection ...$coll): self {
foreach ($coll as $c) {
foreach ($c as $p) {
$this[] = $p;

2
lib/Person.php → lib/Person/Person.php

@ -4,7 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Lax;
namespace JKingWeb\Lax\Person;
class Person {
public $name = "";

7
lib/XMLCommon.php → lib/XML/Construct.php

@ -4,16 +4,17 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Lax;
namespace JKingWeb\Lax\XML;
abstract class XMLCommon {
use JKingWeb\Lax\Person\Person;
abstract class Construct {
/** @var \DOMDocument */
public $document;
/** @var \DOMXPath */
protected $xpath;
/** @var \DOMElement */
protected $subject;
protected $base = "";
const NS = [
'atom' => "http://www.w3.org/2005/Atom", // Atom syndication format https://tools.ietf.org/html/rfc4287

11
lib/XMLFeed.php → lib/XML/Feed.php

@ -4,11 +4,14 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Lax;
namespace JKingWeb\Lax\XML;
class XMLFeed extends XMLCommon {
use XMLCommonPrimitives;
use XMLFeedPrimitives;
use JKingWeb\Lax\Person\Person;
use JKingWeb\Lax\Person\Collection as PersonCollection;
class Feed extends Construct {
use Primitives\Construct;
use Primitives\Feed;
public $type;
public $version;

7
lib/XMLCommonPrimitives.php → lib/XML/Primitives/Construct.php

@ -4,9 +4,12 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Lax;
namespace JKingWeb\Lax\XML\Primitives;
trait XMLCommonPrimitives {
use JKingWeb\Lax\Person\Person;
use JKingWeb\Lax\Person\Collection as PersonCollection;
trait Construct {
/** Primitive to fetch an Atom feed/entry title
*

6
lib/XMLEntryPrimitives.php → lib/XML/Primitives/Entry.php

@ -4,9 +4,11 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Lax;
namespace JKingWeb\Lax\XML\Primitives;
trait XMLEntryPrimitives {
use JKingWeb\Lax\Person\Collection as PersonCollection;
trait Entry {
/** Primitive to fetch a collection of people associated with an RSS entry */
protected function getPeopleRss2() {

6
lib/XMLFeedPrimitives.php → lib/XML/Primitives/Feed.php

@ -4,9 +4,11 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Lax;
namespace JKingWeb\Lax\XML\Primitives;
trait XMLFeedPrimitives {
use JKingWeb\Lax\Person\Collection as PersonCollection;
trait Feed {
/** Primitive to fetch an Atom feed summary
*
Loading…
Cancel
Save