From 26e0b8a6fcb2f5a114c668f4816b1c963ff1081c Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Wed, 14 Feb 2018 16:42:39 -0500 Subject: [PATCH] Migrate from CameraBundle to App namespace --- bin/console | 2 +- composer.json | 4 ++-- config/bundles.php | 2 +- config/packages/doctrine.yaml | 8 ++++---- config/services-orig.yaml | 8 ++++---- config/services.yaml | 8 ++++---- public/index.php | 2 +- src/{CameraBundle.php => App.php} | 6 +++--- src/Controller/CameraController.php | 8 ++++---- src/Controller/CameraTypeController.php | 10 +++++----- src/Controller/DefaultController.php | 2 +- src/Controller/FlashController.php | 10 +++++----- src/Controller/LensesController.php | 8 ++++---- src/Controller/PreviouslyOwnedCameraController.php | 8 ++++---- src/Controller/PreviouslyOwnedFlashController.php | 10 +++++----- src/Controller/PreviouslyOwnedLensesController.php | 8 ++++---- src/Entity/BatteryType.php | 2 +- src/Entity/Camera.php | 4 ++-- src/Entity/CameraTrait.php | 4 ++-- src/Entity/CameraType.php | 2 +- src/Entity/Film.php | 2 +- src/Entity/Flash.php | 2 +- src/Entity/FlashTrait.php | 2 +- src/Entity/LensTrait.php | 2 +- src/Entity/Lenses.php | 4 ++-- src/Entity/PreviouslyOwnedCamera.php | 4 ++-- src/Entity/PreviouslyOwnedFlash.php | 2 +- src/Entity/PreviouslyOwnedLenses.php | 4 ++-- src/Entity/PurchasePriceTrait.php | 2 +- src/Form/CameraType.php | 4 ++-- src/Form/CameraTypeType.php | 4 ++-- src/Form/FlashType.php | 4 ++-- src/Form/LensesType.php | 4 ++-- src/Form/PreviouslyOwnedCameraType.php | 4 ++-- src/Form/PreviouslyOwnedFlashType.php | 4 ++-- src/Form/PreviouslyOwnedLensesType.php | 4 ++-- src/Kernel.php | 2 +- src/Repository/AcquireTrait.php | 2 +- src/Repository/CameraRepository.php | 4 ++-- src/Repository/FlashRepository.php | 4 ++-- src/Repository/LensesRepository.php | 4 ++-- .../Controller/PreviouslyOwnedFlashControllerTest.php | 2 +- src/Types/MoneyType.php | 4 ++-- src/ValueObject/Money.php | 4 ++-- 44 files changed, 97 insertions(+), 97 deletions(-) rename src/{CameraBundle.php => App.php} (50%) diff --git a/bin/console b/bin/console index bc672cc..d026a6d 100755 --- a/bin/console +++ b/bin/console @@ -1,7 +1,7 @@ #!/usr/bin/env php ['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], diff --git a/config/packages/doctrine.yaml b/config/packages/doctrine.yaml index ea4b78a..b0c0bcc 100644 --- a/config/packages/doctrine.yaml +++ b/config/packages/doctrine.yaml @@ -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 diff --git a/config/services-orig.yaml b/config/services-orig.yaml index 06ef161..21da1e0 100644 --- a/config/services-orig.yaml +++ b/config/services-orig.yaml @@ -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' diff --git a/config/services.yaml b/config/services.yaml index feba3d6..a93441a 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -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' diff --git a/public/index.php b/public/index.php index 805452d..b5a10c3 100644 --- a/public/index.php +++ b/public/index.php @@ -1,6 +1,6 @@ getDoctrine()->getManager(); - $cameras = $em->getRepository('CameraBundle:Camera')->findBy([], [ + $cameras = $em->getRepository('App:Camera')->findBy([], [ 'received' => 'DESC', 'brand' => 'ASC', 'mount' => 'ASC', diff --git a/src/Controller/CameraTypeController.php b/src/Controller/CameraTypeController.php index 689d3a2..7c3d19f 100644 --- a/src/Controller/CameraTypeController.php +++ b/src/Controller/CameraTypeController.php @@ -1,8 +1,8 @@ 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()) { diff --git a/src/Controller/DefaultController.php b/src/Controller/DefaultController.php index c5d0d00..889039e 100644 --- a/src/Controller/DefaultController.php +++ b/src/Controller/DefaultController.php @@ -1,6 +1,6 @@ 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()) { diff --git a/src/Controller/LensesController.php b/src/Controller/LensesController.php index d808df2..6f6dd8f 100644 --- a/src/Controller/LensesController.php +++ b/src/Controller/LensesController.php @@ -1,9 +1,9 @@ getDoctrine()->getManager(); - $lenses = $em->getRepository('CameraBundle:Lenses')->findBy([], [ + $lenses = $em->getRepository('App:Lenses')->findBy([], [ 'received' => 'DESC', 'brand' => 'ASC', 'productLine' => 'ASC', diff --git a/src/Controller/PreviouslyOwnedCameraController.php b/src/Controller/PreviouslyOwnedCameraController.php index 0976184..863f03e 100644 --- a/src/Controller/PreviouslyOwnedCameraController.php +++ b/src/Controller/PreviouslyOwnedCameraController.php @@ -1,9 +1,9 @@ getDoctrine()->getManager(); - $previouslyOwnedCameras = $em->getRepository('CameraBundle:PreviouslyOwnedCamera')->findBy([], [ + $previouslyOwnedCameras = $em->getRepository('App:PreviouslyOwnedCamera')->findBy([], [ 'brand' => 'ASC', 'mount' => 'ASC', 'model' => 'ASC', diff --git a/src/Controller/PreviouslyOwnedFlashController.php b/src/Controller/PreviouslyOwnedFlashController.php index 815f069..9b47ed3 100644 --- a/src/Controller/PreviouslyOwnedFlashController.php +++ b/src/Controller/PreviouslyOwnedFlashController.php @@ -1,8 +1,8 @@ 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()) { diff --git a/src/Controller/PreviouslyOwnedLensesController.php b/src/Controller/PreviouslyOwnedLensesController.php index 268178b..5e64f35 100644 --- a/src/Controller/PreviouslyOwnedLensesController.php +++ b/src/Controller/PreviouslyOwnedLensesController.php @@ -1,8 +1,8 @@ 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()) { diff --git a/src/Entity/BatteryType.php b/src/Entity/BatteryType.php index 643fa95..f8cd5c8 100644 --- a/src/Entity/BatteryType.php +++ b/src/Entity/BatteryType.php @@ -1,6 +1,6 @@ getValue(); } -} \ No newline at end of file +}