Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
43 | public function up(Database $db) |
||
44 | { |
||
45 | $collection = $db->createCollection($this->collection); |
||
46 | $qb = $collection->createQueryBuilder(); |
||
47 | /** @var Translatable $translatable */ |
||
48 | foreach ($qb->find() as $translatable) { |
||
49 | $id = $translatable->getId(); |
||
50 | if (!ctype_xdigit($id)) { |
||
51 | $collection->update( |
||
52 | ['id' => $id], |
||
53 | ['id' => sha1($id)] |
||
54 | ); |
||
55 | } |
||
56 | } |
||
57 | } |
||
58 | |||
70 |