Skip to content

Commit 12e95e0

Browse files
committed
Merge pull request #2 from kokspflanze/improvement/doc_block
Improvement/doc block
2 parents 0ae64a1 + c9dc04f commit 12e95e0

File tree

11 files changed

+53
-16
lines changed

11 files changed

+53
-16
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
"phpmd/phpmd": "2.*",
4343
"sebastian/phpcpd": "2.*",
4444
"theseer/phpdox": "0.7.*",
45-
"nikic/php-parser": "<1.2.0"
45+
"nikic/php-parser": "<1.2.0",
46+
"zendframework/zend-serializer": "~2.5"
4647
},
4748
"autoload": {
4849
"psr-0" : {

src/TckImageResizer/Controller/IndexController.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ class IndexController extends AbstractActionController
3434

3535
/**
3636
* constructor
37-
*
38-
* @param ImageProcessing
37+
*
38+
* @param ImageProcessing $imageProcessing
39+
* @param string $publicDirectory
3940
*/
4041
public function __construct(ImageProcessing $imageProcessing, $publicDirectory = 'public')
4142
{
@@ -45,8 +46,9 @@ public function __construct(ImageProcessing $imageProcessing, $publicDirectory =
4546

4647
/**
4748
* set the image processing service
48-
*
49-
* @param ImageProcessing
49+
*
50+
* @param ImageProcessing $imageProcessing
51+
* @return $this
5052
*/
5153
public function setImageProcessing(ImageProcessing $imageProcessing)
5254
{
@@ -64,8 +66,10 @@ public function getImageProcessing()
6466
{
6567
return $this->imageProcessing;
6668
}
67-
68-
69+
70+
/**
71+
* @return \Zend\Http\Response
72+
*/
6973
public function resizeAction()
7074
{
7175
$source = $this->publicDirectory . '/'
@@ -92,7 +96,8 @@ public function resizeAction()
9296

9397
$imageInfo = getimagesize($target);
9498
$mimeType = $imageInfo['mime'];
95-
99+
100+
/** @var \Zend\Http\Response $response */
96101
$response = $this->getResponse();
97102
$response->setContent(file_get_contents($target));
98103
$response->setStatusCode($source ? 200 : 404);

src/TckImageResizer/Controller/IndexControllerFactory.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ class IndexControllerFactory implements FactoryInterface
2323
{
2424
/**
2525
* Create Service Factory
26-
*
27-
* @param ServiceLocatorInterface $serviceLocator
26+
*
27+
* @param \Zend\Mvc\Controller\ControllerManager|ServiceLocatorInterface $serviceLocator
28+
* @return IndexController
2829
*/
2930
public function createService(ServiceLocatorInterface $serviceLocator)
3031
{

src/TckImageResizer/Service/ImageProcessing.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ public function __construct(AbstractImagine $imagine)
4949

5050
/**
5151
* set the imagine service
52-
*
53-
* @param AbstractImagine
52+
*
53+
* @param AbstractImagine $imagine
54+
* @return $this
5455
*/
5556
public function setImagineService(AbstractImagine $imagine)
5657
{

src/TckImageResizer/Service/ImageProcessingFactory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ class ImageProcessingFactory implements FactoryInterface
2626
{
2727
/**
2828
* Create Service Factory
29-
*
29+
*
3030
* @param ServiceLocatorInterface $serviceLocator
31+
* @return ImageProcessing
3132
*/
3233
public function createService(ServiceLocatorInterface $serviceLocator)
3334
{
35+
/** @var \Imagine\Gd\Imagine $imagine */
3436
$imagine = $serviceLocator->get('TckImageResizerImagine');
3537

3638
$service = new ImageProcessing($imagine);

test/Bootstrap.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313

1414
class Bootstrap
1515
{
16+
/** @var ServiceManager */
1617
protected static $serviceManager;
17-
protected static $config;
18-
protected static $bootstrap;
18+
/** @var array */
19+
protected static $config = array();
1920

2021
public static function init()
2122
{
@@ -60,11 +61,17 @@ public static function init()
6061
static::$config = $config;
6162
}
6263

64+
/**
65+
* @return ServiceManager
66+
*/
6367
public static function getServiceManager()
6468
{
6569
return static::$serviceManager;
6670
}
6771

72+
/**
73+
* @return array
74+
*/
6875
public static function getConfig()
6976
{
7077
return static::$config;
@@ -100,6 +107,10 @@ protected static function initAutoloader()
100107
));
101108
}
102109

110+
/**
111+
* @param $path
112+
* @return bool|string
113+
*/
103114
protected static function findParentPath($path)
104115
{
105116
$dir = __DIR__;

test/TckImageResizerTest/Controller/IndexControllerFactoryTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818
class IndexControllerFactoryTest extends PHPUnit_Framework_TestCase
1919
{
20+
/** @var \Zend\Mvc\Controller\ControllerManager */
2021
protected $controllerManager;
22+
/** @var IndexControllerFactory */
2123
protected $controllerFactory;
2224

2325
protected function setUp()

test/TckImageResizerTest/Controller/IndexControllerTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@
2323

2424
class IndexControllerTest extends PHPUnit_Framework_TestCase
2525
{
26+
/** @var IndexController */
2627
protected $controller;
28+
/** @var Request */
2729
protected $request;
30+
/** @var RouteMatch */
2831
protected $routeMatch;
32+
/** @var MvcEvent */
2933
protected $event;
34+
/** @var \org\bovigo\vfs\vfsStreamDirectory */
3035
protected $fileSystem;
3136

3237
protected function setUp()
@@ -39,7 +44,8 @@ protected function setUp()
3944
),
4045
'processed' => array(),
4146
));
42-
47+
48+
/** @var \TckImageResizer\Service\ImageProcessing $imageProcessing */
4349
$imageProcessing = $serviceManager->get('TckImageResizer\Service\ImageProcessing');
4450
$this->controller = new IndexController($imageProcessing, vfsStream::url('public'));
4551
$this->request = new Request();

test/TckImageResizerTest/Service/ImageProcessingFactoryTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818
class ImageProcessingFactoryTest extends PHPUnit_Framework_TestCase
1919
{
20+
/** @var serviceManager */
2021
protected $serviceManager;
22+
/** @var ImageProcessingFactory */
2123
protected $imageProcessingFactory;
2224

2325
protected function setUp()

test/TckImageResizerTest/Service/ImageProcessingTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@
1717
use PHPUnit_Framework_TestCase;
1818
use org\bovigo\vfs\vfsStream;
1919
use org\bovigo\vfs\vfsStreamWrapper;
20+
use TckImageResizer\Exception\BadMethodCallException;
2021

2122
class ImageProcessingTest extends PHPUnit_Framework_TestCase
2223
{
24+
/** @var \Zend\ServiceManager\ServiceManager */
2325
protected $serviceManager;
2426
protected $fileSystem;
27+
/** @var \Imagine\Gd\Imagine */
2528
protected $imagine;
29+
/** @var ImageProcessing */
2630
protected $imageProcessing;
2731

2832
protected function setUp()

test/TckImageResizerTest/View/Helper/ResizeTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818
class ResizeTest extends PHPUnit_Framework_TestCase
1919
{
20+
/** @var PhpRenderer */
2021
protected $view;
22+
/** @var Resize */
2123
protected $helper;
2224

2325
protected function setUp()

0 commit comments

Comments
 (0)