Skip to content

Commit ea6a359

Browse files
kingchillsmarcj
authored andcommitted
Symfony 4.0 updates (propelorm#483)
* Upd: Add Symfony 4 Compatibility #SymfonyConHackday2017 * Upd: Configure visibility of services for SF4 * Updated composer to allow Symfony 4.0 * Updated composer to allow Symfony 4.0 * PropelBundle for Symfony 4 * Upd: Travis configuration * Upd: PHP 5 not supported anymore by PHPUnit * Upd: Removing old SF version + PHPUnit correction * * Removed param that was removed in symfony/yaml afb873f * Updated format of object dumping as deprecated tags using colon symfony/yaml 38d3087 * * Added commands to console.xml as symfony no longer auto registers bundle commands * Updated two services to public * * Removed deprecated getMock calls for new createMock calls. * * Add stub for additional abstract method * * Updated schema locator test * reverted unnecessary changes to abstract command and schemal locator * Added fixtures for schema testing. * * Updated schema locator test * reverted unnecessary changes to abstract command and schemal locator * Added fixtures for schema testing. * * Removed unnecessary default for services * Updated readme to reflect symfony version support
1 parent af88d81 commit ea6a359

25 files changed

+266
-78
lines changed

.travis.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,26 @@ sudo: false
33
language: php
44

55
php:
6-
- 5.5
7-
- 5.6
86
- 7.0
9-
- nightly
10-
- hhvm
7+
- 7.1
8+
- 7.2
119

1210
cache:
1311
directories:
1412
- $HOME/.composer/cache/files
1513

1614
env:
17-
- SYMFONY_VERSION="^2.8"
18-
- SYMFONY_VERSION="^2.8" COMPOSER_FLAGS="--prefer-lowest"
1915
- SYMFONY_VERSION="^3.0"
20-
- SYMFONY_VERSION="^3.0" COMPOSER_FLAGS="--prefer-lowest"
21-
- SYMFONY_VERSION="dev-master"
16+
- SYMFONY_VERSION="^4.0"
2217

2318
matrix:
2419
fast_finish: true
2520

26-
allow_failures:
27-
- php: hhvm
28-
- php: nightly
29-
- env: SYMFONY_VERSION="dev-master"
21+
exclude:
22+
- php: 7.0
23+
env: SYMFONY_VERSION="^4.0"
3024

3125
before_install:
32-
- phpenv config-rm xdebug.ini
3326
- composer self-update
3427
- if [ "${SYMFONY_VERSION}" != "" ]; then composer require --no-update "symfony/symfony:${SYMFONY_VERSION}"; fi;
3528

DataCollector/PropelDataCollector.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
<?php
22

3-
/*
4-
* This file is part of the Symfony package.
5-
*
6-
* (c) Fabien Potencier <fabien@symfony.com>
7-
*
3+
/**
4+
* This file is part of the PropelBundle package.
85
* For the full copyright and license information, please view the LICENSE
96
* file that was distributed with this source code.
7+
*
8+
* @license MIT License
109
*/
1110

1211
namespace Propel\Bundle\PropelBundle\DataCollector;
@@ -105,4 +104,12 @@ private function countQueries()
105104
{
106105
return count($this->logger->getQueries());
107106
}
107+
108+
/**
109+
* @inheritdoc
110+
*/
111+
public function reset()
112+
{
113+
// TODO: Implement reset() method.
114+
}
108115
}

DataFixtures/Dumper/YamlDataDumper.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ protected function transformArrayToData($data)
2828
$data,
2929
$inline = 3,
3030
$indent = 4,
31-
$exceptionOnInvalidType = false,
32-
$objectSupport = true
31+
Yaml::DUMP_OBJECT
3332
);
3433
}
3534
}

DependencyInjection/PropelExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public function load(array $configs, ContainerBuilder $container)
5353
$loader->load('propel.xml');
5454
$loader->load('converters.xml');
5555
$loader->load('security.xml');
56+
$loader->load('console.xml');
5657
}
5758
}
5859

README.markdown

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PropelBundle
22
============
33

4-
[![Build Status](https://travis-ci.org/propelorm/PropelBundle.svg?branch=3.0)](https://travis-ci.org/propelorm/PropelBundle)
4+
[![Build Status](https://travis-ci.org/propelorm/PropelBundle.svg?branch=4.0)](https://travis-ci.org/propelorm/PropelBundle)
55

66
This is the official implementation of [Propel](http://www.propelorm.org/) in Symfony.
77

@@ -14,6 +14,7 @@ As `Propel2` will be released in the near future, we are migrating the branching
1414
* The `1.2` branch contains Propel *1.6* integration for Symfony *2.2* (*currently master branch*).
1515
* The `2.0` branch contains `Propel2` integration for Symfony *2.5-2.8*.
1616
* The `3.0` branch contains `Propel2` integration for Symfony *2.8-3.x*.
17+
* The `4.0` branch contains `Propel2` integration for Symfony *3.4-4.x*.
1718

1819
## Features
1920

Resources/config/console.xml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" ?>
2+
3+
<container xmlns="http://symfony.com/schema/dic/services"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
6+
<services>
7+
<service id="propel_bundle_propel.command.acl_init_command" class="Propel\Bundle\PropelBundle\Command\AclInitCommand">
8+
<tag name="console.command" command="propel:acl:init" />
9+
</service>
10+
<service id="propel_bundle_propel.command.build_command" class="Propel\Bundle\PropelBundle\Command\BuildCommand">
11+
<tag name="console.command" command="propel:build" />
12+
</service>
13+
<service id="propel_bundle_propel.command.database_create_command" class="Propel\Bundle\PropelBundle\Command\DatabaseCreateCommand">
14+
<tag name="console.command" command="propel:database:create" />
15+
</service>
16+
<service class="Propel\Bundle\PropelBundle\Command\DatabaseDropCommand"
17+
id="propel_bundle_propel.command.database_drop_command">
18+
<tag name="console.command" command="propel:database:drop"/>
19+
</service>
20+
<service class="Propel\Bundle\PropelBundle\Command\DatabaseReverseCommand"
21+
id="propel_bundle_propel.command.database_reverse_command">
22+
<tag name="console.command" command="propel:database:reverse"/>
23+
</service>
24+
<service class="Propel\Bundle\PropelBundle\Command\FixturesDumpCommand"
25+
id="propel_bundle_propel.command.fixtures_dump_command">
26+
<tag name="console.command" command="propel:fixtures:dump"/>
27+
</service>
28+
<service class="Propel\Bundle\PropelBundle\Command\FixturesLoadCommand"
29+
id="propel_bundle_propel.command.fixtures_load_command">
30+
<tag name="console.command" command="propel:fixtures:load"/>
31+
</service>
32+
<service class="Propel\Bundle\PropelBundle\Command\FormGenerateCommand"
33+
id="propel_bundle_propel.command.form_generate_command">
34+
<tag name="console.command" command="propel:form:generate"/>
35+
</service>
36+
<service class="Propel\Bundle\PropelBundle\Command\GraphvizGenerateCommand"
37+
id="propel_bundle_propel.command.graphviz_generate_command">
38+
<tag name="console.command" command="propel:graphviz:generate"/>
39+
</service>
40+
<service class="Propel\Bundle\PropelBundle\Command\MigrationDiffCommand"
41+
id="propel_bundle_propel.command.migration_diff_command">
42+
<tag name="console.command" command="propel:migration:diff"/>
43+
</service>
44+
<service class="Propel\Bundle\PropelBundle\Command\MigrationDownCommand"
45+
id="propel_bundle_propel.command.migration_down_command">
46+
<tag name="console.command" command="propel:migration:down"/>
47+
</service>
48+
<service class="Propel\Bundle\PropelBundle\Command\MigrationMigrateCommand"
49+
id="propel_bundle_propel.command.migration_migrate_command">
50+
<tag name="console.command" command="propel:migration:migrate"/>
51+
</service>
52+
<service class="Propel\Bundle\PropelBundle\Command\MigrationStatusCommand"
53+
id="propel_bundle_propel.command.migration_status_command">
54+
<tag name="console.command" command="propel:migration:status"/>
55+
</service>
56+
<service class="Propel\Bundle\PropelBundle\Command\MigrationUpCommand"
57+
id="propel_bundle_propel.command.migration_up_command">
58+
<tag name="console.command" command="propel:migration:up"/>
59+
</service>
60+
<service class="Propel\Bundle\PropelBundle\Command\ModelBuildCommand"
61+
id="propel_bundle_propel.command.model_build_command">
62+
<tag name="console.command" command="propel:model:build"/>
63+
</service>
64+
<service class="Propel\Bundle\PropelBundle\Command\SqlBuildCommand"
65+
id="propel_bundle_propel.command.sql_build_command">
66+
<tag name="console.command" command="propel:sql:build"/>
67+
</service>
68+
<service class="Propel\Bundle\PropelBundle\Command\SqlInsertCommand"
69+
id="propel_bundle_propel.command.sql_insert_command">
70+
<tag name="console.command" command="propel:sql:insert"/>
71+
</service>
72+
<service class="Propel\Bundle\PropelBundle\Command\TableDropCommand"
73+
id="propel_bundle_propel.command.table_drop_command">
74+
<tag name="console.command" command="propel:table:drop"/>
75+
</service>
76+
</services>
77+
78+
</container>

Resources/config/propel.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
</parameters>
2020

2121
<services>
22-
<service id="propel.schema_locator" class="%propel.schema_locator.class%">
22+
<service id="propel.schema_locator" class="%propel.schema_locator.class%" public="true">
2323
<argument type="service" id="file_locator" />
2424
<argument>%propel.configuration%</argument>
2525
</service>
2626

27-
<service id="propel.logger" class="%propel.logger.class%">
27+
<service id="propel.logger" class="%propel.logger.class%" public="true">
2828
<tag name="monolog.logger" channel="propel" />
2929
<argument type="service" id="logger" on-invalid="null" />
3030
<argument type="service" id="debug.stopwatch" on-invalid="null" />
@@ -62,5 +62,7 @@
6262
<argument>%kernel.root_dir%</argument>
6363
<argument>%propel.configuration%</argument>
6464
</service>
65+
66+
6567
</services>
6668
</container>

Service/SchemaLocator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@ protected function transformToLogicalName(\SplFileInfo $schema, BundleInterface
8585
$schema->getRealPath()
8686
);
8787

88-
return sprintf('@%s/Resources/config/%s', $bundle->getName(), $schemaPath);
88+
return sprintf('%s/Resources/config/%s', $bundle->getName(), $schemaPath);
8989
}
9090
}

Tests/DataFixtures/Dumper/YamlDataDumperTest.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,11 @@ public function testYamlDump()
5151
id: '1'
5252
name: 'An important one'
5353
author_id: CoolBookAuthor_1
54-
complementary_infos: !php/object:O:8:"stdClass":1:{s:15:"first_word_date";s:10:"2012-01-01";}
54+
complementary_infos: !php/object 'O:8:"stdClass":1:{s:15:"first_word_date";s:10:"2012-01-01";}'
5555
5656
YAML;
57-
5857
$result = file_get_contents($filename);
5958

60-
//yaml changed the way objects are serialized in
61-
// -> https://github.com/symfony/yaml/commit/d5a7902da7e5af069bb8fdcfcf029a229deb1111
62-
//so we need to replace old behavior with new, to get this test working in all versions
63-
$result = str_replace(' !!php/object', ' !php/object', $result);
64-
6559
$this->assertEquals($expected, $result);
6660
}
6761
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: drewbrown
5+
* Date: 2/2/18
6+
* Time: 3:32 PM
7+
*/
8+
9+
namespace Propel\Bundle\PropelBundle\Tests\Fixtures\FakeBundle;
10+
11+
12+
use Symfony\Component\HttpKernel\Bundle\Bundle;
13+
14+
class FakeBundle extends Bundle
15+
{
16+
17+
}

0 commit comments

Comments
 (0)