Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 4f3207e

Browse files
committed
Merge pull request #214 from symfony-cmf/2.0
[WIP] Refactoring to support 2.0
2 parents ae5e4f6 + 2dfd027 commit 4f3207e

33 files changed

+760
-785
lines changed

.travis.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,25 @@ matrix:
2020
include:
2121
- php: 5.6
2222
env: SYMFONY_VERSION=2.3.*
23-
- php: 5.6
24-
env: SYMFONY_VERSION=2.5.*
2523
- php: 5.6
2624
env: SYMFONY_VERSION=2.7.*
2725
- php: 5.6
28-
env: SYMFONY_VERSION=3.0.*
26+
env: SYMFONY_VERSION=2.8.*
27+
- php: 5.6
28+
env: SYMFONY_VERSION="3.0.x-dev as 2.8.x-dev"
2929
allow_failures:
3030
- php: 5.6
3131
env: SYMFONY_VERSION=2.7.*
3232
- php: 5.6
33-
env: SYMFONY_VERSION=3.0.*
33+
env: SYMFONY_VERSION=2.8.*
34+
- php: 5.6
35+
env: SYMFONY_VERSION="3.0.x-dev as 2.8.x-dev"
3436

35-
before_script:
37+
before_install:
38+
- if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then echo "memory_limit = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi
3639
- composer self-update
37-
- composer require symfony/symfony:${SYMFONY_VERSION} --prefer-dist
38-
- vendor/symfony-cmf/testing/bin/travis/phpcr_odm_doctrine_dbal.sh
40+
41+
install: composer require symfony/symfony:${SYMFONY_VERSION} --prefer-dist
3942

4043
script: phpunit --coverage-text
4144

Admin/AbstractMenuNodeAdmin.php

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,13 @@
1515
use Sonata\AdminBundle\Form\FormMapper;
1616
use Sonata\AdminBundle\Show\ShowMapper;
1717
use Sonata\DoctrinePHPCRAdminBundle\Admin\Admin;
18-
use Symfony\Cmf\Bundle\MenuBundle\Model\MenuNode;
1918
use Symfony\Cmf\Bundle\MenuBundle\Model\MenuNodeBase;
20-
use Symfony\Cmf\Bundle\MenuBundle\ContentAwareFactory;
2119

2220
/**
2321
* Common base admin for Menu and MenuNode
2422
*/
2523
abstract class AbstractMenuNodeAdmin extends Admin
2624
{
27-
/**
28-
* @var ContentAwareFactory
29-
*/
30-
protected $contentAwareFactory;
31-
3225
/**
3326
* @var string
3427
*/
@@ -73,9 +66,10 @@ protected function configureFormFields(FormMapper $formMapper)
7366
$formMapper
7467
->with('form.group_general')
7568
->add('linkType', 'choice_field_mask', array(
76-
'choices' => array_combine(
77-
$this->contentAwareFactory->getLinkTypes(),
78-
$this->contentAwareFactory->getLinkTypes()
69+
'choices' => array(
70+
'route' => 'route',
71+
'uri' => 'uri',
72+
'content' => 'content',
7973
),
8074
'map' => array(
8175
'route' => array('route'),
@@ -115,16 +109,6 @@ public function getExportFormats()
115109
return array();
116110
}
117111

118-
public function getContentAwareFactory()
119-
{
120-
return $this->contentAwareFactory;
121-
}
122-
123-
public function setContentAwareFactory(ContentAwareFactory $contentAwareFactory)
124-
{
125-
$this->contentAwareFactory = $contentAwareFactory;
126-
}
127-
128112
public function setContentRoot($contentRoot)
129113
{
130114
$this->contentRoot = $contentRoot;

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Changelog
22
=========
33

4+
2.0.0-alpha1
5+
------------
6+
7+
* **2014-11-03**: [BC BREAK] The CreateMenuItemFromNodeEvent class no longer has a getFactory method, inject the factory as a service instead
8+
* **2014-11-01**: [BC BREAK] The voters now need to use the voter mechanism of KnpMenu.
9+
* **2014-10-31**: [BC BREAK] The cmf_menu.factory service has been removed, knp_menu.factory should be used instead
10+
* **2014-10-30**: [BC BREAK] PhpcrMenuProvider now requires the NodeLoader as first argument instead of a FactoryInterface
11+
412
1.2.0-RC1
513
---------
614

CmfMenuBundle.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@
1313

1414
use Symfony\Component\HttpKernel\Bundle\Bundle;
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
16-
17-
use Symfony\Cmf\Bundle\MenuBundle\DependencyInjection\Compiler\AddVotersPass;
16+
use Symfony\Cmf\Bundle\MenuBundle\DependencyInjection\Compiler\DecorateMenuFactoryPass;
1817
use Doctrine\Bundle\PHPCRBundle\DependencyInjection\Compiler\DoctrinePhpcrMappingsPass;
1918

2019
class CmfMenuBundle extends Bundle
2120
{
2221
public function build(ContainerBuilder $container)
2322
{
2423
parent::build($container);
25-
$container->addCompilerPass(new AddVotersPass());
24+
25+
$container->addCompilerPass(new DecorateMenuFactoryPass());
26+
2627
if (class_exists('Doctrine\Bundle\PHPCRBundle\DependencyInjection\Compiler\DoctrinePhpcrMappingsPass')) {
2728
$container->addCompilerPass(
2829
DoctrinePhpcrMappingsPass::createXmlMappingDriver(

0 commit comments

Comments
 (0)