Skip to content

Commit

Permalink
bug #581 Alias the slugger to fix fixtures loading (ogizanagi)
Browse files Browse the repository at this point in the history
This PR was merged into the master branch.

Discussion
----------

Alias the slugger to fix fixtures loading

Fixes current exception:

```php
[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
  You have requested a non-existent service "slugger". Did you mean this: "logger"?
```

`ContainerAwareInterface` still is the way to access services inside fixture loaders. Maybe something could be done on the doctrine-fixtures-bundle side, but for now we need to have a public alias for this service.
We could also exclude the `DataFixtures\ORM` folder from PSR-4 loading, but it's probably not worth it and may "overwhelm" a little newcomers:

```diff
-        exclude: '../../src/AppBundle/{Controller,Entity,Repository}'
+        exclude: '../../src/AppBundle/{Controller,Entity,Repository,DataFixtures/ORM}'
```

Commits
-------

334f770 Alias the slugger to fix fixtures loading
  • Loading branch information
javiereguiluz committed Jun 11, 2017
2 parents 60eedfb + 334f770 commit 03a70a3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/config/services.yml
Expand Up @@ -44,3 +44,9 @@ services:

# needed for the localizeddate Twig filter
Twig\Extensions\IntlExtension: ~

# the slugger service needs a public alias for getting it from
# the container when loading doctrine fixtures
slugger:
alias: AppBundle\Utils\Slugger
public: true

0 comments on commit 03a70a3

Please sign in to comment.