Skip to content

Commit

Permalink
Adding a contract for Countable things and Parsers.
Browse files Browse the repository at this point in the history
  • Loading branch information
fmizzell committed Jul 2, 2019
1 parent 7028273 commit 6c2feaa
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/Countable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Contracts;

use phpDocumentor\Reflection\Types\Integer;

interface Countable
{
public function count(): int;
}
2 changes: 1 addition & 1 deletion src/Mock/Storage/Memory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class Memory implements Storage, BulkRetriever {

private $storage = [];
protected $storage = [];

public function retrieve(string $id): ?string
{
Expand Down
16 changes: 16 additions & 0 deletions src/Parser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php


namespace Contracts;


interface Parser
{
public function feed(string $chunk);

public function getRecord();

public function reset();

public function finish();
}

0 comments on commit 6c2feaa

Please sign in to comment.