8000 [Doc] Use Github Markdown syntax highlighting by lologhi · Pull Request #11999 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Doc] Use Github Markdown syntax highlighting #11999

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 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Add syntax highlighting to other Upgrade files
  • Loading branch information
lologhi committed Sep 25, 2014
commit cdfe7561deddba0ab0b564b63b3f88c44deeaf5e
4 changes: 2 additions & 2 deletions UPGRADE-2.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,13 +612,13 @@

Before:

```html
```php
<?php echo $view['form']->renderBlock('widget_attributes') ?>
```

After:

```html
```php
<?php echo $view['form']->block($form, 'widget_attributes') ?>
```

Expand Down
40 changes: 20 additions & 20 deletions UPGRADE-2.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Form

Before:

```
```php
// equivalent notations for validating in group "Default"
"validation_groups" => null
"validation_groups" => "Default"
Expand All @@ -27,7 +27,7 @@ Form

After:

```
```php
// equivalent notations for validating in group "Default"
"validation_groups" => null
"validation_groups" => "Default"
Expand All @@ -41,7 +41,7 @@ Form

Before:

```
```php
use Symfony\Component\Form\DataMapperInterface;

class MyDataMapper
Expand All @@ -60,7 +60,7 @@ Form

After:

```
```php
use Symfony\Component\Form\DataMapperInterface;

class MyDataMapper
Expand All @@ -84,7 +84,7 @@ Form

Before:

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

public function mapFormsToData(array $forms, $data)
Expand All @@ -101,7 +101,7 @@ Form

After:

```
```php
public function mapFormsToData($forms, $data)
{
foreach ($forms as $form) {
Expand All @@ -121,7 +121,7 @@ Form

Before:

```
```php
$form = $factory->create('form');
$form->add($factory->createNamed('field', 'text'));
```
Expand All @@ -135,7 +135,7 @@ Form

After (Alternative 1):

```
```php
$form = $factory->create('form');
$form->add($factory->createNamed('field', 'text', array(), array(
'auto_initialize' => false,
Expand All @@ -147,7 +147,7 @@ Form

After (Alternative 2):

```
```php
$builder = $factory->createBuilder('form');
$builder->add($factory->createBuilder('field', 'text'));
$form = $builder->getForm();
Expand All @@ -157,14 +157,14 @@ Form

After (Alternative 3):

```
```php
$form = $factory->create('form');
$form->add('field', 'text');
```

After (Alternative 4):

```
```php
$builder = $factory->createBuilder('form');
$builder->add('field', 'text');
$form = $builder->getForm();
Expand All @@ -180,15 +180,15 @@ Form

Before:

```
```php
$builder->add('field', 'text', array(
'data' => $defaultData ?: null,
));
```

After:

```
```php
$options = array();
if ($defaultData) {
$options['data'] = $defaultData;
Expand All @@ -203,7 +203,7 @@ PropertyAccess
even if a non-public match was found. This means that the property "author"
in the following class will now correctly be found:

```
```php
class Article
{
public $author;
Expand All @@ -224,7 +224,7 @@ PropertyAccess

Before:

```
```php
use Symfony\Component\PropertyAccess\Exception\PropertyAccessDeniedException;
use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException;

Expand All @@ -239,7 +239,7 @@ PropertyAccess

After:

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

try {
Expand All @@ -257,15 +257,15 @@ DomCrawler

Before:

```
```php
$data = $crawler->each(function ($node, $i) {
return $node->nodeValue;
});
```

After:

```
```php
$data = $crawler->each(function ($crawler, $i) {
return $crawler->text();
});
Expand All @@ -280,13 +280,13 @@ Console

Before:

```
```php
if (OutputInterface::VERBOSITY_VERBOSE === $output->getVerbosity()) { ... }
```

After:

```
```php
if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { ... }
```

Expand Down
36 changes: 18 additions & 18 deletions UPGRADE-2.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Form

Before:

```
```php
$errors = array_map($callback, $form->getErrors());
```

After:

```
```php
$errors = array_map($callback, iterator_to_array($form->getErrors()));
```

Expand All @@ -33,27 +33,27 @@ Form

Before:

```
```php
public function getErrors()
{
```

After:

```
```php
public function getErrors($deep = false, $flatten = true)
{
```

Before:

```
```twig
{% if form.vars.errors %}
```

After:

```
```twig
{% if form.vars.errors|length %}
```

Expand Down Expand Up @@ -114,7 +114,7 @@ Validator

Strict email validation has to be explicitly activated in the configuration file by adding

```
```yaml
framework:
//...
validation:
Expand All @@ -125,7 +125,7 @@ Validator

Also you have to add to your composer.json:

```
```json
"egulias/email-validator": "~1.2"
```

Expand All @@ -137,14 +137,14 @@ Validator

Before:

```
```php
$sequence = $metadata->getGroupSequence();
$result = array_map($callback, $sequence);
```

After:

```
```php
$sequence = iterator_to_array($metadata->getGroupSequence());
$result = array_map($callback, $sequence);
```
Expand All @@ -155,7 +155,7 @@ Validator

Before:

```
```php
public function setGroupSequence(array $groups)
{
// ...
Expand All @@ -164,7 +164,7 @@ Validator

After:

```
```php
public function setGroupSequence($groupSequence)
{
// ...
Expand All @@ -180,7 +180,7 @@ Validator
You can choose the desired API via the new "api" entry in
app/config/config.yml:

```
```yaml
framework:
validation:
enabled: true
Expand All @@ -190,7 +190,7 @@ Validator
When running PHP 5.3.9 or higher, Symfony will then use an implementation
that supports both the old API and the new one:

```
```yaml
framework:
validation:
enabled: true
Expand All @@ -200,7 +200,7 @@ Validator
When running PHP lower than 5.3.9, that compatibility layer is not supported.
On those versions, the old implementation will be used instead:

```
```yaml
framework:
validation:
enabled: true
Expand All @@ -211,7 +211,7 @@ Validator
also set the API to 2.5. In that case, the backwards compatibility layer
will not be activated:

```
```yaml
framework:
validation:
enabled: true
Expand All @@ -221,7 +221,7 @@ Validator
When using the validator outside of the Symfony full-stack framework, the
desired API can be selected using `setApiVersion()` on the validator builder:

```
```php
// Previous implementation
$validator = Validation::createValidatorBuilder()
->setApiVersion(Validation::API_VERSION_2_4)
Expand All @@ -247,7 +247,7 @@ Yaml Component

Example:

```
```yaml
parentElement:
firstChild: foo
secondChild: 123
Expand Down
Loading
0