Skip to content
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

Merged

Conversation

settermjd
Copy link
Contributor

@settermjd settermjd commented Sep 16, 2020

Q A
Documentation yes
Bugfix no
BC Break no
New Feature no
RFC no
QA no

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:

  1. Updates the package description to provide a more thorough introduction to the package
  2. Reworks the Quick Start guide as follows:
  • Updates 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 into the component.
  • 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.
  • 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 into what seemed to be the most applicable order of complexity, from the most basic to the most advanced.

I need to check the usage examples for accuracy. After that, I'll remove the draft status.

Copy link
Member

@froschdesign froschdesign left a 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.

docs/book/index.html Outdated Show resolved Hide resolved
docs/book/v3/quick-start.md Outdated Show resolved Hide resolved
docs/book/v3/quick-start.md Outdated Show resolved Hide resolved
docs/book/v3/quick-start.md Outdated Show resolved Hide resolved
docs/book/v3/quick-start.md Outdated Show resolved Hide resolved
docs/book/v3/quick-start.md Outdated Show resolved Hide resolved
docs/book/v3/quick-start.md Outdated Show resolved Hide resolved
docs/book/v3/quick-start.md Show resolved Hide resolved
mkdocs.yml Outdated Show resolved Hide resolved
docs/book/v3/quick-start.md Outdated Show resolved Hide resolved
@settermjd settermjd marked this pull request as ready for review September 21, 2020 17:10
@settermjd settermjd force-pushed the update-index-and-quick-start-guide branch from 7238913 to 6b1de29 Compare September 22, 2020 18:01
@settermjd
Copy link
Contributor Author

@froschdesign, what do you think of the state of the PR as it currently stands?

Copy link
Member

@froschdesign froschdesign left a 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.",
Copy link
Member

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.

Comment on lines 14 to 16
use Laminas\Hydrator;

interface ExtractionInterface
{
/**
* Extract values from an object
*
* @return mixed[]
*/
public function extract(object $object) : array;
}
$hydrator = new Hydrator\ArraySerializableHydrator();
Copy link
Member

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();

Comment on lines 33 to 35
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();
Copy link
Member

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();


```php
namespace Laminas\Hydrator;
<?php
Copy link
Member

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.

interface HydratorInterface extends
ExtractionInterface,
HydrationInterface
use Laminas\Hydrator;
Copy link
Member

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.

docs/book/v3/quick-start.md Outdated Show resolved Hide resolved
docs/book/v3/quick-start.md Outdated Show resolved Hide resolved
docs/book/v3/quick-start.md Outdated Show resolved Hide resolved
docs/book/v3/quick-start.md Outdated Show resolved Hide resolved
mkdocs.yml Outdated Show resolved Hide resolved
@froschdesign
Copy link
Member

@settermjd
I added all open tasks to a project: https://github.com/laminas/laminas-hydrator/projects/1

@weierophinney weierophinney changed the base branch from 3.2.x to 3.1.x October 6, 2020 14:43
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]>
@weierophinney weierophinney force-pushed the update-index-and-quick-start-guide branch from 6b1de29 to e931241 Compare October 6, 2020 14:45
@weierophinney weierophinney added this to the 3.1.1 milestone Oct 6, 2020
This patch incorporates feedback as provided by @froschdesign.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
@weierophinney weierophinney merged commit 05f0492 into laminas:3.1.x Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants