-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework the Index and Quick Start guide #24
Rework the Index and Quick Start guide #24
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The page should be modified consistently and should show only a quick start. Everything else should be listed separately.
7238913
to
6b1de29
Compare
@froschdesign, what do you think of the state of the PR as it currently stands? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only some small corrections.
composer.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "laminas/laminas-hydrator", | |||
"description": "Serialize objects to arrays, and vice versa", | |||
"description": "laminas-hydrator provides functionality for hydrating objects and extracting data from them. The component contains concrete implementations for a number of common use cases and provides interfaces for creating custom implementations.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this. We can find a shorter description in another pull request and add this sentence to the introduction also in another pull request.
docs/book/v3/quick-start.md
Outdated
use Laminas\Hydrator; | ||
|
||
interface ExtractionInterface | ||
{ | ||
/** | ||
* Extract values from an object | ||
* | ||
* @return mixed[] | ||
*/ | ||
public function extract(object $object) : array; | ||
} | ||
$hydrator = new Hydrator\ArraySerializableHydrator(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be written in one line because the namespace is only used once:
$hydrator = new Laminas\Hydrator\ArraySerializableHydrator();
docs/book/v3/quick-start.md
Outdated
use Laminas\Hydrator; | ||
|
||
interface HydrationInterface | ||
{ | ||
/** | ||
* Hydrate $object with the provided $data. | ||
* | ||
* @param mixed[] $data | ||
* @return object The implementation should return an object of any type. | ||
* By purposely omitting the return type from the signature, | ||
* implementations may choose to specify a more specific type. | ||
*/ | ||
public function hydrate(array $data, object $object); | ||
} | ||
$hydrator = new Hydrator\ArraySerializableHydrator(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be written in one line:
$hydrator = new Laminas\Hydrator\ArraySerializableHydrator();
docs/book/v3/quick-start.md
Outdated
|
||
```php | ||
namespace Laminas\Hydrator; | ||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the open tag.
docs/book/v3/quick-start.md
Outdated
interface HydratorInterface extends | ||
ExtractionInterface, | ||
HydrationInterface | ||
use Laminas\Hydrator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same like before, the namespace is used only once therefore it can be reduced on one line.
@settermjd |
The intent here isn't to make this in to a marketing piece, rather to provide a succinct, yet also sufficiently descriptive snapshot overview/introduction to what laminas-hydrator is. It's aimed at people who are seeing the package/component for the first time and need to quickly know what it is. I hope that this change does that, and gives them incentive to delve deeper. Signed-off-by: Matthew Setter <[email protected]>
The intent of this change is to make the content far more accessible to first time readers. The changes include: 1. Update the introductory content to build upon the core description in index.md. This time, the user is a step deeper, and seeking to learn more. So this description takes them that bit deeper, providing them quick and easy access to the next level down in to the component. 2. As they're still new to the package, it brings the usage section right up near the top, so that they can get a sample of how the package works and what they can expect. 3. It moves the available implementations to after the usage section, simplifies the headers and descriptions of each one, and adds a usage example for any that don't have one. The reason for this is that, to me, using the FQN as the section header is redundant and too verbose. The descriptions were reworked to read a little more like a narrative, yet still maintain the focus of a core documentation guide. I tried hard to make the text flow, yet still be active and to the point. There should be usage examples for each one, as you can never be sure which one the user may be most interested in, which one they need, and for completeness sake. I also sorted the hydrators in to what seemed to be the most applicable order of complexity, from the most basic to the most advanced. Signed-off-by: Matthew Setter <[email protected]>
Signed-off-by: Matthew Setter <[email protected]>
Signed-off-by: Matthew Setter <[email protected]>
Signed-off-by: Matthew Setter <[email protected]>
Signed-off-by: Matthew Setter <[email protected]>
Signed-off-by: Matthew Setter <[email protected]>
6b1de29
to
e931241
Compare
This patch incorporates feedback as provided by @froschdesign. Signed-off-by: Matthew Weier O'Phinney <[email protected]>
Description
This intent of this PR isn't to turn the documentation into a marketing piece, rather ensure that it is a succinct, yet also sufficiently descriptive, introduction to what laminas-hydrator is. It's aimed at helping people who are seeing the package/component for the first time and need to quickly know what it is, and what they can do with it, and gives
them an incentive to delve deeper.
It:
I need to check the usage examples for accuracy. After that, I'll remove the draft status.