Migrate from CameraBundle to App namespace

This commit is contained in:
Timothy Warren 2018-02-14 16:42:39 -05:00
parent 2a1322b896
commit 26e0b8a6fc
44 changed files with 97 additions and 97 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/env php
<?php
use CameraBundle\Kernel;
use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;

View File

@ -29,12 +29,12 @@
},
"autoload": {
"psr-4": {
"CameraBundle\\": "src/"
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"CameraBundle\\Tests\\": "tests/"
"App\\Tests\\": "tests/"
}
},
"scripts": {

View File

@ -1,7 +1,7 @@
<?php
return [
CameraBundle\CameraBundle::class => ['all' => true],
App\App::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true],
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],

View File

@ -11,7 +11,7 @@ doctrine:
driver: 'pdo_pgsql'
types:
money: CameraBundle\Types\MoneyType
money: App\Types\MoneyType
mapping_types:
bit: boolean
money: money
@ -23,9 +23,9 @@ doctrine:
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
mappings:
CameraBundle:
App:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'CameraBundle\Entity'
alias: CameraBundle
prefix: 'App\Entity'
alias: App

View File

@ -14,9 +14,9 @@ services:
# if you need to do this, you can override this setting on individual services
public: false
# makes classes in src/CameraBundle available to be used as services
# makes classes in src/App available to be used as services
# this creates a service per class whose id is the fully-qualified class name
CameraBundle\:
App\:
resource: '../src/*'
# you can exclude directories or files
# but if a service is unused, it's removed anyway
@ -24,12 +24,12 @@ services:
# controllers are imported separately to make sure they're public
# and have a tag that allows actions to type-hint services
CameraBundle\Controller\:
App\Controller\:
resource: '../src/Controller'
public: true
tags: ['controller.service_arguments']
# add more services, or override services that need manual wiring
# CameraBundle\Service\ExampleService:
# App\Service\ExampleService:
# arguments:
# $someArgument: 'some_value'

View File

@ -14,9 +14,9 @@ services:
# if you need to do this, you can override this setting on individual services
public: false
# makes classes in src/CameraBundle available to be used as services
# makes classes in src/App available to be used as services
# this creates a service per class whose id is the fully-qualified class name
CameraBundle\:
App\:
resource: '../src/*'
# you can exclude directories or files
# but if a service is unused, it's removed anyway
@ -24,12 +24,12 @@ services:
# controllers are imported separately to make sure they're public
# and have a tag that allows actions to type-hint services
CameraBundle\Controller\:
App\Controller\:
resource: '../src/Controller'
public: true
tags: ['controller.service_arguments']
# add more services, or override services that need manual wiring
# CameraBundle\Service\ExampleService:
# App\Service\ExampleService:
# arguments:
# $someArgument: 'some_value'

View File

@ -1,6 +1,6 @@
<?php declare(strict_types = 1);
use CameraBundle\Kernel;
use App\Kernel;
use Symfony\Component\Debug\Debug;
use Symfony\Component\Dotenv\Dotenv;
use Symfony\Component\HttpFoundation\Request;

View File

@ -1,9 +1,9 @@
<?php
namespace CameraBundle;
namespace App;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class CameraBundle extends Bundle
class App extends Bundle
{
}
}

View File

@ -1,9 +1,9 @@
<?php
namespace CameraBundle\Controller;
namespace App\Controller;
use CameraBundle\Entity\Camera;
use CameraBundle\Form\CameraType;
use App\Entity\Camera;
use App\Form\CameraType;
use Doctrine\ORM\OptimisticLockException;
use Doctrine\ORM\ORMInvalidArgumentException;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
@ -31,7 +31,7 @@ class CameraController extends Controller
{
$em = $this->getDoctrine()->getManager();
$cameras = $em->getRepository('CameraBundle:Camera')->findBy([], [
$cameras = $em->getRepository('App:Camera')->findBy([], [
'received' => 'DESC',
'brand' => 'ASC',
'mount' => 'ASC',

View File

@ -1,8 +1,8 @@
<?php
namespace CameraBundle\Controller;
namespace App\Controller;
use CameraBundle\Entity\CameraType;
use App\Entity\CameraType;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
@ -25,7 +25,7 @@ class CameraTypeController extends Controller
{
$em = $this->getDoctrine()->getManager();
$cameraTypes = $em->getRepository('CameraBundle:CameraType')->findBy([], [
$cameraTypes = $em->getRepository('App:CameraType')->findBy([], [
'type' => 'ASC'
]);
@ -43,7 +43,7 @@ class CameraTypeController extends Controller
public function newAction(Request $request)
{
$cameraType = new Cameratype();
$form = $this->createForm('CameraBundle\Form\CameraTypeType', $cameraType);
$form = $this->createForm('App\Form\CameraTypeType', $cameraType);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
@ -85,7 +85,7 @@ class CameraTypeController extends Controller
public function editAction(Request $request, CameraType $cameraType)
{
$deleteForm = $this->createDeleteForm($cameraType);
$editForm = $this->createForm('CameraBundle\Form\CameraTypeType', $cameraType);
$editForm = $this->createForm('App\Form\CameraTypeType', $cameraType);
$editForm->handleRequest($request);
if ($editForm->isSubmitted() && $editForm->isValid()) {

View File

@ -1,6 +1,6 @@
<?php
namespace CameraBundle\Controller;
namespace App\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

View File

@ -1,8 +1,8 @@
<?php
namespace CameraBundle\Controller;
namespace App\Controller;
use CameraBundle\Entity\Flash;
use App\Entity\Flash;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
@ -25,7 +25,7 @@ class FlashController extends Controller
{
$em = $this->getDoctrine()->getManager();
$flashes = $em->getRepository('CameraBundle:Flash')->findBy([], [
$flashes = $em->getRepository('App:Flash')->findBy([], [
'received' => 'DESC',
'brand' => 'ASC',
'model' => 'ASC'
@ -45,7 +45,7 @@ class FlashController extends Controller
public function newAction(Request $request)
{
$flash = new Flash();
$form = $this->createForm('CameraBundle\Form\FlashType', $flash);
$form = $this->createForm('App\Form\FlashType', $flash);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
@ -87,7 +87,7 @@ class FlashController extends Controller
public function editAction(Request $request, Flash $flash)
{
$deleteForm = $this->createDeleteForm($flash);
$editForm = $this->createForm('CameraBundle\Form\FlashType', $flash);
$editForm = $this->createForm('App\Form\FlashType', $flash);
$editForm->handleRequest($request);
if ($editForm->isSubmitted() && $editForm->isValid()) {

View File

@ -1,9 +1,9 @@
<?php
namespace CameraBundle\Controller;
namespace App\Controller;
use CameraBundle\Entity\Lenses;
use CameraBundle\Form\LensesType;
use App\Entity\Lenses;
use App\Form\LensesType;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\{Method, Route};
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Form\FormInterface;
@ -26,7 +26,7 @@ class LensesController extends Controller
{
$em = $this->getDoctrine()->getManager();
$lenses = $em->getRepository('CameraBundle:Lenses')->findBy([], [
$lenses = $em->getRepository('App:Lenses')->findBy([], [
'received' => 'DESC',
'brand' => 'ASC',
'productLine' => 'ASC',

View File

@ -1,9 +1,9 @@
<?php
namespace CameraBundle\Controller;
namespace App\Controller;
use CameraBundle\Entity\PreviouslyOwnedCamera;
use CameraBundle\Form\PreviouslyOwnedCameraType;
use App\Entity\PreviouslyOwnedCamera;
use App\Form\PreviouslyOwnedCameraType;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\{Method, Route};
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Form\FormInterface;
@ -27,7 +27,7 @@ class PreviouslyOwnedCameraController extends Controller
{
$em = $this->getDoctrine()->getManager();
$previouslyOwnedCameras = $em->getRepository('CameraBundle:PreviouslyOwnedCamera')->findBy([], [
$previouslyOwnedCameras = $em->getRepository('App:PreviouslyOwnedCamera')->findBy([], [
'brand' => 'ASC',
'mount' => 'ASC',
'model' => 'ASC',

View File

@ -1,8 +1,8 @@
<?php
namespace CameraBundle\Controller;
namespace App\Controller;
use CameraBundle\Entity\PreviouslyOwnedFlash;
use App\Entity\PreviouslyOwnedFlash;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
@ -25,7 +25,7 @@ class PreviouslyOwnedFlashController extends Controller
{
$em = $this->getDoctrine()->getManager();
$previouslyOwnedFlashes = $em->getRepository('CameraBundle:PreviouslyOwnedFlash')->findBy([], [
$previouslyOwnedFlashes = $em->getRepository('App:PreviouslyOwnedFlash')->findBy([], [
'brand' => 'ASC',
'model' => 'ASC'
]);
@ -44,7 +44,7 @@ class PreviouslyOwnedFlashController extends Controller
public function newAction(Request $request)
{
$previouslyOwnedFlash = new Previouslyownedflash();
$form = $this->createForm('CameraBundle\Form\PreviouslyOwnedFlashType', $previouslyOwnedFlash);
$form = $this->createForm('App\Form\PreviouslyOwnedFlashType', $previouslyOwnedFlash);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
@ -82,7 +82,7 @@ class PreviouslyOwnedFlashController extends Controller
*/
public function editAction(Request $request, PreviouslyOwnedFlash $previouslyOwnedFlash)
{
$editForm = $this->createForm('CameraBundle\Form\PreviouslyOwnedFlashType', $previouslyOwnedFlash);
$editForm = $this->createForm('App\Form\PreviouslyOwnedFlashType', $previouslyOwnedFlash);
$editForm->handleRequest($request);
if ($editForm->isSubmitted() && $editForm->isValid()) {

View File

@ -1,8 +1,8 @@
<?php
namespace CameraBundle\Controller;
namespace App\Controller;
use CameraBundle\Entity\PreviouslyOwnedLenses;
use App\Entity\PreviouslyOwnedLenses;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
@ -25,7 +25,7 @@ class PreviouslyOwnedLensesController extends Controller
{
$em = $this->getDoctrine()->getManager();
$previouslyOwnedLenses = $em->getRepository('CameraBundle:PreviouslyOwnedLenses')->findBy([], [
$previouslyOwnedLenses = $em->getRepository('App:PreviouslyOwnedLenses')->findBy([], [
'brand' => 'ASC',
'productLine' => 'ASC',
'mount' => 'ASC',
@ -59,7 +59,7 @@ class PreviouslyOwnedLensesController extends Controller
*/
public function editAction(Request $request, PreviouslyOwnedLenses $previouslyOwnedLense)
{
$editForm = $this->createForm('CameraBundle\Form\PreviouslyOwnedLensesType', $previouslyOwnedLense);
$editForm = $this->createForm('App\Form\PreviouslyOwnedLensesType', $previouslyOwnedLense);
$editForm->handleRequest($request);
if ($editForm->isSubmitted() && $editForm->isValid()) {

View File

@ -1,6 +1,6 @@
<?php
namespace CameraBundle\Entity;
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;

View File

@ -1,6 +1,6 @@
<?php
namespace CameraBundle\Entity;
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
@ -10,7 +10,7 @@ use Doctrine\ORM\Mapping as ORM;
* @ORM\Table(name="camera", schema="camera", indexes={
@ORM\Index(name="IDX_747C826FC54C8C93", columns={"type_id"})
})
* @ORM\Entity(repositoryClass="CameraBundle\Repository\CameraRepository")
* @ORM\Entity(repositoryClass="App\Repository\CameraRepository")
*/
class Camera {
use CameraTrait;

View File

@ -1,13 +1,13 @@
<?php declare(strict_types=1);
namespace CameraBundle\Entity;
namespace App\Entity;
/**
* Trait CameraTrait
*
* Shared columns for camera, and previously_owned_camera tables
*
* @package CameraBundle\Entity
* @package App\Entity
*/
trait CameraTrait
{

View File

@ -1,6 +1,6 @@
<?php
namespace CameraBundle\Entity;
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;

View File

@ -1,6 +1,6 @@
<?php declare(strict_types=1);
namespace CameraBundle\Entity;
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;

View File

@ -1,6 +1,6 @@
<?php
namespace CameraBundle\Entity;
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;

View File

@ -1,6 +1,6 @@
<?php
namespace CameraBundle\Entity;
namespace App\Entity;
trait FlashTrait
{

View File

@ -1,6 +1,6 @@
<?php
namespace CameraBundle\Entity;
namespace App\Entity;
trait LensTrait
{

View File

@ -1,6 +1,6 @@
<?php
namespace CameraBundle\Entity;
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
@ -8,7 +8,7 @@ use Doctrine\ORM\Mapping as ORM;
* Camera.lenses
*
* @ORM\Table(name="lenses", schema="camera")
* @ORM\Entity(repositoryClass="CameraBundle\Repository\LensesRepository")
* @ORM\Entity(repositoryClass="App\Repository\LensesRepository")
*/
class Lenses
{

View File

@ -1,6 +1,6 @@
<?php
namespace CameraBundle\Entity;
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
@ -8,7 +8,7 @@ use Doctrine\ORM\Mapping as ORM;
* Camera.previouslyOwnedCamera
*
* @ORM\Table(name="previously_owned_camera", schema="camera", indexes={@ORM\Index(name="IDX_6EF94C6BC54C8C93", columns={"type_id"})})
* @ORM\Entity(repositoryClass="CameraBundle\Repository\CameraRepository")
* @ORM\Entity(repositoryClass="App\Repository\CameraRepository")
*/
class PreviouslyOwnedCamera
{

View File

@ -1,6 +1,6 @@
<?php
namespace CameraBundle\Entity;
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;

View File

@ -1,6 +1,6 @@
<?php
namespace CameraBundle\Entity;
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
@ -8,7 +8,7 @@ use Doctrine\ORM\Mapping as ORM;
* Camera.previouslyOwnedLenses
*
* @ORM\Table(name="previously_owned_lenses", schema="camera")
* @ORM\Entity(repositoryClass="CameraBundle\Repository\LensesRepository")
* @ORM\Entity(repositoryClass="App\Repository\LensesRepository")
*/
class PreviouslyOwnedLenses
{

View File

@ -1,6 +1,6 @@
<?php
namespace CameraBundle\Entity;
namespace App\Entity;
trait PurchasePriceTrait
{

View File

@ -1,12 +1,12 @@
<?php
namespace CameraBundle\Form;
namespace App\Form;
use Symfony\Component\Form\{AbstractType, FormBuilderInterface};
use Symfony\Component\OptionsResolver\Exception\AccessException;
use Symfony\Component\OptionsResolver\OptionsResolver;
use CameraBundle\Entity\Camera;
use App\Entity\Camera;
class CameraType extends AbstractType
{

View File

@ -1,12 +1,12 @@
<?php
namespace CameraBundle\Form;
namespace App\Form;
use Symfony\Component\Form\{AbstractType, FormBuilderInterface};
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\Exception\AccessException;
use CameraBundle\Entity\CameraType;
use App\Entity\CameraType;
class CameraTypeType extends AbstractType
{

View File

@ -1,12 +1,12 @@
<?php
namespace CameraBundle\Form;
namespace App\Form;
use Symfony\Component\Form\{AbstractType, FormBuilderInterface};
use Symfony\Component\OptionsResolver\Exception\AccessException;
use Symfony\Component\OptionsResolver\OptionsResolver;
use CameraBundle\Entity\Flash;
use App\Entity\Flash;
class FlashType extends AbstractType
{

View File

@ -1,12 +1,12 @@
<?php
namespace CameraBundle\Form;
namespace App\Form;
use Symfony\Component\Form\{AbstractType, FormBuilderInterface};
use Symfony\Component\OptionsResolver\Exception\AccessException;
use Symfony\Component\OptionsResolver\OptionsResolver;
use CameraBundle\Entity\Lenses;
use App\Entity\Lenses;
class LensesType extends AbstractType
{

View File

@ -1,12 +1,12 @@
<?php
namespace CameraBundle\Form;
namespace App\Form;
use Symfony\Component\Form\{AbstractType, FormBuilderInterface};
use Symfony\Component\OptionsResolver\Exception\AccessException;
use Symfony\Component\OptionsResolver\OptionsResolver;
use CameraBundle\Entity\PreviouslyOwnedCamera;
use App\Entity\PreviouslyOwnedCamera;
class PreviouslyOwnedCameraType extends AbstractType
{

View File

@ -1,12 +1,12 @@
<?php
namespace CameraBundle\Form;
namespace App\Form;
use Symfony\Component\Form\{AbstractType, FormBuilderInterface};
use Symfony\Component\OptionsResolver\Exception\AccessException;
use Symfony\Component\OptionsResolver\OptionsResolver;
use CameraBundle\Entity\PreviouslyOwnedFlash;
use App\Entity\PreviouslyOwnedFlash;
class PreviouslyOwnedFlashType extends AbstractType
{

View File

@ -1,12 +1,12 @@
<?php
namespace CameraBundle\Form;
namespace App\Form;
use Symfony\Component\Form\{AbstractType, FormBuilderInterface};
use Symfony\Component\OptionsResolver\Exception\AccessException;
use Symfony\Component\OptionsResolver\OptionsResolver;
use CameraBundle\Entity\PreviouslyOwnedLenses;
use App\Entity\PreviouslyOwnedLenses;
class PreviouslyOwnedLensesType extends AbstractType
{

View File

@ -1,6 +1,6 @@
<?php
namespace CameraBundle;
namespace App;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\Config\Loader\LoaderInterface;

View File

@ -1,6 +1,6 @@
<?php declare(strict_types=1);
namespace CameraBundle\Repository;
namespace App\Repository;
trait AcquireTrait {

View File

@ -1,8 +1,8 @@
<?php declare(strict_types=1);
namespace CameraBundle\Repository;
namespace App\Repository;
use CameraBundle\Entity\{Camera, PreviouslyOwnedCamera};
use App\Entity\{Camera, PreviouslyOwnedCamera};
use Doctrine\ORM\{
EntityRepository, ORMInvalidArgumentException
};

View File

@ -1,8 +1,8 @@
<?php declare(strict_types=1);
namespace CameraBundle\Repository;
namespace App\Repository;
use CameraBundle\Entity\{Flash, PreviouslyOwnedFlash};
use App\Entity\{Flash, PreviouslyOwnedFlash};
use Doctrine\ORM\{
EntityRepository, ORMInvalidArgumentException
};

View File

@ -1,8 +1,8 @@
<?php
namespace CameraBundle\Repository;
namespace App\Repository;
use CameraBundle\Entity\{Lenses, PreviouslyOwnedLenses};
use App\Entity\{Lenses, PreviouslyOwnedLenses};
use Doctrine\ORM\EntityRepository;
class LensesRepository extends EntityRepository

View File

@ -1,6 +1,6 @@
<?php
namespace CameraBundle\Tests\Controller;
namespace App\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

View File

@ -1,11 +1,11 @@
<?php
namespace CameraBundle\Types;
namespace App\Types;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use CameraBundle\ValueObject\Money;
use App\ValueObject\Money;
class MoneyType extends Type {

View File

@ -1,6 +1,6 @@
<?php
namespace CameraBundle\ValueObject;
namespace App\ValueObject;
class Money {
private $value;
@ -19,4 +19,4 @@ class Money {
{
return (string)$this->getValue();
}
}
}