Commit Graph

22758 Commits

Author SHA1 Message Date
Ryan Weaver
c03f5c2ad4 Massively simplifying the BC and deprecated-throwing code thanks to suggestions by stof in #15870 2015-09-26 17:07:41 -04:00
Christophe Coevoet
e610b416c9 Merge branch '2.7' into 2.8
* 2.7:
  Fix license headers
  Ensure the ClockMock is loaded before using it in the testsuite
  Fix with_minutes option in time widget
  Fixed properties not explicitily declared
2015-09-26 21:48:07 +02:00
Christophe Coevoet
05fc646142 minor #15913 Ensure the ClockMock is loaded before using it in the testsuite (stof)
This PR was merged into the 2.7 branch.

Discussion
----------

Ensure the ClockMock is loaded before using it in the testsuite

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

The ``ProgressBarTest`` is passing in 2.7 and 2.8 on Travis only because the ``LegacyProgressHelperTest`` is running first, and so the clock mock is loaded. It would not pass when running it standalone. And the testsuite is currently broken in the master branch because LegacyProgressHelperTest is gone there, and so the clock mock was not loaded before the test.

Commits
-------

0e5aa0e Ensure the ClockMock is loaded before using it in the testsuite
2015-09-26 21:30:33 +02:00
Christophe Coevoet
a31dfa6f4b minor #15923 Fix legacy security tests (stof)
This PR was merged into the 2.8 branch.

Discussion
----------

Fix legacy security tests

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

when merging legacy test classes together in #15893, use statements where not copied, making the tests fail.

Commits
-------

8b615bb Fix legacy security tests
2015-09-26 21:22:35 +02:00
Tobias Schultze
4cc8b76787 minor #15922 [Security] Fix trigger_error calls in voters (WouterJ)
This PR was merged into the 2.8 branch.

Discussion
----------

[Security] Fix trigger_error calls in voters

Fixes typos found by @weaverryan in https://github.com/symfony/symfony/pull/15151

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

Commits
-------

69e80be Fix trigger_error calls
2015-09-26 20:56:55 +02:00
Ryan Weaver
5fa2684273 Making all "debug" messages use the debug router
Only the "auth success" and "auth failed" messages remain at info. That's
consistent with AbstractAuthenticationListener
2015-09-26 14:16:48 -04:00
Ryan Weaver
7f04fbb078 Making GuardTokenInterface extend TokenInterface
This makes some of our type-hints more honest: i.e. where we look for a GuardTokenInterface,
but really also expect it to implement TokenInterface.
2015-09-26 14:10:49 -04:00
Ryan Weaver
f403444cc0 Updating behavior to not continue after an authenticator has set the response
This mirrors the behavior in core: *if* a listener sets a response (on success or failure),
then the other listeners are not called. But if a response is *not* set
(which is sometimes the case for success, like in BasicAuthenticationListener),
then the other listeners are called, and can even fail.
2015-09-26 12:34:14 -04:00
Christophe Coevoet
51147e3aff Add a group for tests of the finder against the FTP server
This allows to skip them easily when running the testsuite, as they
represent a significant part of the testsuite time.
2015-09-26 17:47:39 +02:00
WouterJ
69e80beaa0 Fix trigger_error calls 2015-09-26 17:42:54 +02:00
Christophe Coevoet
8b615bb4b4 Fix legacy security tests 2015-09-26 17:38:37 +02:00
Ryan Weaver
869d5a77f0 tweaking message related to configuration edge case that we want to be helpful with 2015-09-26 10:22:30 -04:00
Ryan Weaver
da4758a2af Minor tweaks - lowering the required security-http requirement and nulling out a test field 2015-09-26 10:16:59 -04:00
Christophe Coevoet
1d5557f37f minor #15918 [2.8] Fix license headers (1ed)
This PR was merged into the 2.8 branch.

Discussion
----------

[2.8] Fix license headers

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

Commits
-------

1701708 Fix license headers
2015-09-26 14:52:34 +02:00
Christophe Coevoet
548c10482e minor #15917 [2.7] Fix license headers (1ed)
This PR was merged into the 2.7 branch.

Discussion
----------

[2.7] Fix license headers

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

Commits
-------

db8239f Fix license headers
2015-09-26 14:50:27 +02:00
Christophe Coevoet
2bd0738cc5 minor #15916 [2.3] Fix license headers (1ed)
This PR was merged into the 2.3 branch.

Discussion
----------

[2.3] Fix license headers

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

Commits
-------

b03bcb3 Fix license headers
2015-09-26 14:42:05 +02:00
Gábor Egyed
1701708c48 Fix license headers 2015-09-26 14:22:32 +02:00
Gábor Egyed
db8239ffab Fix license headers 2015-09-26 14:15:17 +02:00
Gábor Egyed
b03bcb34ec Fix license headers 2015-09-26 13:59:49 +02:00
Christophe Coevoet
0e5aa0eebf Ensure the ClockMock is loaded before using it in the testsuite 2015-09-26 13:03:21 +02:00
Christophe Coevoet
0d72411017 Allow serializer 3.0 in the PropertyInfo component
This makes the component consistent with other components.
2015-09-26 12:59:51 +02:00
Christophe Coevoet
5ef8abc916 Add the replace rules for the security-guard component 2015-09-26 12:41:38 +02:00
Christophe Coevoet
12733cba00 Forbid serializing a Crawler
Unserializing a Crawler instance creates DOM elements in an invalid
state, making the Crawler unusable.
2015-09-26 12:01:36 +02:00
Gábor Egyed
f26425bd91 [Validator] Add Hungarian translation for the BIC constraint 2015-09-26 11:13:29 +02:00
Fabien Potencier
7a142fd17b minor #15665 Fix phpdoc block of NativeSessionStorage class (Diego Campoy)
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #15665).

Discussion
----------

Fix phpdoc block of NativeSessionStorage class

Commits
-------

f181ea8 Fix phpdoc block of NativeSessionStorage class
2015-09-26 10:28:37 +02:00
Diego Campoy
f181ea89e3 Fix phpdoc block of NativeSessionStorage class 2015-09-26 10:28:37 +02:00
Fabien Potencier
ddf79da4f9 bug #15682 [Form] Added exception when setAutoInitialize() is called when locked (jaytaph)
This PR was submitted for the 2.7 branch but it was merged into the 2.3 branch instead (closes #15682).

Discussion
----------

[Form] Added exception when setAutoInitialize() is called when locked

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

It seems that this method was missing a "locked" check, since it changes state and a locked instance should be immutable. However, because `setAutoInitialize()` is useful during the building of a form, it doesn't really matter a lot whether or not it is changed. But for consistency, it would be nicer if this method too was checked.

Commits
-------

c269d6f Added exception when setAutoInitialize is called when locked
2015-09-26 10:25:01 +02:00
Joshua Thijssen
c269d6feda Added exception when setAutoInitialize is called when locked 2015-09-26 10:25:00 +02:00
Fabien Potencier
4a98f287bd feature #15697 [BrowserKit] Added isFollowingRedirects and getMaxRedirects methods (Naktibalda)
This PR was submitted for the 2.3 branch but it was merged into the 2.8 branch instead (closes #15697).

Discussion
----------

[BrowserKit] Added isFollowingRedirects and getMaxRedirects methods

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

Commits
-------

b475607 [BrowserKit] Added isFollowingRedirects and getMaxRedirects methods
2015-09-26 10:21:45 +02:00
Gintautas Miselis
b47560773e [BrowserKit] Added isFollowingRedirects and getMaxRedirects methods 2015-09-26 10:21:42 +02:00
Fabien Potencier
4fcf136079 feature #15719 Deprecate ResourceInterface::getResource() (mpdude)
This PR was merged into the 2.8 branch.

Discussion
----------

Deprecate ResourceInterface::getResource()

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

The return value of this method does not make sense if you do not exactly know about the type of resource at hand. For example, it may be [an array](b49fa129bd/src/Symfony/Component/HttpKernel/Config/EnvParametersResource.php (L57)) or a [file path](87800ae47e/src/Symfony/Component/Config/Resource/FileResource.php (L51)).

As all usages of getResource() within Symfony are in tests of particular Resource implementations anyway, deprecating and later removing this method helps us with simplifying the ResourceInterface (https://github.com/symfony/symfony/issues/7176).

Commits
-------

87c0c7d Deprecate ResourceInterface::getResource()
2015-09-26 10:19:26 +02:00
Fabien Potencier
934a319571 bug #15776 [TwigBridge] fix with_minutes option in time widget (arduanov)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #15776).

Discussion
----------

[TwigBridge] fix with_minutes option in time widget

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

Option with_minutes may be configured in form
link for doc
http://symfony.com/doc/current/reference/forms/types/datetime.html#with-minutes

Commits
-------

f8d53ea Fix with_minutes option in time widget
2015-09-26 10:15:33 +02:00
arduanov
f8d53ea23a Fix with_minutes option in time widget
Option with_minutes may be configured in form
http://symfony.com/doc/current/reference/forms/types/datetime.html#with-minutes
2015-09-26 10:15:32 +02:00
Fabien Potencier
61550dc564 minor #15765 Fixed properties not explicitily declared (deguif)
This PR was merged into the 2.7 branch.

Discussion
----------

Fixed properties not explicitily declared

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

Commits
-------

d2b3fe4 Fixed properties not explicitily declared
2015-09-26 10:14:04 +02:00
Fabien Potencier
44091f579c feature #15818 [WebProfilerBundle] Add collapsed sidebar on small screens (hason)
This PR was merged into the 2.8 branch.

Discussion
----------

[WebProfilerBundle] Add collapsed sidebar on small screens

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

Desktop
![Desktop](https://cloud.githubusercontent.com/assets/288535/9927840/1e4eb7fc-5d22-11e5-9833-f1431ed2855d.png)

Mobile
![Mobile](https://cloud.githubusercontent.com/assets/288535/9927847/23a5c5c4-5d22-11e5-928a-87b167a079b5.png) ![Mobile touch](https://cloud.githubusercontent.com/assets/288535/9927851/2bb800e2-5d22-11e5-9566-c74a23eb9cb5.png)

Commits
-------

184d4f2 [WebProfilerBundle] Added collapsed sidebar on small screens
2015-09-26 10:11:55 +02:00
Fabien Potencier
16ba4579a7 bug #15846 [FrameworkBundle] Advanced search templates of bundles (yethee)
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #15846).

Discussion
----------

[FrameworkBundle] Advanced search templates of bundles

| 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

It uses two different locations to search templates of bundle by `TemplateFinder`, as described in the documentation.

Useful for TwigBundle, in cases when uses the custom templates for error pages.

Commits
-------

3ba1460 [FrameworkBundle] Advanced search templates of bundles
2015-09-26 10:02:47 +02:00
yethee
3ba14604a7 [FrameworkBundle] Advanced search templates of bundles
It uses two different locations to search templates of bundle,
as described in the documentation.
2015-09-26 10:02:46 +02:00
Fabien Potencier
59ee12c234 feature #15858 [PropertyInfo] Import the component (dunglas)
This PR was squashed before being merged into the 2.8 branch (closes #15858).

Discussion
----------

[PropertyInfo] Import the component

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

As discussed with @fabpot (see #14844), this PR moves [dunglas/php-property-info](https://github.com/dunglas/php-property-info) under the Symfony umbrella.

Rationale behind this new component (extracted from README.md):

PHP doesn't support explicit type definition. This is annoying, especially when doing meta programming.
Various libraries including but not limited to Doctrine ORM and the Symfony Validator provide their own type managing
system.
This library extracts various information including the type and documentation from PHP class property from metadata of popular sources:

* Setter method with type hint
* PHPDoc DocBlock
* Doctrine ORM mapping (annotation, XML, YML or custom format)
* PHP 7 scalar typehint and return type
* Serializer metadata

**Usage:**

```php
<?php

// Use Composer autoload
require 'vendor/autoload.php';

use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\Id;
use Symfony\Component\PropertyInfo\Extractors\DoctrineExtractor;
use Symfony\Component\PropertyInfo\Extractors\PhpDocExtractor;
use Symfony\Component\PropertyInfo\Extractors\ReflectionExtractor;
use Symfony\Component\PropertyInfo\PropertyInfo;

/**
 * @Entity
 */
class MyTestClass
{
    /**
     * @Id
     * @Column(type="integer")
     */
    public $id;
    /**
     * This is a date (short description).
     *
     * With a long description.
     *
     * @var \DateTime
     */
    public $foo;
    private $bar;

    public function setBar(\SplFileInfo $bar)
    {
        $this->bar = $bar;
    }
}

// Doctrine initialization (necessary only to use the Doctrine Extractor)
$config = Setup::createAnnotationMetadataConfiguration([__DIR__], true);
$entityManager = EntityManager::create([
    'driver' => 'pdo_sqlite',
    // ...
], $config);

$doctrineExtractor = new DoctrineExtractor($entityManager->getMetadataFactory());
$phpDocExtractor = new PhpDocExtractor();
$reflectionExtractor = new ReflectionExtractor();

$propertyInfo = new PropertyInfo(
    array($reflectionExtractor),
    array($doctrineExtractor, $phpDocExtractor, $reflectionExtractor),
    array($phpDocExtractor),
    array($reflectionExtractor)
);

var_dump($propertyInfo->getProperties('MyTestClass'));
var_dump($propertyInfo->getTypes('MyTestClass', 'foo'));
var_dump($propertyInfo->getTypes('MyTestClass', 'id'));
var_dump($propertyInfo->getTypes('MyTestClass', 'bar'));
var_dump($propertyInfo->isReadable('MyTestClass', 'id'));
var_dump($propertyInfo->isReadable('MyTestClass', 'bar'));
var_dump($propertyInfo->isWritable('MyTestClass', 'foo'));
var_dump($propertyInfo->isWritable('MyTestClass', 'bar'));
var_dump($propertyInfo->getShortDescription('MyTestClass', 'foo'));
var_dump($propertyInfo->getLongDescription('MyTestClass', 'foo'));
```

Output:

```
array(3) {
  [0] =>
  string(2) "id"
  [1] =>
  string(3) "foo"
  [2] =>
  string(3) "Bar"
}
array(1) {
  [0] =>
  class Symfony\Component\PropertyInfo\Type#36 (6) {
    private $builtinType =>
    string(6) "object"
    private $nullable =>
    bool(false)
    private $class =>
    string(8) "DateTime"
    private $collection =>
    bool(false)
    private $collectionKeyType =>
    NULL
    private $collectionValueType =>
    NULL
  }
}
array(1) {
  [0] =>
  class Symfony\Component\PropertyInfo\Type#36 (6) {
    private $builtinType =>
    string(3) "int"
    private $nullable =>
    bool(false)
    private $class =>
    NULL
    private $collection =>
    bool(false)
    private $collectionKeyType =>
    NULL
    private $collectionValueType =>
    NULL
  }
}
array(1) {
  [0] =>
  class Symfony\Component\PropertyInfo\Type#245 (6) {
    private $builtinType =>
    string(6) "object"
    private $nullable =>
    bool(false)
    private $class =>
    string(11) "SplFileInfo"
    private $collection =>
    bool(false)
    private $collectionKeyType =>
    NULL
    private $collectionValueType =>
    NULL
  }
}
bool(true)
bool(false)
bool(true)
bool(true)
string(35) "This is a date (short description)."
string(24) "With a long description."
```

Commits
-------

f1eb185 [PropertyInfo] Import the component
2015-09-26 09:46:23 +02:00
Kévin Dunglas
f1eb185236 [PropertyInfo] Import the component 2015-09-26 09:46:20 +02:00
Fabien Potencier
25dccf1bb5 minor #15875 Use random_bytes function if it is available for random number generation (pierredup)
This PR was merged into the 2.3 branch.

Discussion
----------

Use random_bytes function if it is available for random number generation

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

This is an attempt to use the random_bytes function when generating secure random numbers. This function is included in PHP 7 or through the "paragonie/random_compat" library.

This PR only adds support to use the function if it is available. Changes that can be added is to add a hard dependency on the paragonie/random_compat library, so all current functionality can be deprecated.

Commits
-------

6a217dc Use random_bytes function if it is available for random number generation
2015-09-26 09:44:41 +02:00
Fabien Potencier
8209754e4e minor #15893 Merged LegacySecurityContext tests (WouterJ)
This PR was merged into the 2.8 branch.

Discussion
----------

Merged LegacySecurityContext tests

I've no idea why this test was introduced in the wrong namespace in 2.8, but I merged it in the correct test case now.

Commits
-------

2c4da3c Merged LegacySecurityContext tests
2015-09-26 09:34:51 +02:00
Fabien Potencier
058bad4c28 bug #15895 [Security] Allow user providers to be defined in many files (lyrixx)
This PR was merged into the 2.3 branch.

Discussion
----------

[Security] Allow user providers to be defined in many files

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

Commits
-------

9165191 [Security] Allow user providers to be defined in many files
2015-09-26 09:28:39 +02:00
Fabien Potencier
7079aa9e96 feature #15892 deprecated the Shell Console class (fabpot)
This PR was merged into the 2.8 branch.

Discussion
----------

deprecated the Shell Console class

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

Commits
-------

1c17928 deprecated the Shell Console class
2015-09-26 09:27:31 +02:00
Fabien Potencier
1c17928e58 deprecated the Shell Console class 2015-09-26 09:26:13 +02:00
Fabien Potencier
825490a8c8 Merge branch '2.7' into 2.8
* 2.7:
  bumped Symfony version to 2.7.6
  updated VERSION for 2.7.5
  updated CHANGELOG for 2.7.5
  bumped Symfony version to 2.3.34
  updated VERSION for 2.3.33
  update CONTRIBUTORS for 2.3.33
  updated CHANGELOG for 2.3.33
2015-09-26 09:14:46 +02:00
Grégoire Pineau
9165191816 [Security] Allow user providers to be defined in many files 2015-09-25 15:16:17 +02:00
Fabien Potencier
06b4938046 feature #15519 [Validator] added BIC (SWIFT-BIC) validation constraint (mvhirsch)
This PR was squashed before being merged into the 2.8 branch (closes #15519).

Discussion
----------

[Validator] added BIC (SWIFT-BIC) validation constraint

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/5623

I've added the BIC validator, because we do often need validation for IBAN and BIC values. Since the IBAN validation was already included into Symfony, I was asking myself: why not contribute my  BIC validator to the community? So here we go ...

It depends on ISO 9362 as described on [Wikipedia](https://en.wikipedia.org/wiki/ISO_9362#Structure). It validates the structure based on alphabetic/alphanumeric values and the value's length.

Todo-list:
- [x] submit changes to the documentation

Commits
-------

d6471b3 [Validator] added BIC (SWIFT-BIC) validation constraint
2015-09-25 14:16:01 +02:00
Michael Hirschler
d6471b3338 [Validator] added BIC (SWIFT-BIC) validation constraint 2015-09-25 14:15:58 +02:00
Fabien Potencier
564f06b665 feature #12587 [TwigBridge] Foundation form layout integration (totophe)
This PR was submitted for the 2.7 branch but it was merged into the 2.8 branch instead (closes #12587).

Discussion
----------

[TwigBridge] Foundation form layout integration

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| License       | MIT

As symfony integrate in its roots Bootstrap layout, why not also include Foundation layout? I think it's not a matters of including all the css frameworks in symfony but at least having two instead of one would be interesting to have a basic choice.

@hhamon told me I should create this PR :-D :-p ;-)

Commits
-------

7653d95 [TwigBridge] Foundation form layout integration
2015-09-25 14:01:54 +02:00
Jean-Christophe Cuvelier [Artack]
7653d95450 [TwigBridge] Foundation form layout integration 2015-09-25 14:01:53 +02:00