Skip to content

Fix outdated namespace: AppBundle -> App (src/AppBundle -> src) #510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions core/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ configure API Platform to convert it to a `404 Not Found` error:

```php
<?php
// src/AppBundle/Exception/ProductNotFoundException.php
// src/Exception/ProductNotFoundException.php

namespace AppBundle\Exception;
namespace App\Exception;

final class ProductNotFoundException extends \Exception
{
Expand All @@ -26,13 +26,13 @@ final class ProductNotFoundException extends \Exception

```php
<?php
// src/AppBundle/EventSubscriber/CartManager.php
// src/EventSubscriber/CartManager.php

namespace AppBundle\EventSubscriber;
namespace App\EventSubscriber;

use ApiPlatform\Core\EventListener\EventPriorities;
use AppBundle\Entity\Product;
use AppBundle\Exception\ProductNotFoundException;
use App\Entity\Product;
use App\Exception\ProductNotFoundException;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent;
Expand Down Expand Up @@ -65,7 +65,7 @@ final class ProductManager implements EventSubscriberInterface
If you use the standard distribution of API Platform, this event listener will be automatically registered. If you use a
custom installation, [learn how to register listeners](events.md).

Then, configure the framework to catch `AppBundle\Exception\ProductNotFoundException` exceptions and convert them in `404`
Then, configure the framework to catch `App\Exception\ProductNotFoundException` exceptions and convert them in `404`
errors:

```yaml
Expand All @@ -77,7 +77,7 @@ api_platform:
Symfony\Component\Serializer\Exception\ExceptionInterface: 400 # Use a raw status code (recommended)
ApiPlatform\Core\Exception\InvalidArgumentException: 'HTTP_BAD_REQUEST' # Or a `Symfony\Component\HttpFoundation\Response`'s constant

AppBundle\Exception\ProductNotFoundException: 404 # Here is the handler for our custom exception
App\Exception\ProductNotFoundException: 404 # Here is the handler for our custom exception
```

Any type of `Exception` can be thrown, API Platform will convert it to a Symfony's `HttpException`. The framework also takes
Expand Down
4 changes: 2 additions & 2 deletions core/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ Sometimes you need individual resources like `/me`. To work properly with Varnis

declare(strict_types=1);

namespace AppBundle\EventSubscriber;
namespace App\EventSubscriber;

use ApiPlatform\Core\EventListener\EventPriorities;
use AppBundle\Entity\User;
use App\Entity\User;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
Expand Down
14 changes: 7 additions & 7 deletions core/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ the `@ApiResource` annotation:

```php
<?php
// src/AppBundle/Entity/Product.php
// src/Entity/Product.php

namespace AppBundle\Entity;
namespace App\Entity;

use ApiPlatform\Core\Annotation\ApiResource;
use App\Validator\Constraints\MinimalProperties; // A custom constraint
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert; // Symfony's built-in constraints
use AppBundle\Validator\Constraints\MinimalProperties; // A custom constraint

/**
* A product.
Expand Down Expand Up @@ -63,9 +63,9 @@ Here is a custom constraint and the related validator:

```php
<?php
// src/AppBundle/Validator/Constraints/MinimalProperties.php
// src/Validator/Constraints/MinimalProperties.php

namespace AppBundle\Validator\Constraints;
namespace App\Validator\Constraints;

use Symfony\Component\Validator\Constraint;

Expand All @@ -80,9 +80,9 @@ class MinimalProperties extends Constraint

```php
<?php
// src/AppBundle/Validator/Constraints/MinimalPropertiesValidator.php
// src/Validator/Constraints/MinimalPropertiesValidator.php

namespace AppBundle\Validator\Constraints;
namespace App\Validator\Constraints;

use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
Expand Down