Skip to content

[Form][FrameworkBundle][Bridge] Add a DateInterval form type #13390

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 47 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
ebe0889
Revert "removed 3.0 constraints from 2.7 composer files"
fabpot Apr 10, 2015
38374f9
updated version to 2.8
fabpot Apr 10, 2015
222701f
Merge branch '2.7' into 2.8
fabpot Apr 11, 2015
3694e5e
[Translation] added FileLoader.
aitboudad Apr 15, 2015
fbe1a43
[FrameworkBundle][Server Command] add address port number option.
aitboudad Apr 16, 2015
6bab76d
feature #14383 [FrameworkBundle][Server Command] add address port num…
fabpot Apr 18, 2015
862bdf1
feature #14359 [Translation] added FileLoader. (aitboudad)
fabpot Apr 18, 2015
eb50b13
[VarDumper] Added support for SplFileInfo
lyrixx Apr 20, 2015
e75c233
[VarDumper] Added support for SplFileObject
lyrixx Apr 21, 2015
ff4424a
[Console] Bind the closure (code) to the Command if possible
lyrixx Apr 21, 2015
449b18c
feature #14424 [VarDumper] Added support for SplFileInfo (lyrixx)
nicolas-grekas Apr 22, 2015
208ca94
[VarDumper] Allow preserving a subset of cut arrays
nicolas-grekas Apr 22, 2015
e861134
feature #14431 [Console] Bind the closure (code) to the Command if po…
stof Apr 23, 2015
a4e3e07
feature #14443 [VarDumper] Allow preserving a subset of cut arrays (n…
nicolas-grekas Apr 23, 2015
f5a0ac2
Merge branch '2.7' into 2.8
nicolas-grekas Apr 24, 2015
e6d05b7
Merge branch '2.7' into 2.8
nicolas-grekas Apr 24, 2015
dc89425
Merge branch '2.7' into 2.8
nicolas-grekas Apr 24, 2015
b09df56
Merge branch '2.7' into 2.8
nicolas-grekas Apr 24, 2015
b941bd3
Changed output for translation:debug command
Apr 26, 2015
7e29d2c
feature #14473 [DX] Minor improvement for the translation:debug outpu…
aitboudad Apr 26, 2015
0e7fe79
added the --all option to the debug:translation command
sgehrig Apr 11, 2015
1973960
feature #14320 [Translation] added an --all option to the debug:trans…
aitboudad Apr 29, 2015
952929c
[FrameworkBundle][EventDispatcher] Add priorities to the debug:event-…
Seldaek May 5, 2015
2869a32
[Translator] deprecate getMessages in favor of getCatalogue.
aitboudad May 4, 2015
55b3525
feature #14546 [Translator] deprecate getMessages in favor of getCata…
aitboudad May 6, 2015
da0194b
feature #14563 [FrameworkBundle][EventDispatcher] Add priorities to t…
fabpot May 6, 2015
128140e
fixed CS
fabpot May 6, 2015
bba0a25
[FrameworkBundle][DX] Add option to specify additional translation lo…
Seldaek May 5, 2015
88b7e7c
feature #14561 [FrameworkBundle][DX] Add option to specify additional…
aitboudad May 6, 2015
bb8b076
Merge branch '2.7' into 2.8
nicolas-grekas May 12, 2015
5133bf2
Merge branch '2.7' into 2.8
nicolas-grekas May 12, 2015
aef24cb
Merge branch '2.7' into 2.8
nicolas-grekas May 13, 2015
2119bf3
Merge branch '2.7' into 2.8
nicolas-grekas May 15, 2015
4b71fe0
Merge branch '2.7' into 2.8
fabpot May 15, 2015
5fdc650
[WebProfilerBundle] Improved page for logs
hason Jan 7, 2015
65d4ae0
feature #13324 [WebProfilerBundle] Improved page for logs (hason)
fabpot May 17, 2015
53330e1
[Form] deprecate read_only option
Tobion Apr 18, 2015
791e583
feature #14403 [Form] deprecate read_only option (Tobion)
fabpot May 20, 2015
29ec5ca
[Translation] add options 'as_tree', 'inline' to YamlFileDumper to du…
gepo Apr 21, 2015
a57ce90
feature #14630 [Translator] Dump translation constants as tree instea…
aitboudad May 20, 2015
2efc100
[Form] Add a DateInterval form type
MisatoTremor Jan 12, 2015
ddca4c2
PHPUnit Optimizations
MisatoTremor Jan 13, 2015
5fa18dc
Remove obsolete invert option
MisatoTremor Jan 13, 2015
d0de56f
Remove unnecessary ternary
MisatoTremor Jan 13, 2015
e7c47c9
Fix typos and indentation in PHPDoc
MisatoTremor Jan 19, 2015
2067dab
Use configureOptions() instead of setDefaultOptions()
MisatoTremor Jan 29, 2015
3723f13
Fix CS as proposed by fabpot.io
MisatoTremor May 25, 2015
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ install:
script:
- if [ "$deps" = "no" ]; then echo "$components" | parallel --gnu --keep-order 'echo -e "\\nRunning {} tests"; phpunit --exclude-group tty,benchmark,intl-data {} || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
- if [ "$deps" = "no" ]; then echo -e "\\nRunning tests requiring tty"; phpunit --group tty || (echo -e "\\e[41mKO\\e[0m tty group" && $(exit 1)); fi;
- if [ "$deps" = "high" ]; then echo "$components" | parallel --gnu --keep-order -j10% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source update; phpunit --exclude-group tty,benchmark,intl-data || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
- if [ "$deps" = "high" ]; then echo "$components" | parallel --gnu --keep-order -j10% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source update; phpunit --exclude-group tty,benchmark,intl-data,legacy || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
- if [ "$deps" = "low" ]; then echo "$components" | parallel --gnu --keep-order -j10% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source --prefer-lowest --prefer-stable update; phpunit --exclude-group tty,benchmark,intl-data || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
24 changes: 24 additions & 0 deletions UPGRADE-2.8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
UPGRADE FROM 2.7 to 2.8
=======================

Translator
----------
* The `getMessages()` method of the `Symfony\Component\Translation\Translator` was deprecated and will be removed in
Symfony 3.0. You should use the `getCatalogue()` method of the `Symfony\Component\Translation\TranslatorBagInterface`.

Before:

```php
$messages = $translator->getMessages();
```

After:

```php
$catalogue = $translator->getCatalogue($locale);
$messages = $catalogue->all();

while ($catalogue = $catalogue->getFallbackCatalogue()) {
$messages = array_replace_recursive($catalogue->all(), $messages);
}
```
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
"dev-master": "2.8-dev"
}
}
}
22 changes: 11 additions & 11 deletions src/Symfony/Bridge/Doctrine/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
"doctrine/common": "~2.3"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.7",
"symfony/stopwatch": "~2.2",
"symfony/dependency-injection": "~2.2",
"symfony/form": "~2.7",
"symfony/http-kernel": "~2.2",
"symfony/property-access": "~2.3",
"symfony/security": "~2.2",
"symfony/expression-language": "~2.2",
"symfony/validator": "~2.5,>=2.5.5",
"symfony/translation": "~2.0,>=2.0.5",
"symfony/phpunit-bridge": "~2.7|~3.0.0",
"symfony/stopwatch": "~2.2|~3.0.0",
"symfony/dependency-injection": "~2.2|~3.0.0",
"symfony/form": "~2.7|~3.0.0",
"symfony/http-kernel": "~2.2|~3.0.0",
"symfony/property-access": "~2.3|~3.0.0",
"symfony/security": "~2.2|~3.0.0",
"symfony/expression-language": "~2.2|~3.0.0",
"symfony/validator": "~2.5,>=2.5.5|~3.0.0",
"symfony/translation": "~2.0,>=2.0.5|~3.0.0",
"doctrine/data-fixtures": "1.0.*",
"doctrine/dbal": "~2.2",
"doctrine/orm": "~2.2,>=2.2.3"
Expand All @@ -47,7 +47,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
"dev-master": "2.8-dev"
}
}
}
1 change: 1 addition & 0 deletions src/Symfony/Bridge/Monolog/Handler/DebugHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function getLogs()
'priority' => $record['level'],
'priorityName' => $record['level_name'],
'context' => $record['context'],
'channel' => isset($record['channel']) ? $record['channel'] : '',
);
}

Expand Down
10 changes: 5 additions & 5 deletions src/Symfony/Bridge/Monolog/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
"monolog/monolog": "~1.11"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.7",
"symfony/http-kernel": "~2.4",
"symfony/console": "~2.4",
"symfony/event-dispatcher": "~2.2"
"symfony/phpunit-bridge": "~2.7|~3.0.0",
"symfony/http-kernel": "~2.4|~3.0.0",
"symfony/console": "~2.4|~3.0.0",
"symfony/event-dispatcher": "~2.2|~3.0.0"
},
"suggest": {
"symfony/http-kernel": "For using the debugging handlers together with the response life cycle of the HTTP kernel.",
Expand All @@ -36,7 +36,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
"dev-master": "2.8-dev"
}
}
}
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/PhpUnit/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
"dev-master": "2.8-dev"
}
}
}
8 changes: 4 additions & 4 deletions src/Symfony/Bridge/ProxyManager/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
],
"require": {
"php": ">=5.3.9",
"symfony/dependency-injection": "~2.3",
"symfony/dependency-injection": "~2.3|~3.0.0",
"ocramius/proxy-manager": "~0.4|~1.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.7",
"symfony/config": "~2.3"
"symfony/phpunit-bridge": "~2.7|~3.0.0",
"symfony/config": "~2.3|~3.0.0"
},
"autoload": {
"psr-4": { "Symfony\\Bridge\\ProxyManager\\": "" }
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
"dev-master": "2.8-dev"
}
}
}
4 changes: 2 additions & 2 deletions src/Symfony/Bridge/Swiftmailer/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"swiftmailer/swiftmailer": ">=4.2.0,<6.0-dev"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.7"
"symfony/phpunit-bridge": "~2.7|~3.0.0"
},
"suggest": {
"symfony/http-kernel": ""
Expand All @@ -31,7 +31,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
"dev-master": "2.8-dev"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,25 @@
{% endif %}
{%- endblock time_widget %}

{% block dateinterval_widget %}
{% if widget == 'single_text' %}
{{- block('form_widget_simple') -}}
{% else %}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' form-inline')|trim}) %}
<div {{ block('widget_container_attributes') }}>
{{ form_errors(form) }}
{% if with_years %}{{ form_widget(form.years) }}{% endif %}
{% if with_months %}{{ form_widget(form.months) }}{% endif %}
{% if with_weeks %}{{ form_widget(form.weeks) }}{% endif %}
{% if with_days %}{{ form_widget(form.days) }}{% endif %}
{% if with_hours %}{{ form_widget(form.hours) }}{% endif %}
{% if with_minutes %}{{ form_widget(form.minutes) }}{% endif %}
{% if with_seconds %}{{ form_widget(form.seconds) }}{% endif %}
{% if with_invert %}{{ form_widget(form.invert) }}{% endif %}
</div>
{% endif %}
{% endblock dateinterval_widget %}

{% block choice_widget_collapsed -%}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' form-control')|trim}) %}
{{- parent() -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,24 @@
{%- endif -%}
{%- endblock time_widget -%}

{% block dateinterval_widget %}
{% if widget == 'single_text' %}
{{- block('form_widget_simple') -}}
{% else %}
<div {{ block('widget_container_attributes') }}>
{{ form_errors(form) }}
{% if with_years %}{{ form_widget(form.years) }}{% endif %}
{% if with_months %}{{ form_widget(form.months) }}{% endif %}
{% if with_weeks %}{{ form_widget(form.weeks) }}{% endif %}
{% if with_days %}{{ form_widget(form.days) }}{% endif %}
{% if with_hours %}{{ form_widget(form.hours) }}{% endif %}
{% if with_minutes %}{{ form_widget(form.minutes) }}{% endif %}
{% if with_seconds %}{{ form_widget(form.seconds) }}{% endif %}
{% if with_invert %}{{ form_widget(form.invert) }}{% endif %}
</div>
{% endif %}
{% endblock dateinterval_widget %}

{%- block number_widget -%}
{# type="number" doesn't work with floats #}
{%- set type = type|default('text') -%}
Expand Down Expand Up @@ -314,7 +332,6 @@

{%- block widget_attributes -%}
id="{{ id }}" name="{{ full_name }}"
{%- if read_only %} readonly="readonly"{% endif -%}
{%- if disabled %} disabled="disabled"{% endif -%}
{%- if required %} required="required"{% endif -%}
{%- for attrname, attrvalue in attr -%}
Expand Down
32 changes: 16 additions & 16 deletions src/Symfony/Bridge/Twig/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@
"twig/twig": "~1.18"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.7",
"symfony/asset": "~2.7",
"symfony/finder": "~2.3",
"symfony/form": "~2.7",
"symfony/http-kernel": "~2.3",
"symfony/intl": "~2.3",
"symfony/routing": "~2.2",
"symfony/templating": "~2.1",
"symfony/translation": "~2.7",
"symfony/yaml": "~2.0,>=2.0.5",
"symfony/security": "~2.6",
"symfony/stopwatch": "~2.2",
"symfony/console": "~2.7",
"symfony/var-dumper": "~2.6",
"symfony/expression-language": "~2.4"
"symfony/phpunit-bridge": "~2.7|~3.0.0",
"symfony/asset": "~2.7|~3.0.0",
"symfony/finder": "~2.3|~3.0.0",
"symfony/form": "~2.8|~3.0.0",
"symfony/http-kernel": "~2.3|~3.0.0",
"symfony/intl": "~2.3|~3.0.0",
"symfony/routing": "~2.2|~3.0.0",
"symfony/templating": "~2.1|~3.0.0",
"symfony/translation": "~2.7|~3.0.0",
"symfony/yaml": "~2.0,>=2.0.5|~3.0.0",
"symfony/security": "~2.6|~3.0.0",
"symfony/stopwatch": "~2.2|~3.0.0",
"symfony/console": "~2.7|~3.0.0",
"symfony/var-dumper": "~2.6|~3.0.0",
"symfony/expression-language": "~2.4|~3.0.0"
},
"suggest": {
"symfony/finder": "",
Expand All @@ -56,7 +56,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
"dev-master": "2.8-dev"
}
}
}
16 changes: 8 additions & 8 deletions src/Symfony/Bundle/DebugBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
],
"require": {
"php": ">=5.3.9",
"symfony/http-kernel": "~2.6",
"symfony/twig-bridge": "~2.6",
"symfony/var-dumper": "~2.6"
"symfony/http-kernel": "~2.6|~3.0.0",
"symfony/twig-bridge": "~2.6|~3.0.0",
"symfony/var-dumper": "~2.6|~3.0.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.7",
"symfony/config": "~2.3",
"symfony/dependency-injection": "~2.3",
"symfony/web-profiler-bundle": "~2.3"
"symfony/phpunit-bridge": "~2.7|~3.0.0",
"symfony/config": "~2.3|~3.0.0",
"symfony/dependency-injection": "~2.3|~3.0.0",
"symfony/web-profiler-bundle": "~2.3|~3.0.0"
},
"suggest": {
"symfony/config": "For service container configuration",
Expand All @@ -37,7 +37,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
"dev-master": "2.8-dev"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ protected function configure()
{
$this
->setDefinition(array(
new InputArgument('address', InputArgument::OPTIONAL, 'Address:port', '127.0.0.1:8000'),
new InputArgument('address', InputArgument::OPTIONAL, 'Address:port', '127.0.0.1'),
new InputOption('port', 'p', InputOption::VALUE_REQUIRED, 'Address port number', '8000'),
new InputOption('docroot', 'd', InputOption::VALUE_REQUIRED, 'Document root', null),
new InputOption('router', 'r', InputOption::VALUE_REQUIRED, 'Path to custom router script'),
))
Expand Down Expand Up @@ -99,9 +100,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$address = $input->getArgument('address');

if (false === strpos($address, ':')) {
$output->writeln('The address has to be of the form <comment>bind-address:port</comment>.');

return 1;
$address = $address.':'.$input->getOption('port');
}

if ($this->isOtherServerProcessRunning($address)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ protected function configure()
{
$this
->setDefinition(array(
new InputArgument('address', InputArgument::OPTIONAL, 'Address:port', '127.0.0.1:8000'),
new InputArgument('address', InputArgument::OPTIONAL, 'Address:port', '127.0.0.1'),
new InputOption('port', 'p', InputOption::VALUE_REQUIRED, 'Address port number', '8000'),
new InputOption('docroot', 'd', InputOption::VALUE_REQUIRED, 'Document root', null),
new InputOption('router', 'r', InputOption::VALUE_REQUIRED, 'Path to custom router script'),
))
Expand Down Expand Up @@ -106,9 +107,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$address = $input->getArgument('address');

if (false === strpos($address, ':')) {
$output->writeln('The address has to be of the form <comment>bind-address:port</comment>.');

return 1;
$address = $address.':'.$input->getOption('port');
}

if ($this->isOtherServerProcessRunning($address)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputOption;

/**
* Stops a background process running PHP's built-in web server.
Expand All @@ -29,7 +30,8 @@ protected function configure()
{
$this
->setDefinition(array(
new InputArgument('address', InputArgument::OPTIONAL, 'Address:port', '127.0.0.1:8000'),
new InputArgument('address', InputArgument::OPTIONAL, 'Address:port', '127.0.0.1'),
new InputOption('port', 'p', InputOption::VALUE_REQUIRED, 'Address port number', '8000'),
))
->setName('server:stop')
->setDescription('Stops PHP\'s built-in web server that was started with the server:start command')
Expand All @@ -53,6 +55,10 @@ protected function configure()
protected function execute(InputInterface $input, OutputInterface $output)
{
$address = $input->getArgument('address');
if (false === strpos($address, ':')) {
$address = $address.':'.$input->getOption('port');
}

$lockFile = $this->getLockFile($address);

if (!file_exists($lockFile)) {
Expand Down
Loading