10000 merged 2.0 · symfony/symfony@5d6a7d3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5d6a7d3

Browse files
committed
merged 2.0
2 parents d08c2ef + 4316595 commit 5d6a7d3

File tree

99 files changed

+869
-183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+869
-183
lines changed

check_cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ foreach ($finder as $file) {
9393
$new .= "\n";
9494
}
9595

96+
// [Structure] elseif, not else if
97+
$new = preg_replace('/} else if \(/', '} elseif (', $new);
98+
9699
if ($new != $old) {
97100
$count++;
98101

src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ protected function registerMappingDrivers($objectManager, ContainerBuilder $cont
196196
$args[0] = array_merge(array_values($driverPaths), $args[0]);
197197
}
198198
$mappingDriverDef->setArguments($args);
199-
} else if ($driverType == 'annotation') {
199+
} elseif ($driverType == 'annotation') {
200200
$mappingDriverDef = new Definition('%'.$this->getObjectManagerElementName('metadata.'.$driverType.'.class%'), array(
201201
new Reference($this->getObjectManagerElementName('metadata.annotation_reader')),
202202
array_values($driverPaths)

src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ protected function load()
150150

151151
if (is_array($this->choices)) {
152152
$entities = $this->choices;
153-
} else if ($qb = $this->queryBuilder) {
153+
} elseif ($qb = $this->queryBuilder) {
154154
$entities = $qb->getQuery()->execute();
155155
} else {
156156
$entities = $this->em->getRepository($this->class)->findAll();
@@ -305,9 +305,9 @@ public function getEntity($key)
305305
$entities = $this->getEntities();
306306

307307
return isset($entities[$key]) ? $entities[$key] : null;
308-
} else if ($this->entities) {
308+
} elseif ($this->entities) {
309309
return isset($this->entities[$key]) ? $this->entities[$key] : null;
310-
} else if ($qb = $this->queryBuilder) {
310+
} elseif ($qb = $this->queryBuilder) {
311311
// should we clone the builder?
312312
$alias = $qb->getRootAlias();
313313
$where = $qb->expr()->eq($alias.'.'.current($this->identifier), $key);

src/Symfony/Bridge/Doctrine/Form/EventListener/MergeCollectionListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function onBindNormData(FilterDataEvent $event)
3838

3939
if (!$collection) {
4040
$collection = $data;
41-
} else if (count($data) === 0) {
41+
} elseif (count($data) === 0) {
4242
$collection->clear();
4343
} else {
4444
// merge $data into $collection

src/Symfony/Bridge/Doctrine/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Doctrine Bridge
2+
===============
3+
4+
Provides integration for [Doctrine](http://www.doctrine-project.org/) with
5+
various Symfony2 components.
6+
7+
Resources
8+
---------
9+
10+
Unit tests:
11+
12+
https://github.com/symfony/symfony/tree/master/tests/Symfony/Tests/Bridge/Doctrine

src/Symfony/Bridge/Monolog/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Monolog Bridge
2+
==============
3+
4+
Provides integration for Monolog with various Symfony2 components.
5+
6+
Resources
7+
---------
8+
9+
Unit tests:
10+
11+
https://github.com/symfony/symfony/tree/master/tests/Symfony/Tests/Bridge/Monolog

src/Symfony/Bridge/Twig/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Twig Bridge
2+
===========
3+
4+
Provides integration for [Twig](http://twig.sensiolabs.org/) with various
5+
Symfony2 components.
6+
7+
Resources
8+
---------
9+
10+
Unit tests:
11+
12+
https://github.com/symfony/symfony/tree/master/tests/Symfony/Tests/Bridge/Twig

src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function abbrMethod($method)
8888
if (false !== strpos($method, '::')) {
8989
list($class, $method) = explode('::', $method, 2);
9090
$result = sprintf("%s::%s()", $this->abbrClass($class), $method);
91-
} else if ('Closure' === $method) {
91+
} elseif ('Closure' === $method) {
9292
$result = sprintf("<abbr title=\"%s\">%s</abbr>", $method, $method);
9393
} else {
9494
$result = sprintf("<abbr title=\"%s\">%s</abbr>()", $method, $method);

src/Symfony/Bundle/FrameworkBundle/Templating/TemplateNameParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function parse($name)
4545
{
4646
if ($name instanceof TemplateReferenceInterface) {
4747
return $name;
48-
} else if (isset($this->cache[$name])) {
48+
} elseif (isset($this->cache[$name])) {
4949
return $this->cache[$name];
5050
}
5151

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ private function createFirewall(ContainerBuilder $container, $id, $firewall, &$a
240240
$matcher = null;
241241
if (isset($firewall['request_matcher'])) {
242242
$matcher = new Reference($firewall['request_matcher']);
243-
} else if (isset($firewall['pattern'])) {
243+
} elseif (isset($firewall['pattern'])) {
244244
$matcher = $this->createRequestMatcher($container, $firewall['pattern']);
245245
}
246246

@@ -524,7 +524,7 @@ private function createExceptionListener($container, $config, $id, $defaultEntry
524524
// access denied handler setup
525525
if (isset($config['access_denied_handler'])) {
526526
$listener->replaceArgument(5, new Reference($config['access_denied_handler']));
527-
} else if (isset($config['access_denied_url'])) {
527+
} elseif (isset($config['access_denied_url'])) {
528528
$listener->replaceArgument(4, $config['access_denied_url']);
529529
}
530530

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function testAccess()
110110
if (1 === $i) {
111111
$this->assertEquals(array('ROLE_USER'), $roles);
112112
$this->assertEquals('https', $channel);
113-
} else if (2 === $i) {
113+
} elseif (2 === $i) {
114114
$this->assertEquals(array('IS_AUTHENTICATED_ANONYMOUSLY'), $roles);
115115
$this->assertNull($channel);
116116
}

src/Symfony/Bundle/WebProfilerBundle/Resources/public/css/profiler.css

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ fieldset {
7272
}
7373

7474
abbr {
75-
border-bottom: 1px dotted #000000;
75+
border-bottom: 1px dotted #000;
7676
cursor: help;
7777
}
7878

@@ -160,6 +160,7 @@ abbr {
160160
background: #d1d1d1 url(../images/profiler/bg_submenu.gif) repeat-x 0 0;
161161
}
162162

163+
#navigation div:first-child,
163164
#menu_profiler li:first-child,
164165
#menu_profiler li:first-child a,
165 A2A7 166
#menu_profiler li:first-child a span.label {
@@ -253,7 +254,7 @@ table th.value {
253254

254255
#content #main {
255256
padding: 0;
256-
background-color: #FFFFFF;
257+
background-color: #FFF;
257258
border: 1px solid #dfdfdf;
258259
}
259260

@@ -316,7 +317,7 @@ td.main, td.menu {
316317
margin-right: 10px;
317318
font-size: 12px;
318319
border: 1px solid #dadada;
319-
background: #FFFFFF url(../images/profiler/input_bg.gif) repeat-x left top;
320+
background: #FFF url(../images/profiler/input_bg.gif) repeat-x left top;
320321
padding: 5px 6px;
321322
color: #565656;
322323
}
@@ -372,6 +373,11 @@ td.main, td.menu {
372373
background: transparent url(../images/profiler/btn_bg.png) repeat-x top left;
373374
}
374375

376+
#navigation div:first-child {
377+
margin: 0 0 20px;
378+
border-top: 0;
379+
}
380+
375381
#navigation .search {
376382
padding-top: 15px;
377383
float: none;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
BrowserKit Component
2+
====================
3+
4+
BrowserKit simulates the behavior of a web browser.
5+
6+
The component only provide an abstract client and does not provide any
7+
"default" backend for the HTTP layer.
8+
9+
Resources
10+
---------
11+
12+
For a simple implementation of a browser based on an HTTP layer, have a look
13+
at [Goutte](https://github.com/fabpot/Goutte).
14+
15+
For an implementation based on HttpKernelInterface, have a look at the
16+
[Client](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Client.php)
17+
provided by the HttpKernel component.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
ClassLoader Component
2+
=====================
3+
4+
ClassLoader loads your project classes automatically if they follow some
5+
standard PHP conventions.
6+
7+
The Universal ClassLoader is able to autoload classes that implement the PSR-0
8+
standard or the PEAR naming convention.
9+
10+
First, register the autoloader:
11+
12+
require_once __DIR__.'/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
13+
14+
use Symfony\Component\ClassLoader\UniversalClassLoader;
15+
16+
$loader = new UniversalClassLoader();
17+
$loader->register();
18+
19+
Then, register some namespaces with the `registerNamespace()` method:
20+
21+
$loader->registerNamespace('Symfony', __DIR__.'/src');
22+
$loader->registerNamespace('Monolog', __DIR__.'/vendor/monolog/src');
23+
24+
The `registerNamespace()` method takes a namespace prefix and a path where to
25+
look for the classes as arguments.
26+
27+
You can also register a sub-namespaces:
28+
29+
$loader->registerNamespace('Doctrine\\Common', __DIR__.'/vendor/doctrine-common/lib');
30+
31+
The order of registration is significant and the first registered namespace
32+
takes precedence over later registered one.
33+
34+
You can also register more than one path for a given namespace:
35+
36+
$loader->registerNamespace('Symfony', array(__DIR__.'/src', __DIR__.'/symfony/src'));
37+
38+
Alternatively, you can use the `registerNamespaces()` method to register more
39+
than one namespace at once:
40+
41+
$loader->registerNamespaces(array(
42+
'Symfony' => array(__DIR__.'/src', __DIR__.'/symfony/src'),
43+
'Doctrine\\Common' => __DIR__.'/vendor/doctrine-common/lib',
44+
'Doctrine' => __DIR__.'/vendor/doctrine/lib',
45+
'Monolog' => __DIR__.'/vendor/monolog/src',
46+
));
47+
48+
For better performance, you can use the APC based version of the universal
49+
class loader:
50+
51+
require_once __DIR__.'/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
52+
require_once __DIR__.'/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php';
53+
54+
use Symfony\Component\ClassLoader\ApcUniversalClassLoader;
55+
56+
$loader = new ApcUniversalClassLoader('apc.prefix.');
57+
58+
Furthermore, the component provides tools to aggregate classes into a single
59+
file, which is especially useful to improve performance on servers that do not
60+
provide byte caches.

src/Symfony/Component/Config/Definition/PrototypedArrayNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ protected function normalizeValue($value)
217217
$ex->setPath($this->getPath());
218218

219219
throw $ex;
220-
} else if (isset($v[$this->keyAttribute])) {
220+
} elseif (isset($v[$this->keyAttribute])) {
221221
$k = $v[$this->keyAttribute];
222222

223223
// remove the key attribute when required
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Config Component
2+
================
3+
4+
Config provides the infrastructure for loading configurations from different
5+
data sources and optionally monitoring these data sources for changes. There
6+
are additional tools for validating, normalizing and handling of defaults that
7+
can optionally be used to convert from different formats to arrays.
8+
9+
Resources
10+
---------
11+
12+
Unit tests:
13+
14+
https://github.com/symfony/symfony/tree/master/tests/Symfony/Tests/Component/Config

src/Symfony/Component/Console/Input/InputArgument.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct($name, $mode = null, $description = '', $default = n
4545
{
4646
if (null === $mode) {
4747
$mode = self::OPTIONAL;
48-
} else if (!is_int($mode) || $mode > 7 || $mode < 1) {
48+
} elseif (!is_int($mode) || $mode > 7 || $mode < 1) {
4949
throw new \InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode));
5050
}
5151

@@ -102,7 +102,7 @@ public function setDefault($default = null)
102102
if ($this->isArray()) {
103103
if (null === $default) {
104104
$default = array();
105-
} else if (!is_array($default)) {
105+
} elseif (!is_array($default)) {
106106
throw new \LogicException('A default value for an array argument must be an array.');
107107
}
108108
}

src/Symfony/Component/Console/Input/InputDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public function addOption(InputOption $option)
263263
{
264264
if (isset($this->options[$option->getName()])) {
265265
throw new \LogicException(sprintf('An option named "%s" already exist.', $option->getName()));
266-
} else if (isset($this->shortcuts[$option->getShortcut()])) {
266+
} elseif (isset($this->shortcuts[$option->getShortcut()])) {
267267
throw new \LogicException(sprintf('An option with shortcut "%s" already exist.', $option->getShortcut()));
268268
}
269269

src/Symfony/Component/Console/Input/InputOption.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function __construct($name, $shortcut = null, $mode = null, $description
6262

6363
if (null === $mode) {
6464
$mode = self::VALUE_NONE;
65-
} else if (!is_int($mode) || $mode > 15 || $mode < 1) {
65+
} elseif (!is_int($mode) || $mode > 15 || $mode < 1) {
6666
throw new \InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode));
6767
}
6868

src/Symfony/Component/Console/Output/ConsoleOutput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
4444
*
4545
* @api
4646
*/
47-
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatter $formatter = null)
47+
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
4848
{
4949
parent::__construct(fopen('php://stdout', 'w'), $verbosity, $decorated, $formatter);
5050
$this->stderr = new StreamOutput(fopen('php://stderr', 'w'), $verbosity, $decorated, $formatter);

src/Symfony/Component/Console/Output/StreamOutput.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Console\Output;
1313

14-
use Symfony\Component\Console\Formatter\OutputFormatter;
14+
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
1515

1616
/**
1717
* StreamOutput writes the output to a given stream.
@@ -45,7 +45,7 @@ class StreamOutput extends Output
4545
*
4646
* @api
4747
*/
48-
public function __construct($stream, $verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatter $formatter = null)
48+
public function __construct($stream, $verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
4949
{
5050
if (!is_resource($stream) || 'stream' !== get_resource_type($stream)) {
5151
throw new \InvalidArgumentException('The StreamOutput class needs a stream as its first argument.');
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Console Component
2+
=================
3+
4+
Console eases the creation of beautiful and testable command line interfaces.
5+
6+
The Application object manages the CLI application:
7+
8+
use Symfony\Component\Console\Application;
9+
10+
$console = new Application();
11+
$console->run();
12+
13+
The ``run()`` method parses the arguments and options passed on the command
14+
line and executes the right command.
15+
16+
Registering a new command can easily be done via the ``register()`` method,
17+
which returns a ``Command`` instance:
18+
19+
use Symfony\Component\Console\Input\InputInterface;
20+
use Symfony\Component\Console\Input\InputArgument;
21+
use Symfony\Component\Console\Input\InputOption;
22+
use Symfony\Component\Console\Output\OutputInterface;
23+
24+
$console
25+
->register('ls')
26+
->setDefinition(array(
27+
new InputArgument('dir', InputArgument::REQUIRED, 'Directory name'),
28+
))
29+
->setDescription('Displays the files in the given directory')
30+
->setCode(function (InputInterface $input, OutputInterface $output) {
31+
$dir = $input->getArgument('dir');
32+
33+
$output->writeln(sprintf('Dir listing for <info>%s</info>', $dir));
34+
})
35+
;
36+
37+
You can also register new commands via classes.
38+
39+
The component provides a lot of features like output coloring, input and
40+
output abstractions (so that you can easily unit-test your commands),
41+
validation, automatic help messages, ...
42+
43+
Resources
44+
---------
45+
46+
Unit tests:
47+
48+
https://github.com/symfony/symfony/tree/master/tests/Symfony/Tests/Component/Console

src/Symfony/Component/CssSelector/README

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0