Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed May 7, 2016
1 parent a5d2a67 commit 1e621e0
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 49 deletions.
38 changes: 19 additions & 19 deletions doc/getting_started/controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ annotations.
* @Incoming(schema="PSX\Project\Model\Song")
* @Outgoing(code=201, schema="PSX\Project\Model\Message")
*/
protected function doPost(RecordInterface $record)
protected function doPost($record)
{
// @TODO work with the record
Expand All @@ -57,7 +57,7 @@ annotations.
The schema must be either a simple POPO class which contains annotations to
describe the schema or a json schema file. The model class
`PSX\Project\Model\Song` could look like:
`PSX\\Project\\Model\\Song` could look like:

.. code-block:: php
Expand Down Expand Up @@ -103,23 +103,23 @@ describe the schema or a json schema file. The model class
More informations at the psx schema project. The following annotations are
available for the controller:

+--------------+--------------+------------------------------------------------------+
| Annotation | Target | Example |
+==============+==============+======================================================+
| @Description | Class/Method | @Description("Bar") |
+--------------+--------------+------------------------------------------------------+
| @Exclude | Method | @Exclude |
+--------------+--------------+------------------------------------------------------+
| @Incoming | Method | @Incoming(schema="PSX\Project\Model\Song") |
+--------------+--------------+------------------------------------------------------+
| @Outgoing | Method | @Outgoing(code=200, schema="PSX\Project\Model\Song") |
+--------------+--------------+------------------------------------------------------+
| @PathParam | Class | @PathParam(name="foo", type="integer") |
+--------------+--------------+------------------------------------------------------+
| @QueryParam | Method | @QueryParam(name="bar", type="integer") |
+--------------+--------------+------------------------------------------------------+
| @Title | Class/Method | @Title("Foo") |
+--------------+--------------+------------------------------------------------------+
+--------------+--------------+---------------------------------------------------------+
| Annotation | Target | Example |
+==============+==============+=========================================================+
| @Description | Class/Method | @Description("Bar") |
+--------------+--------------+---------------------------------------------------------+
| @Exclude | Method | @Exclude |
+--------------+--------------+---------------------------------------------------------+
| @Incoming | Method | @Incoming(schema="PSX\\Project\\Model\\Song") |
+--------------+--------------+---------------------------------------------------------+
| @Outgoing | Method | @Outgoing(code=200, schema="PSX\\Project\\Model\\Song") |
+--------------+--------------+---------------------------------------------------------+
| @PathParam | Class | @PathParam(name="foo", type="integer") |
+--------------+--------------+---------------------------------------------------------+
| @QueryParam | Method | @QueryParam(name="bar", type="integer") |
+--------------+--------------+---------------------------------------------------------+
| @Title | Class/Method | @Title("Foo") |
+--------------+--------------+---------------------------------------------------------+

RAML
----
Expand Down
4 changes: 2 additions & 2 deletions doc/getting_started/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ example route entry:
GET|POST|PUT|DELETE /foo/bar Acme\Api\News\Endpoint
This would invoke the class `Acme\Api\News\Endpoint` if you visit the route
This would invoke the class `Acme\\Api\\News\\Endpoint` if you visit the route
`/foo/bar`. All controller classes must extend the class
`PSX\Framework\Controller\ControllerAbstract`
`PSX\\Framework\\Controller\\ControllerAbstract`

Webserver
---------
Expand Down
40 changes: 21 additions & 19 deletions doc/getting_started/service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ business logic of our API endpoint.
Definition
----------

> Put simply, a Service is any PHP object that performs some sort of "global"
> task. It's a purposefully-generic name used in computer science to describe an
> object that's created for a specific purpose (e.g. delivering emails). Each
> service is used throughout your application whenever you need the specific
> functionality it provides. You don't have to do anything special to make a
> service: simply write a PHP class with some code that accomplishes a specific
> task. Congratulations, you've just created a service!
>
> So what's the big deal then? The advantage of thinking about "services" is
> that you begin to think about separating each piece of functionality in your
> application into a series of services. Since each service does just one job,
> you can easily access each service and use its functionality wherever you need
> it. Each service can also be more easily tested and configured since it's
> separated from the other functionality in your application. This idea is
> called service-oriented architecture and is not unique to Symfony or even PHP.
> Structuring your application around a set of independent service classes is a
> well-known and trusted object-oriented best-practice. These skills are key to
> being a good developer in almost any language.
Put simply, a Service is any PHP object that performs some sort of "global"
task. It's a purposefully-generic name used in computer science to describe an
object that's created for a specific purpose (e.g. delivering emails). Each
service is used throughout your application whenever you need the specific
functionality it provides. You don't have to do anything special to make a
service: simply write a PHP class with some code that accomplishes a specific
task. Congratulations, you've just created a service!
So what's the big deal then? The advantage of thinking about "services" is
that you begin to think about separating each piece of functionality in your
application into a series of services. Since each service does just one job,
you can easily access each service and use its functionality wherever you need
it. Each service can also be more easily tested and configured since it's
separated from the other functionality in your application. This idea is
called service-oriented architecture and is not unique to Symfony or even PHP.
Structuring your application around a set of independent service classes is a
well-known and trusted object-oriented best-practice. These skills are key to
being a good developer in almost any language.

This description was copied from the symfony documentation [#f1]_

Expand Down Expand Up @@ -98,7 +98,9 @@ Register
^^^^^^^^

In order to add a new service to the DI container you have to add a method to
the container class. In the following an example which creates a new service:
the container class. In the sample porject the container class is located at
`src/Sample/Dependency/Container.php`. In the following an example which creates
a new service:

.. code-block:: php
Expand Down
18 changes: 9 additions & 9 deletions doc/getting_started/tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ change the style according to your needs.

.. code::
GET /doc PSX\Controller\Tool\DocumentationController::doIndex
GET /doc/:version/*path PSX\Controller\Tool\DocumentationController::doDetail
GET /doc PSX\Framework\Controller\Tool\DocumentationController::doIndex
GET /doc/:version/*path PSX\Framework\Controller\Tool\DocumentationController::doDetail
WSDL
----
Expand All @@ -30,8 +30,8 @@ Generates a WSDL representation for the given API.

.. code::
GET /wsdl/:version/*path PSX\Controller\Tool\WsdlGeneratorController
GET /soap PSX\Controller\Tool\SoapProxyController
GET /wsdl/:version/*path PSX\Framework\Controller\Generator\WsdlController
ANY /soap PSX\Framework\Controller\Proxy\SoapController
Swagger
-------
Expand All @@ -40,8 +40,8 @@ Generates a Swagger resource listing and definition.

.. code::
GET /swagger PSX\Controller\Tool\SwaggerGeneratorController::doIndex
GET /swagger/:version/*path PSX\Controller\Tool\SwaggerGeneratorController::doDetail
GET /swagger PSX\Framework\Controller\Generator\SwaggerController::doIndex
GET /swagger/:version/*path PSX\Framework\Controller\Generator\SwaggerController::doDetail
RAML
----
Expand All @@ -50,13 +50,13 @@ Generates a RAML representation for the given API.

.. code::
GET /raml/:version/*path PSX\Controller\Tool\RamlGeneratorController
GET /raml/:version/*path PSX\Framework\Controller\Generator\RamlController
Routing
-------

Provides an API to publish all available API paths
Provides an API to publish all available API paths.

.. code::
GET /routing PSX\Controller\Tool\RoutingController
GET /routing PSX\Framework\Controller\Tool\RoutingController

0 comments on commit 1e621e0

Please sign in to comment.