Skip to content

Commit

Permalink
Update class namespaces of Contao\Image
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed Jul 28, 2016
1 parent 1cca8a0 commit 386fe86
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 61 deletions.
12 changes: 6 additions & 6 deletions src/Image/ImageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
use Imagine\Image\Point;
use Imagine\Image\ImagineInterface;
use Contao\CoreBundle\Framework\ContaoFrameworkInterface;
use Contao\Image\ResizerInterface;
use Contao\Image\Image;
use Contao\Image\ResizeConfiguration;
use Contao\Image\ResizeConfigurationInterface;
use Contao\Image\ResizeOptions;
use Contao\Image\ImportantPart;
use Contao\Image\Resize\ResizerInterface;
use Contao\Image\Image\Image;
use Contao\Image\Resize\ResizeConfiguration;
use Contao\Image\Resize\ResizeConfigurationInterface;
use Contao\Image\Resize\ResizeOptions;
use Contao\Image\Image\ImportantPart;
use Symfony\Component\Filesystem\Filesystem;

/**
Expand Down
10 changes: 5 additions & 5 deletions src/Image/PictureFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
namespace Contao\CoreBundle\Image;

use Contao\CoreBundle\Framework\ContaoFrameworkInterface;
use Contao\Image\PictureGeneratorInterface;
use Contao\Image\PictureConfiguration;
use Contao\Image\ResizeConfiguration;
use Contao\Image\ResizeOptions;
use Contao\Image\PictureConfigurationItem;
use Contao\Image\Picture\PictureGeneratorInterface;
use Contao\Image\Picture\PictureConfiguration;
use Contao\Image\Resize\ResizeConfiguration;
use Contao\Image\Resize\ResizeOptions;
use Contao\Image\Picture\PictureConfigurationItem;

/**
* Creates Picture objects.
Expand Down
14 changes: 7 additions & 7 deletions src/Image/Resizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
use Contao\Image as LegacyImage;
use Contao\File;
use Contao\System;
use Contao\Image\Resizer as ImageResizer;
use Contao\Image\ImageInterface;
use Contao\Image\ResizeConfigurationInterface;
use Contao\Image\ResizeCoordinatesInterface;
use Contao\Image\ResizeOptionsInterface;
use Contao\Image\ImportantPartInterface;
use Contao\Image\Resize\Resizer as ImageResizer;
use Contao\Image\Image\ImageInterface;
use Contao\Image\Resize\ResizeConfigurationInterface;
use Contao\Image\Resize\ResizeCoordinatesInterface;
use Contao\Image\Resize\ResizeOptionsInterface;
use Contao\Image\Image\ImportantPartInterface;
use Symfony\Component\Filesystem\Filesystem;

/**
* Resizes Image objects via Contao\Image\Resizer and executes legacy hooks.
* Resizes Image objects via Contao\Image\Resize\Resizer and executes legacy hooks.
*
* @author Martin Auswöger <martin@auswoeger.com>
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ services:
class: Contao\ImagineSvg\Imagine

contao.image.resize_calculator:
class: Contao\Image\ResizeCalculator
class: Contao\Image\Resize\ResizeCalculator
public: false

contao.image.resizer:
Expand All @@ -158,7 +158,7 @@ services:
- %contao.image.valid_extensions%

contao.image.picture_generator:
class: Contao\Image\PictureGenerator
class: Contao\Image\Picture\PictureGenerator
arguments:
- "@contao.image.resizer"

Expand Down
2 changes: 1 addition & 1 deletion src/Resources/contao/drivers/DC_Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Contao\CoreBundle\Exception\AccessDeniedException;
use Contao\CoreBundle\Exception\InternalServerErrorException;
use Contao\CoreBundle\Util\SymlinkUtil;
use Contao\Image\ResizeConfiguration;
use Contao\Image\Resize\ResizeConfiguration;
use Patchwork\Utf8;
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
Expand Down
10 changes: 5 additions & 5 deletions src/Resources/contao/library/Contao/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

namespace Contao;

use Contao\Image\Image as NewImage;
use Contao\Image\ImportantPart;
use Contao\Image\ImageDimensions;
use Contao\Image\ResizeConfiguration;
use Contao\Image\ResizeOptions;
use Contao\Image\Image\Image as NewImage;
use Contao\Image\Image\ImportantPart;
use Contao\Image\Image\ImageDimensions;
use Contao\Image\Resize\ResizeConfiguration;
use Contao\Image\Resize\ResizeOptions;
use Imagine\Image\Box;
use Imagine\Image\Point;

Expand Down
10 changes: 5 additions & 5 deletions src/Resources/contao/library/Contao/Picture.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

namespace Contao;

use Contao\Image\ImportantPart;
use Contao\Image\ResizeConfiguration;
use Contao\Image\ResizeOptions;
use Contao\Image\PictureConfiguration;
use Contao\Image\PictureConfigurationItem;
use Contao\Image\Image\ImportantPart;
use Contao\Image\Resize\ResizeConfiguration;
use Contao\Image\Resize\ResizeOptions;
use Contao\Image\Picture\PictureConfiguration;
use Contao\Image\Picture\PictureConfigurationItem;
use Imagine\Image\Box;
use Imagine\Image\Point;

Expand Down
2 changes: 1 addition & 1 deletion src/Resources/contao/widgets/FileSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace Contao;

use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface;
use Contao\Image\ResizeConfiguration;
use Contao\Image\Resize\ResizeConfiguration;


/**
Expand Down
24 changes: 12 additions & 12 deletions tests/Image/ImageFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
use Contao\CoreBundle\Image\ImageFactory;
use Contao\CoreBundle\Image\Resizer;
use Contao\CoreBundle\Framework\ContaoFrameworkInterface;
use Contao\Image\ImportantPart;
use Contao\Image\ResizeCalculator;
use Contao\Image\ResizeConfiguration;
use Contao\Image\Image\ImportantPart;
use Contao\Image\Resize\ResizeCalculator;
use Contao\Image\Resize\ResizeConfiguration;
use Symfony\Component\Filesystem\Filesystem;
use Imagine\Image\Box;
use Imagine\Image\Point;
Expand Down Expand Up @@ -54,7 +54,7 @@ public function tearDown()
private function createImageFactory($resizer = null, $imagine = null, $imagineSvg = null, $filesystem = null, $framework = null, $bypassCache = null, $imagineOptions = null, $validExtensions = null)
{
if (null === $resizer) {
$resizer = $this->getMockBuilder('Contao\Image\Resizer')
$resizer = $this->getMockBuilder('Contao\Image\Resize\Resizer')
->disableOriginalConstructor()
->getMock();
}
Expand Down Expand Up @@ -105,11 +105,11 @@ public function testCreate()
{
$path = $this->getRootDir() . '/images/dummy.jpg';

$imageMock = $this->getMockBuilder('Contao\Image\Image')
$imageMock = $this->getMockBuilder('Contao\Image\Image\Image')
->disableOriginalConstructor()
->getMock();

$resizer = $this->getMockBuilder('Contao\Image\Resizer')
$resizer = $this->getMockBuilder('Contao\Image\Resize\Resizer')
->disableOriginalConstructor()
->getMock();

Expand Down Expand Up @@ -190,11 +190,11 @@ public function testCreateWithImageSize()
{
$path = $this->getRootDir() . '/images/dummy.jpg';

$imageMock = $this->getMockBuilder('Contao\Image\Image')
$imageMock = $this->getMockBuilder('Contao\Image\Image\Image')
->disableOriginalConstructor()
->getMock();

$resizer = $this->getMockBuilder('Contao\Image\Resizer')
$resizer = $this->getMockBuilder('Contao\Image\Resize\Resizer')
->disableOriginalConstructor()
->getMock();

Expand Down Expand Up @@ -346,11 +346,11 @@ public function testCreateWithResizeConfiguration()
->setMode(ResizeConfiguration::MODE_BOX)
->setZoomLevel(50);

$imageMock = $this->getMockBuilder('Contao\Image\Image')
$imageMock = $this->getMockBuilder('Contao\Image\Image\Image')
->disableOriginalConstructor()
->getMock();

$resizer = $this->getMockBuilder('Contao\Image\Resizer')
$resizer = $this->getMockBuilder('Contao\Image\Resize\Resizer')
->disableOriginalConstructor()
->getMock();

Expand Down Expand Up @@ -426,7 +426,7 @@ public function testCreateWithLegacyMode($mode, $expected)
{
$path = $this->getRootDir() . '/images/none.jpg';

$imageMock = $this->getMockBuilder('Contao\Image\Image')
$imageMock = $this->getMockBuilder('Contao\Image\Image\Image')
->disableOriginalConstructor()
->getMock();

Expand All @@ -437,7 +437,7 @@ public function testCreateWithLegacyMode($mode, $expected)
->method('exists')
->willReturn(true);

$resizer = $this->getMockBuilder('Contao\Image\Resizer')
$resizer = $this->getMockBuilder('Contao\Image\Resize\Resizer')
->disableOriginalConstructor()
->getMock();

Expand Down
30 changes: 15 additions & 15 deletions tests/Image/PictureFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
use Contao\CoreBundle\Test\TestCase;
use Contao\CoreBundle\Image\PictureFactory;
use Contao\CoreBundle\Framework\ContaoFrameworkInterface;
use Contao\Image\ImportantPart;
use Contao\Image\Image;
use Contao\Image\Resizer;
use Contao\Image\ResizeConfiguration;
use Contao\Image\PictureConfiguration;
use Contao\Image\Image\ImportantPart;
use Contao\Image\Image\Image;
use Contao\Image\Resize\Resizer;
use Contao\Image\Resize\ResizeConfiguration;
use Contao\Image\Picture\PictureConfiguration;
use Symfony\Component\Filesystem\Filesystem;
use Imagine\Image\Box;
use Imagine\Image\Point;
Expand All @@ -43,7 +43,7 @@ class PictureFactoryTest extends TestCase
private function createPictureFactory($pictureGenerator = null, $imageFactory = null, $framework = null, $bypassCache = null, $imagineOptions = null)
{
if (null === $pictureGenerator) {
$pictureGenerator = $this->getMockBuilder('Contao\Image\PictureGenerator')
$pictureGenerator = $this->getMockBuilder('Contao\Image\Picture\PictureGenerator')
->disableOriginalConstructor()
->getMock();
}
Expand Down Expand Up @@ -84,15 +84,15 @@ public function testCreate()
{
$path = $this->getRootDir() . '/images/dummy.jpg';

$imageMock = $this->getMockBuilder('Contao\Image\Image')
$imageMock = $this->getMockBuilder('Contao\Image\Image\Image')
->disableOriginalConstructor()
->getMock();

$pictureMock = $this->getMockBuilder('Contao\Image\Picture')
$pictureMock = $this->getMockBuilder('Contao\Image\Picture\Picture')
->disableOriginalConstructor()
->getMock();

$pictureGenerator = $this->getMockBuilder('Contao\Image\PictureGenerator')
$pictureGenerator = $this->getMockBuilder('Contao\Image\Picture\PictureGenerator')
->disableOriginalConstructor()
->getMock();

Expand Down Expand Up @@ -225,19 +225,19 @@ public function testCreateLegacyMode()
{
$path = $this->getRootDir() . '/images/dummy.jpg';

$pictureMock = $this->getMockBuilder('Contao\Image\Picture')
$pictureMock = $this->getMockBuilder('Contao\Image\Picture\Picture')
->disableOriginalConstructor()
->getMock();

$pictureGenerator = $this->getMockBuilder('Contao\Image\PictureGenerator')
$pictureGenerator = $this->getMockBuilder('Contao\Image\Picture\PictureGenerator')
->disableOriginalConstructor()
->getMock();

$pictureGenerator->expects($this->any())
->method('generate')
->willReturn($pictureMock);

$imageMock = $this->getMockBuilder('Contao\Image\Image')
$imageMock = $this->getMockBuilder('Contao\Image\Image\Image')
->disableOriginalConstructor()
->getMock();

Expand Down Expand Up @@ -275,15 +275,15 @@ public function testCreateWithoutMode()
{
$path = $this->getRootDir() . '/images/dummy.jpg';

$imageMock = $this->getMockBuilder('Contao\Image\Image')
$imageMock = $this->getMockBuilder('Contao\Image\Image\Image')
->disableOriginalConstructor()
->getMock();

$pictureMock = $this->getMockBuilder('Contao\Image\Picture')
$pictureMock = $this->getMockBuilder('Contao\Image\Picture\Picture')
->disableOriginalConstructor()
->getMock();

$pictureGenerator = $this->getMockBuilder('Contao\Image\PictureGenerator')
$pictureGenerator = $this->getMockBuilder('Contao\Image\Picture\PictureGenerator')
->disableOriginalConstructor()
->getMock();

Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
use Contao\CoreBundle\Image\PictureFactory;
use Contao\CoreBundle\Image\ImageFactory;
use Contao\CoreBundle\Image\Resizer;
use Contao\Image\ResizeCalculator;
use Contao\Image\PictureGenerator;
use Contao\Image\Resize\ResizeCalculator;
use Contao\Image\Picture\PictureGenerator;
use Contao\ImagineSvg\Imagine as ImagineSvg;
use Imagine\Gd\Imagine as ImagineGd;
use Symfony\Component\Config\FileLocator;
Expand Down

0 comments on commit 386fe86

Please sign in to comment.