Commit Graph

18128 Commits

Author SHA1 Message Date
Bernhard Schussek
d2c6c34067 bug #12151 [Framework][DX] Set the proper validator class according to the configured api version (peterrehm)
This PR was submitted for the master branch but it was merged into the 2.5 branch instead (closes #12151).

Discussion
----------

[Framework][DX] Set the proper validator class according to the configured api version

| Q             | A
| ------------- | ---
| Bug fix?      | [yes]
| New feature?  | [no]
| BC breaks?    | [no]
| Deprecations? | [no]
| Tests pass?   | [yes]
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

With this change the proper validator class will be dumped and therefore used for code completion in IDE's like PhpStorm which rely on the dumped container.

If you have 2.4 or 2.5-bc API the class will be

    Symfony\Component\Validator\ValidatorInterface

If you use the 2.5 API the class will be

    Symfony\Component\Validator\Validator\ValidatorInterface

I consider this also as important for the developer experience since a wrong type hint can easily cause issues since the method signatures of the validate() method have changed.

From

````php
    public function validate($value, $groups = null, $traverse = false, $deep = false);
````

To

````php
    public function validate($value, $constraints = null, $groups = null);
````

So if you want to validate specific groups you now have to pass them as the third argument instead of the second.

Commits
-------

eb3dd0f [Framework][DX] Set the proper validator class according to the configured api version
2014-10-07 14:35:25 +02:00
Peter Rehm
eb3dd0ff29 [Framework][DX] Set the proper validator class according to the configured api version 2014-10-07 14:35:24 +02:00
Fabien Potencier
643fdc8124 Merge branch '2.3' into 2.5
* 2.3:
  [FrameworkBundle] minor fix
  [Console] add a dot
  [Form] remove unnecessary call

Conflicts:
	src/Symfony/Component/Console/Tests/Fixtures/application_1.json
	src/Symfony/Component/Console/Tests/Fixtures/application_2.json
2014-10-05 15:57:04 +02:00
Fabien Potencier
39246def18 bug #12128 [Console] clean handling of :: passed to find() (xabbuh)
This PR was merged into the 2.5 branch.

Discussion
----------

[Console] clean handling of :: passed to find()

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12104
| License       | MIT
| Doc PR        |

Commands cannot have a double colon in their name (for example, a command can't be named `foo::bar`). However, one might try to retrieve a `foo::bar` command from the application like this:

```php
$command = $application->find('foo::bar');
```

The `findAlternatives()` method of the `Application` class fails to handle these strings when there are commands registered with a name consisting of at least three parts (e.g. a command is named `foo:bar:baz`). In this case, an empty string is passed to `strpos()` causing PHP to raise a warning.

In a "real" Symfony application, calling `php ./app/console cache::clear` now results in the following error message:

```
  [InvalidArgumentException]
  There are no commands defined in the "cache:" namespace.
  Did you mean this?
      cache
```

Commits
-------

baab4ed clean handling of :: passed to find()
2014-10-05 15:48:36 +02:00
Fabien Potencier
6df49bb9e1 minor #12130 [FrameworkBundle] minor fix (NAYZO)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #12130).

Discussion
----------

[FrameworkBundle] minor fix

A small fix in the "parse" function of the "ControllerNameParser" Controller.
We should use "!==" instead of "!=" since it's better and faster in this case.

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | NA
| License       | MIT
| Doc PR        | NA

Commits
-------

cd966c6 [FrameworkBundle] minor fix
2014-10-05 15:47:18 +02:00
Ala Eddine Khefifi
cd966c6826 [FrameworkBundle] minor fix
A small fix in the "parse" function of the "ControllerNameParser" Controller.
We should use "!==" instead of "!=" since it's better and faster in this case.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | NA
| License       | MIT
| Doc PR        | NA
2014-10-05 15:47:08 +02:00
Fabien Potencier
db44606580 minor #12135 [Console] add a dot (MightyBranch)
This PR was submitted for the 2.5 branch but it was merged into the 2.3 branch instead (closes #12135).

Discussion
----------

[Console] add a dot

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Added a "." at the end of an InputOption description, as the rest of the InputOption descriptions have it.

Commits
-------

fb0e685 [Console] add a dot
2014-10-05 15:45:15 +02:00
MightyBranch
fb0e685286 [Console] add a dot 2014-10-05 15:45:10 +02:00
Fabien Potencier
34a638bc64 minor #12134 [Form] remove unnecessary call (Tobion)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] remove unnecessary call

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

4e45a39 [Form] remove unnecessary call
2014-10-05 09:29:26 +02:00
Tobias Schultze
4e45a39cc0 [Form] remove unnecessary call 2014-10-05 05:13:10 +02:00
Christian Flothmann
baab4edf35 clean handling of :: passed to find()
Commands cannot have a double colon in their name (for example, a
command can't be named `foo::bar`). However, one might try to
retrieve a `foo::bar` command from the application like this:

```php
$command = $application->find('foo::bar');
```

The `findAlternatives()` method of the `Application` class fails to
handle these strings when there are commands registered with a name
consisting of at least three parts (e.g. a command is named
`foo:bar:baz`). In this case, an empty string is passed to `strpos()`
causing PHP to raise a warning.
2014-10-04 12:23:49 +02:00
Fabien Potencier
adbde8ac7a minor #12093 [EventDispatcher] fix RegisterListenersPass test (xabbuh)
This PR was merged into the 2.5 branch.

Discussion
----------

[EventDispatcher] fix RegisterListenersPass test

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

With #12088 being merged, the test needs to be adapted to reflect the 2.5 specific changes.

Commits
-------

9d2120b fix RegisterListenersPass test
2014-10-02 07:56:02 +02:00
Christian Flothmann
9d2120b562 fix RegisterListenersPass test
With #12088 being merged, the test needs to be adapted to reflect the
2.5 specific changes.
2014-10-01 17:43:05 +02:00
Fabien Potencier
cfd1ecfe84 Merge branch '2.3' into 2.5
* 2.3:
  [Doc] Use Markdown syntax highlighting
  [Finder] tweaked docs
  [Finder] Add info about possibilities offered by SplFileInfo
  fix components tests
  [Intl] FIxed failing test
  [Intl] Generated the data for ICU version 54-rc
  [EventDispatcher] fix doc bloc on EventDispatcherInterface
  [Validator] Update validators.zh_CN.xlf, fix translation error
  bumped Symfony version to 2.3.21
  updated VERSION for 2.3.20
  update CONTRIBUTORS for 2.3.20
  updated CHANGELOG for 2.3.20
  [Intl] Integrated ICU data into Intl component

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
	src/Symfony/Component/Intl/ResourceBundle/LocaleBundle.php
2014-10-01 07:50:18 +02:00
Fabien Potencier
0e7694e5e9 Merge branch 'pull/12053' into 2.3
* pull/12053:
  [Doc] Use Markdown syntax highlighting

Conflicts:
	src/Symfony/Component/Finder/README.md
2014-10-01 07:39:06 +02:00
Laurent Ghirardotti
638ce847b3 [Doc] Use Markdown syntax highlighting 2014-10-01 07:38:33 +02:00
Fabien Potencier
03f3dec065 [Finder] tweaked docs 2014-10-01 07:36:12 +02:00
Fabien Potencier
c8daa9c420 minor #12059 [Finder] Add info about possibilities offered by SplFileInfo (ywarnier)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #12059).

Discussion
----------

[Finder] Add info about possibilities offered by SplFileInfo

Minor documentation improvement

Commits
-------

b2219cf [Finder] Add info about possibilities offered by SplFileInfo
2014-10-01 07:33:40 +02:00
Yannick Warnier
b2219cf150 [Finder] Add info about possibilities offered by SplFileInfo 2014-10-01 07:33:40 +02:00
Fabien Potencier
d002f1744a minor #12088 fix components tests (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

fix components tests

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Since #12006, the `ContainerBuilder` contains the `addExpressionLanguageProvider()` method which references a class from the ExpressionLanguage component. By default, the PHPUnit mock API tries to mock all methods of the class being doubled. Since the ExpressionLanguage component is not required to run the tests, creating the mock objects fails when the mock API fails to mock the `addExpressionLanguageProvider()` method.

Commits
-------

2f2a732 fix components tests
2014-10-01 07:29:49 +02:00
Fabien Potencier
e6bcb1cff4 fixed CS 2014-10-01 07:28:47 +02:00
Fabien Potencier
408c6aa501 minor #12086 [Security][Http][Authentication] Make a test pass on HHVM (AlphaStream)
This PR was submitted for the master branch but it was merged into the 2.5 branch instead (closes #12086).

Discussion
----------

[Security][Http][Authentication] Make a test pass on HHVM

The test mocks AuthenticationException mocking all its (and its ancestors') methods. In HHVM's implementation of \Exception, a static method is called upon instantiation. Mock object generator, however, mocks static methods with 'throw' statements. All of these cause the SimpleAuthenticationHandlerTest to fail on HHVM when attempting to instantiate the mock.

The solution is to disable method mocking for AuthenticationException. An instance of this class is merely passed around between the authentication handler and the failure handler, and no methods are invoked on it. Hence, disabling method mocking should not weaken the unit test.

| Q             | A
| ------------- | ---
| Bug fix?      | [no]
| New feature?  | [no]
| BC breaks?    | [no]
| Deprecations? | [no]
| Tests pass?   | [yes]
| Fixed tickets | [none]
| License       | MIT
| Doc PR        | [none]

Commits
-------

7ff903e [Security][Http][Authentication] Make a test pass on HHVM
2014-10-01 07:27:37 +02:00
Alex Bakhturin
7ff903ed39 [Security][Http][Authentication] Make a test pass on HHVM 2014-10-01 07:27:37 +02:00
Christian Flothmann
2f2a732807 fix components tests
Since #12006, the `ContainerBuilder` contains the
`addExpressionLanguageProvider()` method which references a class from
the ExpressionLanguage component. By default, the PHPUnit mock API
tries to mock all methods of the class being doubled. Since the
ExpressionLanguage component is not required to run the tests,
creating the mock objects fails when the mock API fails to mock
the `addExpressionLanguageProvider()` method.
2014-10-01 00:07:12 +02:00
Bernhard Schussek
b45ebef229 [Intl] FIxed failing test 2014-09-30 23:25:54 +02:00
Bernhard Schussek
40eaa80ef6 bug #11998 [Intl] Integrated ICU data into Intl component #2 (webmozart)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11998).

Discussion
----------

[Intl] Integrated ICU data into Intl component #2

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Follow-up PR to #11920. This PR contains generated data files only.

Commits
-------

65a8b9f [Intl] Generated the data for ICU version 54-rc
2014-09-30 23:21:32 +02:00
Bernhard Schussek
65a8b9fc93 [Intl] Generated the data for ICU version 54-rc 2014-09-30 23:21:31 +02:00
Bernhard Schussek
1ce0f875be bug #11920 [Intl] Integrated ICU data into Intl component #1 (webmozart)
This PR was merged into the 2.3 branch.

Discussion
----------

[Intl] Integrated ICU data into Intl component #1

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11447, #10807
| License       | MIT
| Doc PR        | -

This PR is an alternative implementation to #11884. It depends on ~~#11906~~ and ~~#11907~~ being merged first (~~these are included in the diff until after a merge+rebase~~ merged+rebased now).

With this PR, the ICU component becomes obsolete. The ICU data is bundled with Intl in two different formats: JSON and the binary ICU resource bundle format (version 2) readable by PHP's `\ResourceBundle` class. For a performance comparison between the two, see my [benchmark](/webmozart/json-res-benchmark).

~~The data is contained in two zip files: json.zip (2.6MB) and rb-v2.zip (3.8MB). The handler~~

```php
\Symfony\Component\Intl\Composer\ScriptHandler::decompressData()
```

~~needs to be added as Composer hook and decompresses the data after install/update.~~

The data is included as text/binary now. Git takes care of the compression.

Before this PR can be merged, I would like to find out what the performance difference between the two formats is in real applications. For that, I need benchmarks from some real-life applications which use ICU data - e.g. in forms (language drop-downs, country selectors etc.) - for both the JSON and the binary data. You can force either format to be used by hard-coding the return value of `Intl::detectDataFormat()` to `Intl::JSON` and `Intl::RB_V2` respectively. I'll also try to create some more realistic benchmarks.

If JSON is not significantly slower/takes up significantly more memory than the binary format, we can drop the binary format altogether.

Commits
-------

be819c1 [Intl] Integrated ICU data into Intl component
2014-09-30 23:20:37 +02:00
Fabien Potencier
e24a822c40 minor #12080 [EventDispatcher] fix doc bloc on EventDispatcherInterface (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[EventDispatcher] fix doc bloc on EventDispatcherInterface

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

The doc block says that an array of event names is accepted as input, but no implementation is compliant with that description.

Commits
-------

e3dacbd [EventDispatcher] fix doc bloc on EventDispatcherInterface
2014-09-30 16:01:01 +02:00
Nicolas Grekas
e3dacbd08c [EventDispatcher] fix doc bloc on EventDispatcherInterface 2014-09-30 09:22:23 +02:00
Fabien Potencier
4af20505a6 minor #12070 [Validator] Update validators.zh_CN.xlf, fix translation error (michaeljayt)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #12070).

Discussion
----------

[Validator] Update validators.zh_CN.xlf, fix translation error

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

ab5aaab [Validator] Update validators.zh_CN.xlf, fix translation error
2014-09-29 08:58:14 +02:00
Michael J
ab5aaab414 [Validator] Update validators.zh_CN.xlf, fix translation error 2014-09-29 08:58:14 +02:00
Fabien Potencier
6e534f2023 bumped Symfony version to 2.5.6 2014-09-28 20:29:08 +02:00
Fabien Potencier
2aef97bbc9 updated VERSION for 2.5.5 2014-09-28 19:33:53 +02:00
Fabien Potencier
33af15518b updated CHANGELOG for 2.5.5 2014-09-28 19:33:46 +02:00
Fabien Potencier
6beca0a945 bumped Symfony version to 2.3.21 2014-09-28 18:55:34 +02:00
Fabien Potencier
5ef0ea8414 updated VERSION for 2.3.20 2014-09-28 18:24:47 +02:00
Fabien Potencier
523b9b78b8 update CONTRIBUTORS for 2.3.20 2014-09-28 18:24:25 +02:00
Fabien Potencier
f0d90031a3 updated CHANGELOG for 2.3.20 2014-09-28 18:24:13 +02:00
Fabien Potencier
a4217c3ee0 fixed deps 2014-09-28 17:56:11 +02:00
Fabien Potencier
8d75b4b56f Merge branch '2.4' into 2.5
* 2.4:
  [Debug] fixed class lookup when using PSR-0 with a target dir
  fixed standalone tests
  fixed standalone tests
  [Validator] fixed component standalone tests
  fixed standalone component tests depending on Validator and Form
  fixed some composer.json to make standalone component tests pass
  [SecurityBundle] fixed tests when used in standalone

Conflicts:
	src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php
	src/Symfony/Component/Validator/composer.json
2014-09-28 17:22:14 +02:00
Fabien Potencier
cff4bbbf5d minor #12071 [Debug] fixed class lookup when using PSR-0 with a target dir (fabpot)
This PR was merged into the 2.4 branch.

Discussion
----------

[Debug] fixed class lookup when using PSR-0 with a target dir

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

f5b38ec [Debug] fixed class lookup when using PSR-0 with a target dir
2014-09-28 17:18:49 +02:00
Fabien Potencier
f5b38ec995 [Debug] fixed class lookup when using PSR-0 with a target dir 2014-09-28 17:03:21 +02:00
Fabien Potencier
3a1661bb38 fixed standalone tests 2014-09-28 17:02:53 +02:00
Fabien Potencier
b6bbe8bc25 fixed standalone tests 2014-09-28 15:40:52 +02:00
Fabien Potencier
158939e8fe [Validator] fixed component standalone tests 2014-09-27 23:11:35 +02:00
Fabien Potencier
09a3c4c956 fixed standalone component tests depending on Validator and Form 2014-09-27 22:43:02 +02:00
Fabien Potencier
5c3cea59ba fixed some composer.json to make standalone component tests pass 2014-09-27 22:16:29 +02:00
Fabien Potencier
de780e88fd Merge branch '2.3' into 2.4
* 2.3:
  [SecurityBundle] fixed tests when used in standalone
2014-09-27 21:38:45 +02:00
Fabien Potencier
98b2db5a1d [SecurityBundle] fixed tests when used in standalone 2014-09-27 21:29:57 +02:00