FriendsOfOuro / geteventstore-php-core

PHP Client for Event Store HTTP API
http://friendsofouro.github.io/geteventstore-php-core/
MIT License
67 stars 24 forks source link

[Proposal] Api && Wiki fix #26

Open dgafka opened 9 years ago

dgafka commented 9 years ago

You can't explore the API via Wiki or docblocks now.

Example wiki doesn't describe other way to iterate over stream than:

   $iterator = $es->forwardStreamFeedIterator('StreamName');

What about this?:

  $streamFeed = $es->openStreamFeed('testStream');
  $streamFeed = $es->navigateStreamFeed($streamFeed, \EventStore\StreamFeed\LinkRelation::PREVIOUS());

EventStore\StreamFeed\LinkRelation is very confusing. I had no idea, how to create LinkRelation, because my IDE didn't show any available methods inside. So after some time I figured out, that it use annotations to generate static methods.

My proposal is to remove annotations for value objects and create own implementation inside the classes. It will be easier to explore the API, through IDE.

Last thing is public method on top, private and protected on bottom of the class. It makes class more readable, because most of people are interested in public ones, not the private/protected ones

brzuchal commented 9 years ago

:+1: Have the same problem with readability, a little messy is there.

dbellettini commented 9 years ago

Hello, the enum stuff was already discussed in #21 and we will eventually drop php-enum in favor of an explicit definition of methods

dbellettini commented 9 years ago

I will try to improve docs during the weekend, and also give a look at method order. I usually do: public, protected, private constructors (including named ones) public, protected, private methods

dbellettini commented 9 years ago

I'm sorry I have to postpone it a few days