Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[3.0][FrameworkBundle] Removed deprecated features #15904

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 all commits
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
6 changes: 6 additions & 0 deletions 6 src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
CHANGELOG
=========

3.0.0
-----

* removed `validator.api` parameter
* removed `alias` option of the `form.type` tag

2.8.0
-----

Expand Down
12 changes: 2 additions & 10 deletions 12 src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Csrf\CsrfToken;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\FormTypeInterface;
use Symfony\Component\Form\Form;
use Symfony\Component\Form\FormBuilder;
Expand Down Expand Up @@ -292,16 +293,7 @@ protected function createForm($type, $data = null, array $options = array())
*/
protected function createFormBuilder($data = null, array $options = array())
{
if (method_exists('Symfony\Component\Form\AbstractType', 'getBlockPrefix')) {
$type = 'Symfony\Component\Form\Extension\Core\Type\FormType';
} else {
// not using the class name is deprecated since Symfony 2.8 and
// is only used for backwards compatibility with older versions
// of the Form component
$type = 'form';
}

return $this->container->get('form.factory')->createBuilder($type, $data, $options);
return $this->container->get('form.factory')->createBuilder(FormType::class, $data, $options);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ public function process(ContainerBuilder $container)
$types = array();

foreach ($container->findTaggedServiceIds('form.type') as $serviceId => $tag) {
// The following if-else block is deprecated and will be removed
// in Symfony 3.0
// Deprecation errors are triggered in the form registry
if (isset($tag[0]['alias'])) {
$types[$tag[0]['alias']] = $serviceId;
} else {
$types[$serviceId] = $serviceId;
}

// Support type access by FQCN
$serviceDefinition = $container->getDefinition($serviceId);
$types[$serviceDefinition->getClass()] = $serviceId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -777,12 +777,6 @@ private function registerValidationConfiguration(array $config, ContainerBuilder

$validatorBuilder->addMethodCall('setMetadataCache', array(new Reference($config['cache'])));
}

// You can use this parameter to check the API version in your own
// bundle extension classes
// This is set to 2.5-bc for compatibility with Symfony 2.5 and 2.6.
// @deprecated since version 2.7, to be removed in 3.0
$container->setParameter('validator.api', '2.5-bc');
}

private function getValidatorMappingFiles(ContainerBuilder $container)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@

<xsd:element name="config" type="config" />

<xsd:simpleType name="validator_api_version">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="auto" />
<xsd:enumeration value="2.4" />
<xsd:enumeration value="2.5" />
<xsd:enumeration value="2.5-bc" />
</xsd:restriction>
</xsd:simpleType>

<xsd:complexType name="config">
<xsd:all>
<xsd:element name="assets" type="assets" minOccurs="0" maxOccurs="1" />
Expand Down Expand Up @@ -180,7 +171,6 @@
<xsd:attribute name="cache" type="xsd:string" />
<xsd:attribute name="enable-annotations" type="xsd:boolean" />
<xsd:attribute name="static-method" type="xsd:boolean" />
<xsd:attribute name="api" type="validator_api_version" />
</xsd:complexType>

<xsd:complexType name="annotations">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,46 +59,8 @@ public function testAddTaggedTypes()
$extDefinition = $container->getDefinition('form.extension');

$this->assertEquals(array(
// As of Symfony 2.8, the class is used to look up types
__CLASS__.'_Type1' => 'my.type1',
__CLASS__.'_Type2' => 'my.type2',
// Before Symfony 2.8, the service ID was used as default alias
'my.type1' => 'my.type1',
'my.type2' => 'my.type2',
), $extDefinition->getArgument(1));
}

public function testUseCustomAliasIfSet()
{
$container = new ContainerBuilder();
$container->addCompilerPass(new FormPass());

$extDefinition = new Definition('Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension');
$extDefinition->setArguments(array(
new Reference('service_container'),
array(),
array(),
array(),
));

$definition1 = new Definition(__CLASS__.'_Type1');
$definition1->addTag('form.type', array('alias' => 'mytype1'));
$definition2 = new Definition(__CLASS__.'_Type2');
$definition2->addTag('form.type', array('alias' => 'mytype2'));

$container->setDefinition('form.extension', $extDefinition);
$container->setDefinition('my.type1', $definition1);
$container->setDefinition('my.type2', $definition2);

$container->compile();

$extDefinition = $container->getDefinition('form.extension');

$this->assertEquals(array(
__CLASS__.'_Type1' => 'my.type1',
__CLASS__.'_Type2' => 'my.type2',
'mytype1' => 'my.type1',
'mytype2' => 'my.type2',
), $extDefinition->getArgument(1));
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.