Skip to content

[WCM] Document constraint validator alias made optional #5952

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

Closed
wants to merge 143 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
1a587c5
Added February changelog
wouterj Mar 1, 2015
653ac94
fix changelog syntax
xabbuh Mar 2, 2015
515e87c
Merge branch '2.7'
weaverryan Mar 2, 2015
a2395ef
minor #5054 [Changelog] fix changelog syntax (xabbuh)
weaverryan Mar 2, 2015
feb621b
Merge branch '2.7'
weaverryan Mar 13, 2015
f24c84f
Merge branch '2.7'
weaverryan Mar 14, 2015
3fb0d42
Merge branch '2.7'
weaverryan Mar 15, 2015
7681e39
Merge branch '2.7'
weaverryan Mar 24, 2015
5dd50f5
Merge branch '2.7'
wouterj Apr 2, 2015
392398b
Merge branch '2.7'
wouterj Apr 4, 2015
56fe069
Merge branch '2.7'
wouterj Apr 5, 2015
e84182d
Added March changelog
wouterj Apr 5, 2015
c4e07cc
Merge branch '2.7'
wouterj Apr 7, 2015
2e86186
Merge branch '2.8'
weaverryan Apr 15, 2015
b74593c
Merge branch '2.8'
weaverryan Apr 17, 2015
701f2cf
Merge branch '2.8'
wouterj Apr 26, 2015
f0429d7
Merge branch '2.8'
weaverryan Apr 27, 2015
83636f0
Merge branch '2.8'
wouterj May 2, 2015
041b2af
Merge branch '2.8'
wouterj May 2, 2015
643f4c4
Merge branch '2.8'
wouterj May 2, 2015
c1cbb9a
Merge branch '2.8'
weaverryan May 3, 2015
de9b3d5
Merge branch '2.8'
wouterj May 10, 2015
25c9705
Merge branch '2.8'
wouterj May 17, 2015
12d8531
Merge branch '2.8'
weaverryan May 22, 2015
c2b92e1
Merge branch '2.8'
wouterj May 23, 2015
2d64dd5
Merge branch '2.8'
weaverryan May 23, 2015
7cadcdc
Merge branch '2.8'
wouterj May 24, 2015
c3fd4f5
Merge branch '2.8'
wouterj May 24, 2015
68f51df
Merge branch '2.8'
weaverryan May 25, 2015
0c089ec
Update create_form_type_extension.rst
May 28, 2015
78bab15
Merge branch '2.8'
weaverryan May 29, 2015
ed88e1c
bug #5328 Update create_form_type_extension.rst (jackdelin)
wouterj May 31, 2015
d6c5d5b
Merge branch '2.8'
wouterj May 31, 2015
6a9a26a
Merge branch '2.8'
wouterj May 31, 2015
f78cab7
Merge branch '2.8'
wouterj May 31, 2015
078bb2d
Merge branch '2.8'
wouterj Jun 7, 2015
d01d7ab
Remove deprecated parameters
norkunas Jun 10, 2015
a68ff44
Merge branch '2.8'
weaverryan Jun 19, 2015
41d1733
Merge branch '2.8'
weaverryan Jun 19, 2015
2d430dc
Merge branch '2.8'
wouterj Jun 20, 2015
cc87822
Merge branch '2.8'
weaverryan Jun 28, 2015
0ef7e1a
Merge branch '2.8'
weaverryan Jun 28, 2015
e08724e
Merge branch '2.8'
weaverryan Jun 30, 2015
7d6737b
Merge branch '2.8'
wouterj Jul 1, 2015
3cdbc7c
Merge branch '2.8'
weaverryan Jul 2, 2015
b3a32af
Merge branch '2.8'
xabbuh Jul 2, 2015
11237e7
Merge branch '2.8'
xabbuh Jul 6, 2015
6cc3445
Merge branch '2.7'
weaverryan Jul 7, 2015
3244eed
Merge branch '2.8'
weaverryan Jul 8, 2015
2bb0d16
Merge branch '2.8'
weaverryan Jul 12, 2015
55a841d
Merge branch '2.8'
weaverryan Jul 15, 2015
2c6aa2f
Merge branch '2.8'
weaverryan Jul 15, 2015
b77b148
Merge branch '2.8'
weaverryan Jul 16, 2015
e166d69
Merge branch '2.8'
weaverryan Jul 16, 2015
6603c33
Merge branch '2.8'
xabbuh Jul 17, 2015
2a30c19
Merge branch '2.8'
wouterj Jul 23, 2015
7711e97
Merge branch '2.8'
xabbuh Jul 23, 2015
14b39c3
Merge branch '2.8'
wouterj Jul 28, 2015
489adc2
Merge branch '2.8'
wouterj Jul 28, 2015
dc93af2
Merge branch '2.8'
wouterj Jul 28, 2015
fceaa9f
feature #5374 Remove deprecated parameters (norkunas)
wouterj Jul 28, 2015
ee7f14f
Merge branch '2.8'
weaverryan Aug 8, 2015
8a2205c
Merge branch '2.8'
wouterj Aug 9, 2015
135d4b8
Added July changelog
wouterj Aug 9, 2015
e0a8dfe
Merge branch '2.8'
wouterj Aug 12, 2015
6fc096e
Merge branch '2.8'
xabbuh Aug 18, 2015
b25b9e5
Merge branch '2.8'
xabbuh Aug 19, 2015
feb2ab1
Remove mentions of Symfony1
wouterj Jul 29, 2015
a991ea1
Merge branch '2.8'
weaverryan Aug 21, 2015
26ca438
minor #5579 [3.0] Remove mentions of Symfony1 (WouterJ)
wouterj Aug 22, 2015
7eaf928
Merge branch '2.8'
wouterj Aug 23, 2015
a30b0fa
Merge branch '2.8'
weaverryan Aug 28, 2015
1941e85
[#5480] Adding missing map entry (added 2 so it's easier to find)
weaverryan Aug 28, 2015
3a4e8ca
Merge branch '2.8'
weaverryan Aug 28, 2015
7c926c6
Merge branch '2.8'
wouterj Sep 1, 2015
bb2f991
Added August changelog
wouterj Sep 1, 2015
9f8d766
Merge branch '2.8'
weaverryan Sep 2, 2015
b1ba29d
Merge branch '2.8'
wouterj Sep 5, 2015
fbc7a8a
Merge branch '2.8'
xabbuh Sep 23, 2015
a46560c
Merge branch '2.8'
xabbuh Sep 23, 2015
194f5cc
Merge branch '2.8'
xabbuh Sep 24, 2015
1b91720
Merge branch '2.8'
xabbuh Oct 3, 2015
0e3f25b
Merge branch '2.8'
xabbuh Oct 8, 2015
46096d3
Merge branch '2.8'
wouterj Oct 11, 2015
b13593e
Merge branch '2.8'
xabbuh Oct 12, 2015
a0b06ae
Merge remote-tracking branch 'origin/master'
weaverryan Oct 14, 2015
9569e2d
Merge branch '2.8'
weaverryan Oct 15, 2015
b785d35
Merge branch '2.8'
weaverryan Oct 15, 2015
71d51f8
Merge branch '2.8'
xabbuh Oct 17, 2015
d7ae2a0
Merge branch '2.8'
xabbuh Oct 19, 2015
d8db51a
Merge branch '2.8'
xabbuh Nov 1, 2015
8465e85
Merge branch '2.8'
xabbuh Nov 5, 2015
267e898
Merge branch '2.8'
xabbuh Nov 8, 2015
af97ce1
Merge branch '2.8'
xabbuh Nov 26, 2015
8794a4d
app/console -> bin/console
wouterj Nov 28, 2015
1461bdc
app/phpunit.xml.dist -> phpunit.xml.dist
wouterj Nov 28, 2015
3318f2e
app/(cache|logs) -> var/(cache|logs)
wouterj Nov 28, 2015
6b5c977
app/bootstrap.php.cache -> var/bootstrap.php.cache
wouterj Nov 28, 2015
0d69414
Updating 'Exploring the Project'
wouterj Nov 28, 2015
ed43015
Prefix commands with 'php'
wouterj Nov 28, 2015
215c36d
[BestPractices] Use new directory structure
wouterj Nov 28, 2015
c6d436b
[QuickTour] Use new directory structure
wouterj Nov 28, 2015
bea4a0c
app/console -> bin/console
wouterj Nov 28, 2015
b6d93f0
app/phpunit.xml.dist -> phpunit.xml.dist
wouterj Nov 28, 2015
b3da3b7
app/cache -> var/cache
wouterj Nov 28, 2015
6614c0f
app/logs -> var/logs
wouterj Nov 28, 2015
af7052b
app/bootstrap.php.cache -> var/bootstrap.php.cache
wouterj Nov 28, 2015
ef613f6
app/SymfonyRequirements.php -> bin/SymfonyRequirements.php
wouterj Nov 28, 2015
df20095
Testing changes
wouterj Nov 28, 2015
f2be12a
Updated directory structures
wouterj Nov 28, 2015
47e11f8
Applied comments
wouterj Nov 28, 2015
25ae8c1
Applied suggestions
wouterj Nov 28, 2015
7bb2785
Merge branch '2.8'
weaverryan Nov 30, 2015
35ae50c
Merge branch '2.8'
weaverryan Nov 30, 2015
81c7572
Removed scopes article
wouterj Nov 28, 2015
eff9733
removing more scope stuff
weaverryan Nov 30, 2015
1a27539
removing scope reference
weaverryan Nov 30, 2015
2daccc3
Merge branch '2.8'
weaverryan Nov 30, 2015
dbf0d31
feature #5913 [3.0][Book] Use the 3.0 directory structure (WouterJ)
weaverryan Nov 30, 2015
8236647
feature #5916 [3.0][Best Practices][Quick Tour] Use the 3.0 directory…
weaverryan Nov 30, 2015
89f4d25
feature #5917 [3.0][Cookbook] Use the 3.0 directory structure (WouterJ)
weaverryan Nov 30, 2015
0e53bb5
[#5917] Adding bin
weaverryan Nov 30, 2015
3083e90
[#5917] Finding some more places with the old directory structure ref…
weaverryan Nov 30, 2015
d577848
Update docs accordingly to min PHP version requirement
ogizanagi Dec 3, 2015
7a64f05
feature #5948 Update 3.0 docs accordingly to min PHP version requirem…
wouterj Dec 5, 2015
8c17033
[#5948] Very minor detail
wouterj Dec 5, 2015
8d21262
Merge branch '2.8' into 3.0
xabbuh Dec 9, 2015
dcde292
Merge branch '2.8' into 3.0
xabbuh Dec 9, 2015
7d922b9
[#5956] change app/console back to bin/console
xabbuh Dec 9, 2015
bf48c59
Merge branch '2.8' into 3.0
xabbuh Dec 9, 2015
e19f7a1
[#5957] remove deep parameter documentation
xabbuh Dec 9, 2015
55a015e
Merge branch '2.8' into 3.0
wouterj Dec 12, 2015
276aa1f
Added october and november changelog
wouterj Dec 12, 2015
744bed4
Merge branch '2.8' into 3.0
wouterj Dec 12, 2015
3ad7f26
Merge branch '2.8' into 3.0
weaverryan Dec 13, 2015
7c60ea1
Merge branch '2.8' into 3.0
xabbuh Dec 17, 2015
a7effb8
Fix #6037
zsturgess Dec 17, 2015
a6ed958
minor #6038 Fix #6037 (zsturgess)
xabbuh Dec 17, 2015
4cd6dc2
Merge branch '2.8' into 3.0
wouterj Dec 18, 2015
bfc54c6
Merge branch '2.8' into 3.0
wouterj Dec 18, 2015
786096e
Update Symfony version to 3.0
wouterj Dec 18, 2015
3b2939f
Update Symfony version to 3.1
wouterj Dec 18, 2015
d5a2c06
Document constraint validator alias optional
Dec 5, 2015
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
6 changes: 5 additions & 1 deletion best_practices/business-logic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Inside here, you can create whatever directories you want to organize things:
│ └─ AppBundle/
│ └─ Utils/
│ └─ MyClass.php
├─ tests/
├─ var/
├─ vendor/
└─ web/

Expand All @@ -40,6 +42,8 @@ and put things there:
│ │ └─ Utils/
│ │ └─ MyClass.php
│ └─ AppBundle/
├─ tests/
├─ var/
├─ vendor/
└─ web/

Expand Down Expand Up @@ -318,7 +322,7 @@ command:

.. code-block:: bash

$ php app/console doctrine:fixtures:load
$ php bin/console doctrine:fixtures:load

Careful, database will be purged. Do you want to continue Y/N ? Y
> purging database
Expand Down
53 changes: 22 additions & 31 deletions best_practices/creating-the-project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ to create files and execute the following commands:

.. code-block:: bash

# Linux, Mac OS X
$ cd projects/
$ symfony new blog

Expand Down Expand Up @@ -63,27 +62,35 @@ number of files and directories generated automatically:

blog/
├─ app/
│ ├─ console
│ ├─ cache/
│ ├─ config/
│ ├─ logs/
│ └─ Resources/
├─ bin
│ └─ console
├─ src/
│ └─ AppBundle/
├─ var/
│ ├─ cache/
│ ├─ logs/
│ └─ sessions/
├─ tests/
│ └─ AppBundle/
├─ vendor/
└─ web/

This file and directory hierarchy is the convention proposed by Symfony to
structure your applications. The recommended purpose of each directory is the
following:

* ``app/cache/``, stores all the cache files generated by the application;
* ``app/config/``, stores all the configuration defined for any environment;
* ``app/logs/``, stores all the log files generated by the application;
* ``app/Resources/``, stores all the templates and the translation files for the
application;
* ``src/AppBundle/``, stores the Symfony specific code (controllers and routes),
your domain code (e.g. Doctrine classes) and all your business logic;
* ``var/cache/``, stores all the cache files generated by the application;
* ``var/logs/``, stores all the log files generated by the application;
* ``var/sessions/``, stores all the session files generated by the application;
* ``tests/AppBundle/``, stores the automatic tests (e.g. Unit tests) of the
application.
* ``vendor/``, this is the directory where Composer installs the application's
dependencies and you should never modify any of its contents;
* ``web/``, stores all the front controller files and all the web assets, such
Expand Down Expand Up @@ -128,13 +135,18 @@ that follows these best practices:

blog/
├─ app/
│ ├─ console
│ ├─ cache/
│ ├─ config/
│ ├─ logs/
│ └─ Resources/
├─ bin/
│ └─ console
├─ src/
│ └─ AppBundle/
├─ tests/
│ └─ AppBundle/
├─ var/
│ ├─ cache/
│ ├─ logs/
└─ sessions/
├─ vendor/
└─ web/
├─ app.php
Expand All @@ -147,7 +159,7 @@ that follows these best practices:

.. code-block:: bash

$ php app/console generate:bundle --namespace=AppBundle --dir=src --format=annotation --no-interaction
$ php bin/console generate:bundle --namespace=AppBundle --dir=src --format=annotation --no-interaction

Extending the Directory Structure
---------------------------------
Expand All @@ -157,27 +169,6 @@ structure of Symfony, you can
:doc:`override the location of the main directories </cookbook/configuration/override_dir_structure>`:
``cache/``, ``logs/`` and ``web/``.

In addition, Symfony3 will use a slightly different directory structure when
it's released:

.. code-block:: text

blog-symfony3/
├─ app/
│ ├─ config/
│ └─ Resources/
├─ bin/
│ └─ console
├─ src/
├─ var/
│ ├─ cache/
│ └─ logs/
├─ vendor/
└─ web/

The changes are pretty superficial, but for now, we recommend that you use
the Symfony directory structure.

.. _`Composer`: https://getcomposer.org/
.. _`Get Started`: https://getcomposer.org/doc/00-intro.md
.. _`Composer download page`: https://getcomposer.org/download/
Expand Down
4 changes: 0 additions & 4 deletions best_practices/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,8 @@ installer and then execute this command to download the demo application:

.. code-block:: bash

# Linux and Mac OS X
$ symfony demo

# Windows
c:\> php symfony demo

**The demo application is a simple blog engine**, because that will allow us to
focus on the Symfony concepts and features without getting buried in difficult
implementation details. Instead of developing the application step by step in
Expand Down
4 changes: 2 additions & 2 deletions best_practices/tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ A functional test can be as easy as this:

.. code-block:: php

// src/AppBundle/Tests/ApplicationAvailabilityFunctionalTest.php
namespace AppBundle\Tests;
// tests/AppBundle/ApplicationAvailabilityFunctionalTest.php
namespace Tests\AppBundle;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

Expand Down
3 changes: 2 additions & 1 deletion book/bundles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Now that you've created the bundle, enable it via the ``AppKernel`` class::
{
$bundles = array(
// ...

// register your bundle
new Acme\TestBundle\AcmeTestBundle(),
);
Expand All @@ -122,7 +123,7 @@ generating a basic bundle skeleton:

.. code-block:: bash

$ php app/console generate:bundle --namespace=Acme/TestBundle
$ php bin/console generate:bundle --namespace=Acme/TestBundle

The bundle skeleton generates a basic controller, template and routing
resource that can be customized. You'll learn more about Symfony's command-line
Expand Down
6 changes: 3 additions & 3 deletions book/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ FrameworkBundle configuration:

.. code-block:: bash

$ app/console config:dump-reference FrameworkBundle
$ php bin/console config:dump-reference FrameworkBundle

The extension alias (configuration key) can also be used:

.. code-block:: bash

$ app/console config:dump-reference framework
$ php bin/console config:dump-reference framework

.. note::

Expand Down Expand Up @@ -177,7 +177,7 @@ cached files and allow them to rebuild:

.. code-block:: bash

$ php app/console cache:clear --env=prod --no-debug
$ php bin/console cache:clear --env=prod --no-debug

.. note::

Expand Down
2 changes: 1 addition & 1 deletion book/controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ console command:

.. code-block:: bash

$ php app/console debug:container
$ php bin/console debug:container

.. versionadded:: 2.6
Prior to Symfony 2.6, this command was called ``container:debug``.
Expand Down
24 changes: 12 additions & 12 deletions book/doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ for you:

.. code-block:: bash

$ php app/console doctrine:database:create
$ php bin/console doctrine:database:create

.. sidebar:: Setting up the Database to be UTF8

Expand All @@ -128,8 +128,8 @@ for you:

.. code-block:: bash

$ php app/console doctrine:database:drop --force
$ php app/console doctrine:database:create
$ php bin/console doctrine:database:drop --force
$ php bin/console doctrine:database:create

There's no way to configure these defaults inside Doctrine, as it tries to be
as agnostic as possible in terms of environment configuration. One way to solve
Expand Down Expand Up @@ -227,7 +227,7 @@ just a simple PHP class.

.. code-block:: bash

$ php app/console doctrine:generate:entity
$ php bin/console doctrine:generate:entity

.. index::
single: Doctrine; Adding mapping metadata
Expand Down Expand Up @@ -392,7 +392,7 @@ a regular PHP class, you need to create getter and setter methods (e.g. ``getNam

.. code-block:: bash

$ php app/console doctrine:generate:entities AppBundle/Entity/Product
$ php bin/console doctrine:generate:entities AppBundle/Entity/Product

This command makes sure that all the getters and setters are generated
for the ``Product`` class. This is a safe command - you can run it over and
Expand Down Expand Up @@ -434,10 +434,10 @@ mapping information) of a bundle or an entire namespace:
.. code-block:: bash

# generates all entities in the AppBundle
$ php app/console doctrine:generate:entities AppBundle
$ php bin/console doctrine:generate:entities AppBundle

# generates all entities of bundles in the Acme namespace
$ php app/console doctrine:generate:entities Acme
$ php bin/console doctrine:generate:entities Acme

.. note::

Expand All @@ -459,7 +459,7 @@ in your application. To do this, run:

.. code-block:: bash

$ php app/console doctrine:schema:update --force
$ php bin/console doctrine:schema:update --force

.. tip::

Expand Down Expand Up @@ -852,7 +852,7 @@ used earlier to generate the missing getter and setter methods:

.. code-block:: bash

$ php app/console doctrine:generate:entities AppBundle
$ php bin/console doctrine:generate:entities AppBundle

Next, add a new method - ``findAllOrderedByName()`` - to the newly generated
repository class. This method will query for all the ``Product`` entities,
Expand Down Expand Up @@ -906,7 +906,7 @@ you can let Doctrine create the class for you.

.. code-block:: bash

$ php app/console doctrine:generate:entity --no-interaction \
$ php bin/console doctrine:generate:entity --no-interaction \
--entity="AppBundle:Category" \
--fields="name:string(255)"

Expand Down Expand Up @@ -1063,7 +1063,7 @@ methods for you:

.. code-block:: bash

$ php app/console doctrine:generate:entities AppBundle
$ php bin/console doctrine:generate:entities AppBundle

Ignore the Doctrine metadata for a moment. You now have two classes - ``Category``
and ``Product`` with a natural one-to-many relationship. The ``Category``
Expand Down Expand Up @@ -1092,7 +1092,7 @@ table, and ``product.category_id`` column, and new foreign key:

.. code-block:: bash

$ php app/console doctrine:schema:update --force
$ php bin/console doctrine:schema:update --force

.. note::

Expand Down
2 changes: 0 additions & 2 deletions book/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ from inside a controller::

$form = $this->createFormBuilder($task)
->add('task', TextType::class)
// If you use PHP 5.3 or 5.4 you must use
// ->add('task', 'Symfony\Component\Form\Extension\Core\Type\TextType')
->add('dueDate', DateType::class)
->add('save', SubmitType::class, array('label' => 'Create Task'))
->getForm();
Expand Down
5 changes: 1 addition & 4 deletions book/http_cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,9 @@ To enable caching, modify the code of a front controller to use the caching
kernel::

// web/app.php
require_once __DIR__.'/../app/bootstrap.php.cache';
require_once __DIR__.'/../app/AppKernel.php';
require_once __DIR__.'/../app/AppCache.php';

use Symfony\Component\HttpFoundation\Request;

// ...
$kernel = new AppKernel('prod', false);
$kernel->loadClassCache();
// wrap the default AppKernel with the AppCache one
Expand Down
Loading