Skip to content

Collection of fixes: Typos, Formatting, Logic, Links #3173

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

Merged
merged 5 commits into from
Nov 12, 2013
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/dependency_injection/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Synthetic services are services that are injected into the container instead
of being created by the container.

For example, if you're using the :doc:`HttpKernel </components/http_kernel/introduction>`
component with the DependencyInjection component, then the ``request``
component with the Dependency Injection component, then the ``request``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the only usage of this notation without space in the docs vs. five time with space (for usage as component name only, i.e. without the design pattern context).

I also found that some other component names are used inconsistently, e.g. we have:

  • EventDispatcher vs. Event Dispatcher
  • HttpKernel vs. HTTP Kernel
  • ClassLoader vs. Class Loader
  • etc.

For instance, in the TOC it says Class Loader, then The Class Loader component and then elsewhere When using the ClassLoader component.... You can find similiar examples for the other components. Maybe it's okay to say "Class Loader" when not directly refering to the component (e.g. in the main heading in the TOC), because it refers to a Class Loader in general. But when used in the context of a Symfony component it should be either ClassLoader component or Class Loader component everywhere.

In addition I found Swift Mailer vs. Swiftmailer - but even the Swift Mailer docs itself does not agree upon this - but Swift Mailer seems to be on the majority there - except for the logo ;-)

If we aggree on a notation I can update the docs if you like.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use this page as the standard :) - http://symfony.com/components

So, call the components by their actual, "code" name. I'd be happy to have things consistent around that standard.

Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the "code" name. I will update as much as I can find soon. I think I should pay attention to places where it it used in the "general" sense as e.g. the "Dependecy Injection pattern" etc.

What do you think about "Swift Mailer" as the "official" name?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's Swift Mailer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated to "Swift Mailer" notation and also fixed some literal notations of Swiftmailer to Swift Mailer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reverted the "DependencyInjection" to "Dependency Injection" change.

I think updating to consistent component names should be done in a separate PR because it's a lot of changes and so it would be hard to read if it's mixed with the other changes here. I also found an inconsistency in SomeComponent component vs. SomeComponent Component (not only in the headings). What do you prefer?

If this PR is ok now, please feel free to merge 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Headlines: capitalized component
Normal text: lowercase component

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with that, I'll provide a new PR soon.

service is injected in the
:method:`ContainerAwareHttpKernel::handle() <Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel::handle>`
method when entering the request :doc:`scope </cookbook/service_container/scopes>`.
Expand Down
4 changes: 2 additions & 2 deletions components/dependency_injection/compilation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ It is compiled by running::

$container->compile();

The compile method uses *Compiler Passes* for the compilation. The *Dependency Injection*
The compile method uses *Compiler Passes* for the compilation. The Dependency Injection
component comes with several passes which are automatically registered for
compilation. For example the :class:`Symfony\\Component\\DependencyInjection\\Compiler\\CheckDefinitionValidityPass`
checks for various potential issues with the definitions that have been set
Expand All @@ -40,7 +40,7 @@ and can be registered with the container with::

$container->registerExtension($extension);

The main work of the extension is done in the ``load`` method. In the load method
The main work of the extension is done in the ``load`` method. In the ``load`` method
you can load configuration from one or more configuration files as well as
manipulate the container definitions using the methods shown in :doc:`/components/dependency_injection/definitions`.

Expand Down
4 changes: 2 additions & 2 deletions components/dependency_injection/definitions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ You can add a new argument to the end of the arguments array using::
$definition->addArgument($argument);

The argument can be a string, an array, a service parameter by using ``%parameter_name%``
or a service id by using ::
or a service id by using::

use Symfony\Component\DependencyInjection\Reference;

Expand Down Expand Up @@ -122,6 +122,6 @@ You can also replace any existing method calls with an array of new ones with::
.. note::

The methods here that change service definitions can only be used before
the container is compiled, once the container is compiled you cannot
the container is compiled. Once the container is compiled you cannot
manipulate service definitions further. To learn more about compiling
the container see :doc:`/components/dependency_injection/compilation`.
2 changes: 1 addition & 1 deletion components/dependency_injection/factories.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ For this situation, you can use a factory to create the object and tell the
service container to call a method on the factory rather than directly instantiating
the class.

Suppose you have a factory that configures and returns a new NewsletterManager
Suppose you have a factory that configures and returns a new ``NewsletterManager``
object::

class NewsletterFactory
Expand Down
6 changes: 3 additions & 3 deletions components/dependency_injection/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ One use for this is to inject the values into your services. This allows
you to configure different versions of services between applications or multiple
services based on the same class but configured differently within a single
application. You could inject the choice of mail transport into the ``Mailer``
class directly but by making it a parameter. This makes it easier to change
class directly. But declaring it as a parameter makes it easier to change
rather than being tied up and hidden with the service definition:

.. configuration-block::
Expand Down Expand Up @@ -343,7 +343,7 @@ Start the string with ``@`` or ``@?`` to reference a service in Yaml.
converted into the string ``"@mailer"`` instead of referencing the
``mailer`` service.

Xml
XML
~~~

In XML, use the ``service`` type. The behavior if the service does not exist
Expand All @@ -352,7 +352,7 @@ is thrown. Valid values for ``on-invalid`` are ``null`` (uses ``null`` in place
of the missing service) or ``ignored`` (very similar, except if used on a
method call, the method call is removed).

Php
PHP
~~~

In PHP, you can use the
Expand Down
4 changes: 2 additions & 2 deletions components/dependency_injection/tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ To begin with, define the ``TransportChain`` class::
$this->transports = array();
}

public function addTransport(\Swift_Transport $transport)
public function addTransport(\Swift_Transport $transport)
{
$this->transports[] = $transport;
}
Expand Down Expand Up @@ -176,7 +176,7 @@ Adding additional attributes on Tags
------------------------------------

Sometimes you need additional information about each service that's tagged with your tag.
For example, you might want to add an alias to each TransportChain.
For example, you might want to add an alias to each member of the transport chain.

To begin with, change the ``TransportChain`` class::

Expand Down
2 changes: 1 addition & 1 deletion components/event_dispatcher/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ Or::

Or::

$response = $dispatcher->dispatch('bar.event', new BarEvent())->getBar();
$bar = $dispatcher->dispatch('bar.event', new BarEvent())->getBar();

and so on...

Expand Down
6 changes: 3 additions & 3 deletions components/form/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,12 @@ and then access it whenever you need to build a form.

.. note::

In this document, the form factory is always a locally variable called
In this document, the form factory is always a local variable called
``$formFactory``. The point here is that you will probably need to create
this object in some more "global" way so you can access it from anywhere.

Exactly how you gain access to your one form factory is up to you. If you're
using a :term`Service Container`, then you should add the form factory to
using a :term:`Service Container`, then you should add the form factory to
your container and grab it out whenever you need to. If your application
uses global or static variables (not usually a good idea), then you can store
the object on some static class or do something similar.
Expand Down Expand Up @@ -414,7 +414,7 @@ it and :ref:`process the form submission <component-form-intro-handling-submissi
Setting Default Values
~~~~~~~~~~~~~~~~~~~~~~

If you need you form to load with some default values (or you're building
If you need your form to load with some default values (or you're building
an "edit" form), simply pass in the default data when creating your form
builder:

Expand Down
6 changes: 3 additions & 3 deletions components/http_foundation/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ can be accessed via several public properties:

* ``cookies``: equivalent of ``$_COOKIE``;

* ``attributes``: no equivalent - used by your app to store other data (see :ref:`below <component-foundation-attributes>`)
* ``attributes``: no equivalent - used by your app to store other data (see :ref:`below <component-foundation-attributes>`);

* ``files``: equivalent of ``$_FILES``;

Expand Down Expand Up @@ -109,7 +109,7 @@ methods to retrieve and update its data:
parameter by name;

* :method:`Symfony\\Component\\HttpFoundation\\ParameterBag::has`: Returns
true if the parameter is defined;
``true`` if the parameter is defined;

* :method:`Symfony\\Component\\HttpFoundation\\ParameterBag::remove`: Removes
a parameter.
Expand Down Expand Up @@ -461,7 +461,7 @@ whether or not the ``X-Sendfile-Type`` header should be trusted and call
:method:`Symfony\\Component\\HttpFoundation\\BinaryFileResponse::trustXSendfileTypeHeader`
if it should::

$response::trustXSendfileTypeHeader();
BinaryFileResponse::trustXSendfileTypeHeader();

You can still set the ``Content-Type`` of the sent file, or change its ``Content-Disposition``::

Expand Down
10 changes: 5 additions & 5 deletions components/http_foundation/session_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ be securely controlled from the server side.

The ``cookie_lifetime`` setting is the number of seconds the cookie should live
for, it is not a Unix timestamp. The resulting session cookie will be stamped
with an expiry time of ``time()``+``cookie_lifetime`` where the time is taken
with an expiry time of ``time()`` + ``cookie_lifetime`` where the time is taken
from the server.

Configuring Garbage Collection
Expand All @@ -132,7 +132,7 @@ of 5%. Similarly, ``3/4`` would mean a 3 in 4 chance of being called, i.e. 75%.

If the garbage collection handler is invoked, PHP will pass the value stored in
the ``php.ini`` directive ``session.gc_maxlifetime``. The meaning in this context is
that any stored session that was saved more than ``maxlifetime`` ago should be
that any stored session that was saved more than ``gc_maxlifetime`` ago should be
deleted. This allows one to expire records based on idle time.

You can configure these settings by passing ``gc_probability``, ``gc_divisor``
Expand Down Expand Up @@ -173,8 +173,8 @@ example, it is common for banking applications to log the user out after just
5 to 10 minutes of inactivity. Setting the cookie lifetime here is not
appropriate because that can be manipulated by the client, so we must do the expiry
on the server side. The easiest way is to implement this via garbage collection
which runs reasonably frequently. The cookie ``lifetime`` would be set to a
relatively high value, and the garbage collection ``maxlifetime`` would be set
which runs reasonably frequently. The ``cookie_lifetime`` would be set to a
relatively high value, and the garbage collection ``gc_maxlifetime`` would be set
to destroy sessions at whatever the desired idle period is.

The other option is to specifically checking if a session has expired after the
Expand Down Expand Up @@ -258,7 +258,7 @@ without knowledge of the specific save handler.

.. note::

Before PHP 5.4, you can only proxy user-land save handlers but not
Before PHP 5.4, you can only proxy user-land save handlers but not
native PHP save handlers.

.. _`php.net/session.customhandler`: http://php.net/session.customhandler
Expand Down
2 changes: 1 addition & 1 deletion components/http_foundation/session_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ starting one allowing you to test your code without complications. You may also
run multiple instances in the same PHP process.

The mock storage drivers do not read or write the system globals
`session_id()` or `session_name()`. Methods are provided to simulate this if
``session_id()`` or ``session_name()``. Methods are provided to simulate this if
required:

* :method:`Symfony\\Component\\HttpFoundation\\Session\\SessionStorageInterface::getId`: Gets the
Expand Down
24 changes: 12 additions & 12 deletions components/http_foundation/sessions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,24 @@ as follows divided into a couple of groups.
Session workflow

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::start`:
Starts the session - do not use ``session_start()``.
Starts the session - do not use ``session_start()``;

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::migrate`:
Regenerates the session ID - do not use ``session_regenerate_id()``.
This method can optionally change the lifetime of the new cookie that will
be emitted by calling this method.
be emitted by calling this method;

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::invalidate`:
Clears all session data and regenerates session ID. Do not use ``session_destroy()``.
Clears all session data and regenerates session ID. Do not use ``session_destroy()``;

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::getId`: Gets the
session ID. Do not use ``session_id()``.
session ID. Do not use ``session_id()``;

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::setId`: Sets the
session ID. Do not use ``session_id()``.
session ID. Do not use ``session_id()``;

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::getName`: Gets the
session name. Do not use ``session_name()``.
session name. Do not use ``session_name()``;

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::setName`: Sets the
session name. Do not use ``session_name()``.
Expand All @@ -103,23 +103,23 @@ Session attributes
Returns true if the attribute exists;

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::replace`:
Sets multiple attributes at once: takes a keyed array and sets each key => value pair.
Sets multiple attributes at once: takes a keyed array and sets each key => value pair;

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::remove`:
Deletes an attribute by key;

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::clear`:
Clear all attributes;
Clear all attributes.

The attributes are stored internally in an "Bag", a PHP object that acts like
an array. A few methods exist for "Bag" management:

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::registerBag`:
Registers a :class:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface`
Registers a :class:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface`;

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::getBag`:
Gets a :class:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface` by
bag name.
bag name;

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::getFlashBag`:
Gets the :class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface`.
Expand Down Expand Up @@ -242,7 +242,7 @@ would be displayed immediately on the subsequent page load for that session.
This is however just one application for flash messages.

* :class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\AutoExpireFlashBag`
This implementation messages set in one page-load will
In this implementation, messages set in one page-load will
be available for display only on the next page load. These messages will auto
expire regardless of if they are retrieved or not.

Expand Down Expand Up @@ -306,7 +306,7 @@ Examples of setting multiple flashes::
$session->getFlashBag()->add('error', 'Failed to update name');
$session->getFlashBag()->add('error', 'Another error');

Displaying the flash messages might look like this:
Displaying the flash messages might look as follows.

Simple, display one type of message::

Expand Down
4 changes: 2 additions & 2 deletions components/http_kernel/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ listeners to the events discussed below::
// by dispatching events, calling a controller, and returning the response
$response = $kernel->handle($request);

// echo the content and send the headers
// send the headers and echo the content
$response->send();

// triggers the kernel.terminate event
Expand Down Expand Up @@ -464,7 +464,7 @@ because it occurs *after* the ``HttpKernel::handle`` method, and after the
response is sent to the user. Recall from above, then the code that uses
the kernel, ends like this::

// echo the content and send the headers
// send the headers and echo the content
$response->send();

// triggers the kernel.terminate event
Expand Down
2 changes: 1 addition & 1 deletion cookbook/controller/error_pages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ end-user, create a new template located at
.. tip::

If you're not familiar with Twig, don't worry. Twig is a simple, powerful
and optional templating engine that integrates with ``Symfony2``. For more
and optional templating engine that integrates with Symfony2. For more
information about Twig see :doc:`/book/templating`.

In addition to the standard HTML error page, Symfony provides a default error
Expand Down
2 changes: 1 addition & 1 deletion cookbook/deployment-tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ B) Update your vendors
Your vendors can be updated before transferring your source code (i.e.
update the ``vendor/`` directory, then transfer that with your source
code) or afterwards on the server. Either way, just update your vendors
as your normally do:
as you normally do:

.. code-block:: bash

Expand Down
2 changes: 1 addition & 1 deletion cookbook/templating/PHP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Now, let's have a look at the ``layout.html.php`` file:
The layout is itself decorated by another one (``::base.html.php``). Symfony2
supports multiple decoration levels: a layout can itself be decorated by
another one. When the bundle part of the template name is empty, views are
looked for in the ``app/Resources/views/`` directory. This directory store
looked for in the ``app/Resources/views/`` directory. This directory stores
global views for your entire project:

.. code-block:: html+php
Expand Down