Skip to content

Commit

Permalink
Merge branch 'pull/12053' into 2.3
Browse files Browse the repository at this point in the history
* pull/12053:
  [Doc] Use Markdown syntax highlighting

Conflicts:
	src/Symfony/Component/Finder/README.md
  • Loading branch information
fabpot committed Oct 1, 2014
2 parents 03f3dec + 638ce84 commit 0e7694e
Show file tree
Hide file tree
Showing 21 changed files with 633 additions and 533 deletions.
200 changes: 100 additions & 100 deletions UPGRADE-2.1.md

Large diffs are not rendered by default.

88 changes: 44 additions & 44 deletions UPGRADE-2.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

Before:

```
```jinja
{% render 'BlogBundle:Post:list' with { 'limit': 2 }, { 'alt': 'BlogBundle:Post:error' } %}
```

After:

```
```jinja
{% render controller('BlogBundle:Post:list', { 'limit': 2 }), { 'alt': 'BlogBundle:Post:error' } %}
{# Or: #}
{{ render(controller('BlogBundle:Post:list', { 'limit': 2 }), { 'alt': 'BlogBundle:Post:error'}) }}
Expand All @@ -29,15 +29,15 @@

Before:

```
```jinja
{% render 'BlogBundle:Post:list' with { 'limit': 2 }, {'standalone': true} %}
{% render 'BlogBundle:Post:list' with { 'limit': 2 }, {'standalone': false} %}
{% render 'BlogBundle:Post:list' with { 'limit': 2 }, {'standalone': 'js'} %}
```

After:

```
```jinja
{{ render(controller('BlogBundle:Post:list', { 'limit': 2 }), { 'strategy': 'esi'}) }}
{{ render(controller('BlogBundle:Post:list', { 'limit': 2 }), { 'strategy': 'inline'}) }}
{{ render(controller('BlogBundle:Post:list', { 'limit': 2 }), { 'strategy': 'hinclude'}) }}
Expand Down Expand Up @@ -65,7 +65,7 @@
You should now use the `AcceptHeader` class which give you fluent methods to
parse request accept-* headers. Some examples:

```
```php
$accept = AcceptHeader::fromString($request->headers->get('Accept'));
if ($accept->has('text/html') {
$item = $accept->get('html');
Expand Down Expand Up @@ -95,7 +95,7 @@

Before:

```
```jinja
{{
error.messagePluralization is null
? error.messageTemplate|trans(error.messageParameters, 'validators')
Expand All @@ -105,7 +105,7 @@

After:

```
```jinja
{{ error.message }}
```

Expand All @@ -117,7 +117,7 @@

Before:

```
```php
use Symfony\Component\Form\Extensions\Core\DataMapper\PropertyPathMapper;

class CustomMapper extends PropertyPathMapper
Expand All @@ -133,7 +133,7 @@

After:

```
```php
use Symfony\Component\Form\Extensions\Core\DataMapper\PropertyPathMapper;

class CustomMapper extends PropertyPathMapper
Expand Down Expand Up @@ -163,7 +163,7 @@

Before:

```
```php
use Symfony\Component\Form\Util\PropertyPath;
use Symfony\Component\Form\Util\PropertyPathBuilder;
use Symfony\Component\Form\Util\PropertyPathInterface;
Expand All @@ -176,7 +176,7 @@

After:

```
```php
use Symfony\Component\PropertyAccess\PropertyPath;
use Symfony\Component\PropertyAccess\PropertyPathBuilder;
use Symfony\Component\PropertyAccess\PropertyPathInterface;
Expand All @@ -192,15 +192,15 @@

Before:

```
```php
use Symfony\Component\Form\Util\FormUtil;

$singular = FormUtil::singularify($plural);
```

After:

```
```php
use Symfony\Component\PropertyAccess\StringUtil;

$singular = StringUtil::singularify($plural);
Expand All @@ -211,7 +211,7 @@

Before:

```
```php
use Symfony\Component\Form\Util\PropertyPath;

$propertyPath = new PropertyPath('some.path');
Expand All @@ -222,7 +222,7 @@

After (alternative 1):

```
```php
use Symfony\Component\PropertyAccess\PropertyAccess;

$propertyAccessor = PropertyAccess::getPropertyAccessor();
Expand All @@ -233,7 +233,7 @@

After (alternative 2):

```
```php
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\PropertyAccess\PropertyPath;

Expand All @@ -253,7 +253,7 @@

Before:

```
```php
$rootCollection = new RouteCollection();
$subCollection = new RouteCollection();
$rootCollection->addCollection($subCollection);
Expand All @@ -262,7 +262,7 @@

After:

```
```php
$rootCollection = new RouteCollection();
$subCollection = new RouteCollection();
$subCollection->add('foo', new Route('/foo'));
Expand All @@ -272,7 +272,7 @@
Also one must call `addCollection` from the bottom to the top hierarchy.
So the correct sequence is the following (and not the reverse):

```
```php
$childCollection->addCollection($grandchildCollection);
$rootCollection->addCollection($childCollection);
```
Expand All @@ -298,7 +298,7 @@
use-case instead.
Before: `$parentCollection->addCollection($collection, '/prefix', array(...), array(...))`
After:
```
```php
$collection->addPrefix('/prefix', array(...), array(...));
$parentCollection->addCollection($collection);
```
Expand All @@ -312,15 +312,15 @@

Before:

```
```php
use Symfony\Component\Validator\ExecutionContext;

public function validateCustomLogic(ExecutionContext $context)
```

After:

```
```php
use Symfony\Component\Validator\ExecutionContextInterface;

public function validateCustomLogic(ExecutionContextInterface $context)
Expand All @@ -331,7 +331,7 @@

Before:

```
```php
use Symfony\Component\Validator\ConstraintValidatorInterface;
use Symfony\Component\Validator\ExecutionContext;

Expand All @@ -346,7 +346,7 @@

After:

```
```php
use Symfony\Component\Validator\ConstraintValidatorInterface;
use Symfony\Component\Validator\ExecutionContextInterface;

Expand Down Expand Up @@ -391,7 +391,7 @@

Before:

```
```php
use Symfony\Component\Validator\Mapping\ClassMetadataFactoryInterface;

class MyMetadataFactory implements ClassMetadataFactoryInterface
Expand All @@ -405,7 +405,7 @@

After:

```
```php
use Symfony\Component\Validator\MetadataFactoryInterface;
use Symfony\Component\Validator\Exception\NoSuchMetadataException;

Expand All @@ -432,14 +432,14 @@

Before:

```
```php
$metadataFactory = $validator->getMetadataFactory();
$metadata = $metadataFactory->getClassMetadata('Vendor\MyClass');
```

After:

```
```php
$metadataFactory = $validator->getMetadataFactory();
$metadata = $metadataFactory->getMetadataFor('Vendor\MyClass');
```
Expand All @@ -451,7 +451,7 @@

Before:

```
```php
use Symfony\Component\Validator\ExecutionContext;

public function validateCustomLogic(ExecutionContext $context)
Expand All @@ -471,7 +471,7 @@

After:

```
```php
use Symfony\Component\Validator\ExecutionContextInterface;

public function validateCustomLogic(ExecutionContextInterface $context)
Expand All @@ -488,7 +488,7 @@

Before:

```
```php
use Symfony\Component\Validator\ExecutionContext;

public function validateCustomLogic(ExecutionContext $context)
Expand All @@ -501,7 +501,7 @@

After:

```
```php
use Symfony\Component\Validator\ExecutionContextInterface;

public function validateCustomLogic(ExecutionContextInterface $context)
Expand All @@ -519,7 +519,7 @@

Before:

```
```php
use Symfony\Component\Validator\ExecutionContext;

public function validateCustomLogic(ExecutionContext $context)
Expand All @@ -534,7 +534,7 @@

After:

```
```php
use Symfony\Component\Validator\ExecutionContextInterface;

public function validateCustomLogic(ExecutionContextInterface $context)
Expand All @@ -553,20 +553,20 @@

Before:

```
```php
<?php echo $view['actions']->render('BlogBundle:Post:list', array('limit' => 2), array('alt' => 'BlogBundle:Post:error')) ?>
```

After:

```
```php
<?php echo $view['actions']->render($view['router']->generate('post_list', array('limit' => 2)), array('alt' => 'BlogBundle:Post:error')) ?>
```

where `post_list` is the route name for the `BlogBundle:Post:list`
controller, or if you don't want to create a route:

```
```php
<?php echo $view['actions']->render(new ControllerReference('BlogBundle:Post:list', array('limit' => 2)), array('alt' => 'BlogBundle:Post:error')) ?>
```

Expand All @@ -577,15 +577,15 @@

Before:

```
```yaml
# app/config/config.yml
framework:
trust_proxy_headers: false
```
After:
```
```yaml
# app/config/config.yml
framework:
trusted_proxies: ['127.0.0.1', '10.0.0.1'] # a list of proxy IPs you trust
Expand All @@ -598,21 +598,21 @@
Before:
```
```php
use Symfony\Component\Security\Core\Validator\Constraint\UserPassword;
```

After: (note the `s` at the end of `Constraint`)

```
```php
use Symfony\Component\Security\Core\Validator\Constraints\UserPassword;
```

* The new ``UserPassword`` validator constraint class now accepts a new
``service`` option that allows to specify a custom validator service name in
order to validate the current logged-in user's password.

```
```php
use Symfony\Component\Security\Core\Validator\Constraints\UserPassword;
$constraint = new UserPassword(array(
Expand All @@ -628,14 +628,14 @@

Before:

```
```php
use Symfony\Component\Security\Core\Validator\Constraint\UserPassword;
use Symfony\Component\Security\Core\Validator\Constraint\UserPasswordValidator;
```

After:

```
```php
use Symfony\Component\Security\Core\Validator\Constraints\UserPassword;
use Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator;
```
Expand Down
Loading

0 comments on commit 0e7694e

Please sign in to comment.