Commit Graph

9291 Commits

Author SHA1 Message Date
Jordi Boggiano
f4227b5f82 [Process] Removing useless code (this is already done in updateStatus) 2012-04-08 20:26:27 +02:00
Jordi Boggiano
2d586d245d [Process] Fix a mistake triggering stream_select errors 2012-04-08 20:26:04 +02:00
Fabien Potencier
da0eaa63cc merged branch Seldaek/at_op (PR #3837)
Commits
-------

f3408cc [Finder] Avoid unnecessary use of the @ operator

Discussion
----------

[Finder] Avoid unnecessary use of the @ operator

Tests are passing

---------------------------------------------------------------------------

by stof at 2012-04-08T17:42:01Z

Does PHP really throw an exception on failure or is it only the case when an error handler converts a warning to an exception ? It would be weird given the small amount of cases where PHP uses exceptions.

---------------------------------------------------------------------------

by Seldaek at 2012-04-08T17:43:51Z

```
$ php -r 'new DateTime("foo");'

Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (foo) at
position 0 (f): The timezone could not be found in the database' in Command line code on line 1
```

---------------------------------------------------------------------------

by Seldaek at 2012-04-08T17:45:09Z

In a constructor it's pretty hard to return false, so it has to throw an exception. The php.net docs also say it so I'm fairly sure it's nothing specific to my setup.
2012-04-08 20:00:30 +02:00
Jordi Boggiano
f3408ccf2c [Finder] Avoid unnecessary use of the @ operator 2012-04-08 19:39:04 +02:00
Fabien Potencier
27c41f1e8e merged branch stloyd/crawler_phpdoc (PR #3834)
Commits
-------

292364a [DomCrawler] Added some docbocks into DomCrawler classes. Closes #3832

Discussion
----------

[DomCrawler] Added some docbocks into DomCrawler classes, reordered func...

...tions to follow Symfony 2 CS. Closes #3832

---------------------------------------------------------------------------

by fabpot at 2012-04-08T10:38:39Z

Can you revert the code move as it makes merges between 2.0 and master much more complex. Thanks.

---------------------------------------------------------------------------

by stloyd at 2012-04-08T11:36:53Z

Reverted and changed commit message.

@fabpot Should I make PR for `master` according to CS ?

---------------------------------------------------------------------------

by stof at 2012-04-08T11:40:58Z

@stloyd this can be considered as a bugfix as you are fixing the phpdoc. So 2.0 is fine
2012-04-08 14:03:25 +02:00
Joseph Bielawski
292364ad70 [DomCrawler] Added some docbocks into DomCrawler classes. Closes #3832 2012-04-08 13:35:35 +02:00
Fabien Potencier
d6948581ac [TwigBundle] simplified code 2012-04-08 12:56:21 +02:00
Fabien Potencier
a11ec3e71c [TwigBundle] added correct file name in twig:lint exception reporting 2012-04-08 12:53:40 +02:00
Fabien Potencier
57c6aaa397 [TwigBundle] tweaked previous merge 2012-04-08 12:41:50 +02:00
Fabien Potencier
9c0fba93b2 merged branch marcw/feat-twig-lint (PR #3804)
Commits
-------

8726ade Adds more features to twig:lint command
1d7e9d9 Adds a linter command for templates

Discussion
----------

Adds a linter command for templates

Let's this PR be stoffed. ;)

---------------------------------------------------------------------------

by Tobion at 2012-04-06T15:48:18Z

Checking a single file is very limited. Checking a whole directory would be more useful, wouldn't it?

---------------------------------------------------------------------------

by willdurand at 2012-04-06T17:56:57Z

I think you should provide a way to validate all templates for a given bundle, something like:

    php app/console twig:lint @MySuperBundle

---------------------------------------------------------------------------

by henrikbjorn at 2012-04-06T18:03:45Z

Wouldnt it be better to throw some kind of exception if the lint is erroneous?

---------------------------------------------------------------------------

by marcw at 2012-04-07T11:22:34Z

@Tobion @willdurand  You can do that by combining unix tools.
@henrikbjorn Why ?

---------------------------------------------------------------------------

by marcw at 2012-04-07T11:27:11Z

Updated.

---------------------------------------------------------------------------

by dlsniper at 2012-04-07T13:15:53Z

@marcw it would be indeed nice to have support for a bundle/directory out of the box as some of the Symfony2 users might not be running unix or know the right commands to make this work.

I could help you with a PR in your repo if you want.

---------------------------------------------------------------------------

by henrikbjorn at 2012-04-07T18:55:34Z

@marcw as the console component will catch them and convert them into the right error code, also will display what went wrong instead of just dieing.

---------------------------------------------------------------------------

by marcw at 2012-04-08T09:15:37Z

Updated with all comments and requested features.
2012-04-08 12:39:25 +02:00
Bernhard Schussek
c4e68a3295 [Form] Moved logic of addXxx()/removeXxx() methods to the PropertyPath class
Setting a property path like "article.tags" will now automatically try to
favor addTag() and removeTag() over setTags(), if found. If you want to
set up a property path with an irregular singular that is not detected,
you can use "|" to separate the plural from the singular form in the
path: "article.genera|genus".

Another consequence of this commit is that the MergeCollectionListener has
been simplified a lot. Forms returning an array or a collection will
always result in adders/removers being called now without having to add
this listener.
2012-04-08 12:32:17 +02:00
Bernhard Schussek
65aa387da0 [Form] Fixed index generation in EntityChoiceList if ID is not an integer 2012-04-08 12:32:10 +02:00
marc.weistroff
8726ade310 Adds more features to twig:lint command 2012-04-08 11:14:51 +02:00
Fabien Potencier
5122d68c24 merged branch ruimarinho/exception_css_tweaks (PR #3827)
Commits
-------

fad114b Tweaked the exceptions layout CSS in order to display the error message even when wrapped around <pre> tags

Discussion
----------

Tweaked the exceptions layout CSS in order to display the error message even when wrapped around <pre> tags

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: ![Build status](https://secure.travis-ci.org/ruimarinho/symfony.png?branch=exception_css_tweaks)
Fixes the following tickets: -
Todo: -

Ever been in a situation when you're debugging code wrapped around `<pre>` tags and that code throws an exception? If you're familiar with this screenshot, you have :-) ![Image](http://i.imgur.com/dwxdD.png)

This PR is just a little tweak to the exceptions layout CSS in order to allow your to view the exception message. It also fixes a word break when messages are too long. ![Image 2](http://i.imgur.com/whxZv.png).

The build is currently failing due to an unmerged patch from the 2.0 branch.
2012-04-08 09:24:17 +02:00
Fabien Potencier
0e525fc5ce merged 2.0 2012-04-08 09:22:35 +02:00
Fabien Potencier
c6096e323e merged branch eriksencosta/test-fixes (PR #3830)
Commits
-------

fdee352 [TwigBridge] updated suggested packages
dad1750 [TwigBridge] updated TestCase as an abstract class
140ac20 [TwigBridge] fixed bootstrap

Discussion
----------

[TwigBridge] updated Composer suggested packages and test fixes

---------------------------------------------------------------------------

by eriksencosta at 2012-04-08T06:13:53Z

Rebased.
2012-04-08 09:18:17 +02:00
Fabien Potencier
bca8c5feac merged branch jakzal/FilesystemBugFix (PR #3828)
Commits
-------

22e2ad8 [Filesystem] Fixed relative path calculation for end path which is a subdirectory of the start path.
bc93787 [Filesystem] Fixed relative path calculation for paths with various combinations of trailing directory separators.

Discussion
----------

[Filesystem] Fixed relative path calculation

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
2012-04-08 09:16:07 +02:00
Eriksen Costa
fdee352619 [TwigBridge] updated suggested packages 2012-04-08 03:12:14 -03:00
Eriksen Costa
dad1750dfa [TwigBridge] updated TestCase as an abstract class 2012-04-07 18:49:17 -03:00
Eriksen Costa
140ac2014e [TwigBridge] fixed bootstrap 2012-04-07 18:47:00 -03:00
Jakub Zalas
22e2ad80c9 [Filesystem] Fixed relative path calculation for end path which is a subdirectory of the start path. 2012-04-07 21:52:26 +01:00
Jakub Zalas
bc93787a0d [Filesystem] Fixed relative path calculation for paths with various combinations of trailing directory separators. 2012-04-07 21:19:12 +01:00
Fabien Potencier
dee79e910d merged branch jakzal/SetCookieWithMultipleCookiesBugFix (PR #3823)
Commits
-------

7f92833 [BrowserKit] Fixed cs.
df3da28 [BrowserKit] Using assertNull instead of assertEquals.
87890d3 [BrowserKit] Fixed CookieJar issue being unable to parse multiple cookies from Set-Cookie.

Discussion
----------

[BrowserKit] Fixed CookieJar being unable to parse multiple cookies

Fix proposition for #3109

My fix splits value of *Set-Cookie* header by comma. Than it checks each extracted part if it starts with a cookie-name (token). If check is positive cookie is added to the list. Otherwise it's appended to the previous value. First element is always added to the list.

[rfc6265](http://tools.ietf.org/html/rfc6265) defines cookie-name with token:

    cookie-name = token
    token = <token, defined in [RFC2616], Section 2.2>

token is defined in [rfc2616](http://tools.ietf.org/html/rfc2616#section-2.2) as follows:

    token = 1*<any CHAR except CTLs or separators>
    CHAR = <any US-ASCII character (octets 0 - 127)>
    separators = "(" | ")" | "<" | ">" | "@"
                  | "," | ";" | ":" | "\" | <">
                  | "/" | "[" | "]" | "?" | "="
                  | "{" | "}" | SP | HT

That means cookie-name can be built out of following set of characters: *! # $ % & ' * + - . ^ _ ` | ~ 0-9 A-Z a-z*

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
2012-04-07 21:57:48 +02:00
Jakub Zalas
7f928332a9 [BrowserKit] Fixed cs. 2012-04-07 19:45:50 +01:00
Fabien Potencier
0a7f4668e0 [Process] added a note about user-defined error exist codes 2012-04-07 20:15:50 +02:00
Fabien Potencier
34b1b6b17d merged branch bschussek/issue3661 (PR #3821)
Commits
-------

e0ce6b4 [Form] Fixed required value guessed by ValidatorTypeGuesser

Discussion
----------

[Form] Fixed required value guessed by ValidatorTypeGuesser

Bug fix: yes
Feature addition: no
Backwards compatibility break: no*
Symfony2 tests pass: yes
Fixes the following tickets: #3661
Todo: -

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue3661)

The documentation states that a field is set to required if constrained with NotBlank or NotNull and to not required otherwise. Due to a bug this was not the case and fields were always required. This is now fixed.

The consequence is that some fields that were required before by default are not required anymore. The only difference is that the HTML5 "required" attribute disappears, because server-side validation did not occur before anyway.
2012-04-07 20:06:18 +02:00
Jakub Zalas
df3da289ad [BrowserKit] Using assertNull instead of assertEquals. 2012-04-07 18:45:48 +01:00
Jakub Zalas
87890d3a7c [BrowserKit] Fixed CookieJar issue being unable to parse multiple cookies from Set-Cookie. 2012-04-07 18:38:39 +01:00
Tom Van Looy
039ff6fc8e allow more control on GetSetMethodNormalizer by using callback functions and an ignoreAttributes list 2012-04-07 18:07:14 +02:00
Rui Marinho
fad114b76a Tweaked the exceptions layout CSS in order to display the error message even when wrapped around <pre> tags 2012-04-07 16:28:29 +01:00
Kim Hemsø Rasmussen
f1236844a8 Removed leftover from c/p 2012-04-07 17:15:32 +02:00
Bernhard Schussek
e0ce6b4c11 [Form] Fixed required value guessed by ValidatorTypeGuesser 2012-04-07 16:26:16 +02:00
marc.weistroff
1d7e9d9753 Adds a linter command for templates 2012-04-07 13:26:03 +02:00
Fabien Potencier
13aa515d65 merged branch jakzal/FilesystemTests (PR #3811)
Commits
-------

100e97e [Filesystem] Fixed warnings in makePathRelative().
f5f5c21 [Filesystem] Fixed typos in the docblocks.
d4243a2 [Filesystem] Fixed a bug in remove being unable to remove symlinks to unexisting file or directory.
11a676d [Filesystem] Added unit tests for mirror method.
8c94069 [Filesystem] Added unit tests for isAbsolutePath method.
2ee4b88 [Filesystem] Added unit tests for makePathRelative method.
21860cb [Filesystem] Added unit tests for symlink method.
a041feb [Filesystem] Added unit tests for rename method.
8071859 [Filesystem] Added unit tests for chmod method.
bba0080 [Filesystem] Added unit tests for remove method.
8e861b7 [Filesystem] Introduced workspace directory to limit complexity of tests.
a91e200 [Filesystem] Added unit tests for touch method.
7e297db [Filesystem] Added unit tests for mkdir method.
6ac5486 [Filesystem] Added unit tests for copy method.
1c833e7 [Filesystem] Added missing docblock comment.

Discussion
----------

[Filesystem] Fixed a bug in remove() being unable to unlink broken symlinks

While working on test coverage for Filesystem class I discovered a bug in remove() method.

Before removing a file a check is made if it exists:

    if (!file_exists($file)) {
        continue;
    }

Problem is [file_exists()](http://php.net/file_exists) returns false if link's target file doesn't exist. Therefore remove() will fail to delete a directory containing a broken link. Solution is to handle links a bit different:

    if (!file_exists($file) && !is_link($file)) {
        continue;
    }

Additionally, this PR improves test coverage of Filesystem component.

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes

---------------------------------------------------------------------------

by cordoval at 2012-04-07T00:55:59Z

✌.|•͡˘‿•͡˘|.✌

---------------------------------------------------------------------------

by fabpot at 2012-04-07T06:12:34Z

Tests do not pass for me:

    PHPUnit 3.6.10 by Sebastian Bergmann.

    Configuration read from /Users/fabien/work/symfony/git/symfony/phpunit.xml.dist

    .........................EE.......

    Time: 0 seconds, Memory: 5.25Mb

    There were 2 errors:

    1) Symfony\Component\Filesystem\Tests\FilesystemTest::testMakePathRelative with data set #0 ('/var/lib/symfony/src/Symfony/', '/var/lib/symfony/src/Symfony/Component', '../')
    Uninitialized string offset: 29

    .../rc/Symfony/Component/Filesystem/Filesystem.php:183
    .../rc/Symfony/Component/Filesystem/Tests/FilesystemTest.php:434

    2) Symfony\Component\Filesystem\Tests\FilesystemTest::testMakePathRelative with data set #1 ('var/lib/symfony/', 'var/lib/symfony/src/Symfony/Component', '../../../')
    Uninitialized string offset: 16

    .../rc/Symfony/Component/Filesystem/Filesystem.php:183
    .../rc/Symfony/Component/Filesystem/Tests/FilesystemTest.php:434

    FAILURES!
    Tests: 34, Assertions: 67, Errors: 2.

---------------------------------------------------------------------------

by jakzal at 2012-04-07T07:26:15Z

Sorry for this. For some reason my PHP error reporting level was to low to catch this...

Should be fixed now but I needed to modify the makePathRelative() (this bug existed before).
2012-04-07 10:18:55 +02:00
Fabien Potencier
e7dbc38941 merged branch eriksencosta/pt_BR-translations (PR #3817)
Commits
-------

bf51a58 [FrameworkBundle] fixed pt_BR translations (added commas to take a breath :)
dc94e27 [FrameworkBundle] synced pt_BR translations

Discussion
----------

synced and fixed pt_BR translations
2012-04-07 10:18:49 +02:00
Eriksen Costa
bf51a58f37 [FrameworkBundle] fixed pt_BR translations (added commas to take a breath :) 2012-04-07 04:30:12 -03:00
Eriksen Costa
dc94e27dbb [FrameworkBundle] synced pt_BR translations 2012-04-07 04:29:23 -03:00
Jakub Zalas
100e97ebe7 [Filesystem] Fixed warnings in makePathRelative(). 2012-04-07 08:23:20 +01:00
Fabien Potencier
72e854e943 fixed CS 2012-04-07 09:10:50 +02:00
Fabien Potencier
0a585b7130 merged branch eriksencosta/cs-fixes (PR #3816)
Commits
-------

abd59c3 Merge branch 'master' into cs-fixes
f5f0506 [TwigBundle] fixed CS

Discussion
----------

CS fixes
2012-04-07 09:04:09 +02:00
Eriksen Costa
abd59c3dbd Merge branch 'master' into cs-fixes 2012-04-07 03:53:28 -03:00
Fabien Potencier
d967d39d27 merged branch chmielot/3446-empty-multiple-entity-choice (PR #3734)
Commits
-------

a430f3d [#3446] [Form] Fix getChoicesForValues of EntityChoiceList on empty values

Discussion
----------

[Form] Fix reverseTransform on multiple entity form type

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3446, #3727
Todo: -

---------------------------------------------------------------------------

by stof at 2012-04-03T23:05:55Z

@bschussek ping

---------------------------------------------------------------------------

by stof at 2012-04-03T23:06:45Z

This is an alternate implementation for #3727

---------------------------------------------------------------------------

by chmielot at 2012-04-04T13:47:27Z

OK, this is another possibility to fix this issue with working tests. What do you think about this?

---------------------------------------------------------------------------

by chmielot at 2012-04-04T13:51:27Z

OK, just done.

---------------------------------------------------------------------------

by stof at 2012-04-04T13:51:39Z

@beberlei @bschussek ping

---------------------------------------------------------------------------

by bschussek at 2012-04-06T18:50:37Z

@fabpot 👍
2012-04-07 08:22:05 +02:00
Fabien Potencier
526fb7bf05 merged branch bschussek/issue3738 (PR #3807)
Commits
-------

6584721 [Form] Improved labels generated by default from form names
6e0b03a [Form] Fixed label of prototype in CollectionType
fc342d1 Merge remote branch 'umpirsky/collection-name' into issue3738
f91660d Added test for prototype label.

Discussion
----------

[Form] Fixed default label generated for the CollectionType prototype

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3738, #3739
Todo: -

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue3738)

(the fact that the build fails seems to origin from the broken master)
2012-04-07 08:15:43 +02:00
Fabien Potencier
048f8dabba merged branch eriksencosta/patch-1 (PR #3813)
Commits
-------

46c7ae1 added composer.lock to .gitignore

Discussion
----------

added composer.lock to .gitignore
2012-04-07 08:09:20 +02:00
Fabien Potencier
1c10b0b455 merged branch eriksencosta/readme-fixes (PR #3814)
Commits
-------

f3efea3 [Propel1Bridge][TwigBridge] fixed export instructions in the README files

Discussion
----------

[Propel1Bridge][TwigBridge] fixed export instructions in the README files
2012-04-07 08:09:06 +02:00
Fabien Potencier
987e69ee56 merged branch jmikola/di-yaml-loader-test (PR #3808)
Commits
-------

1c3e4ac [DependencyInjection] Fix Yaml file loader test

Discussion
----------

[DependencyInjection] Fix Yaml file loader test

This broke when 2.0 was recently merged into master with b9daae2847, as the Yaml fixture change from 24a0d0a2dc was not included.

https://twitter.com/webmozart/status/188325579894947840
2012-04-07 08:09:01 +02:00
Eriksen Costa
f5f0506b1b [TwigBundle] fixed CS 2012-04-07 01:24:57 -03:00
Eriksen Costa
f3efea3a6e [Propel1Bridge][TwigBridge] fixed export instructions in the README files 2012-04-06 23:24:52 -03:00
Eriksen Costa
46c7ae1ed4 added composer.lock to .gitignore 2012-04-06 22:15:14 -03:00
Jakub Zalas
f5f5c21228 [Filesystem] Fixed typos in the docblocks. 2012-04-07 00:05:37 +01:00