Skip to content

Commit f69a49b

Browse files
akovalyovgeekdevs
authored andcommitted
Feature/remove money type autoregistration (TheBigBrainsCompany#74)
* Remove autoregistration for money type * Add a note to changelog about removing auto registering doctrine type * Remove tests for money doctrine type
1 parent 59caa92 commit f69a49b

File tree

5 files changed

+11
-58
lines changed

5 files changed

+11
-58
lines changed

DependencyInjection/Compiler/DoctrineTypeCompilerPass.php

-46
This file was deleted.

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,15 @@ twig:
100100
- 'TbbcMoneyBundle:Form:fields.html.twig'
101101
```
102102
103+
You should also register custom Doctrine Money type:
104+
105+
```yaml
106+
doctrine:
107+
dbal:
108+
types:
109+
money: Tbbc\MoneyBundle\Type\MoneyType
110+
```
111+
103112
104113
Usage
105114
-----

TbbcMoneyBundle.php

-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,5 @@ public function build(ContainerBuilder $container)
2424
$container->addCompilerPass(new StorageCompilerPass());
2525
$container->addCompilerPass(new PairHistoryCompilerPass());
2626
$container->addCompilerPass(new RatioProviderCompilerPass());
27-
$container->addCompilerPass(new DoctrineTypeCompilerPass());
2827
}
2928
}

Tests/Fonctionnal/ConfigTest.php

-11
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,4 @@ public function testCurrencyTwigExtension()
115115
/** @var CurrencyExtension $currencyExtension */
116116
$currencyExtension = $this->client->getContainer()->get("tbbc_money.twig.currency");
117117
}
118-
119-
public function testDoctrineMoneyTypeAvailable()
120-
{
121-
122-
$this->assertTrue(Type::hasType(MoneyType::NAME));
123-
124-
foreach (array('default', 'other') as $name) {
125-
$em = $this->client->getContainer()->get('doctrine')->getManager($name);
126-
$this->assertEquals(MoneyType::NAME, $em->getConnection()->getDatabasePlatform()->getDoctrineTypeMapping(MoneyType::NAME));
127-
}
128-
}
129118
}

change-log-4.0.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
General:
22

33
- Updated to `moneyphp/money` v.3.0
4+
- Removed autoregistration of custom Doctrine Money type. You should add it by hand,
5+
as described in installation instructions. Checkout [discussion](https://github.com/TheBigBrainsCompany/TbbcMoneyBundle/issues/38#issuecomment-256012838) for details.
46

57
Twig filters:
68

0 commit comments

Comments
 (0)