| @@ -145,6 +145,9 @@ | ||
| 145 | 145 | return $this->fileSystem->has($path); | 
| 146 | 146 | } | 
| 147 | 147 | |
| 148 | + /** | |
| 149 | + * @param string $customStyleString | |
| 150 | + */ | |
| 148 | 151 | public function createCustomStyledImage(ResponsiveImageInterface $image, $customStyleString, $forceGenerate = false) | 
| 149 | 152 |      { | 
| 150 | 153 | // @TODO: To avoid creating images, that already exist, check if it exists, need a way to disable this checking | 
| @@ -60,6 +60,9 @@ | ||
| 60 | 60 | } | 
| 61 | 61 | } | 
| 62 | 62 | |
| 63 | + /** | |
| 64 | + * @param string $src | |
| 65 | + */ | |
| 63 | 66 | public function setImageAttributes(ResponsiveImageInterface $image, $styleName = null, $src = null) | 
| 64 | 67 |      { | 
| 65 | 68 | // Use the style data to figure out the width and height for this image | 
| @@ -60,6 +60,9 @@ | ||
| 60 | 60 | return $this->path; | 
| 61 | 61 | } | 
| 62 | 62 | |
| 63 | + /** | |
| 64 | + * @param string $path | |
| 65 | + */ | |
| 63 | 66 | public function setPath($path) | 
| 64 | 67 |      { | 
| 65 | 68 | $this->path = $path; | 
| @@ -77,6 +77,9 @@ | ||
| 77 | 77 | return $exitCode; | 
| 78 | 78 | } | 
| 79 | 79 | |
| 80 | + /** | |
| 81 | + * @param string $serviceName | |
| 82 | + */ | |
| 80 | 83 | protected function getService($serviceName) | 
| 81 | 84 |      { | 
| 82 | 85 |          if (empty($this->testKernel)) { | 
| @@ -51,7 +51,7 @@ discard block | ||
| 51 | 51 | } | 
| 52 | 52 | |
| 53 | 53 | /** | 
| 54 | - * @return array | |
| 54 | + * @return \Twig_SimpleFunction[] | |
| 55 | 55 | */ | 
| 56 | 56 | public function getFunctions() | 
| 57 | 57 |      { | 
| @@ -101,7 +101,7 @@ discard block | ||
| 101 | 101 | * @param $pictureSetName | 
| 102 | 102 | * @param $selector | 
| 103 | 103 | * | 
| 104 | - * @return mixed|string | |
| 104 | + * @return string | |
| 105 | 105 | */ | 
| 106 | 106 | public function generateBackgroundImage(\Twig_Environment $environment, ResponsiveImageInterface $image, $pictureSetName, $selector) | 
| 107 | 107 |      { | 
| @@ -125,7 +125,7 @@ discard block | ||
| 125 | 125 | * @param $pictureSetName | 
| 126 | 126 | * @param bool $generate | 
| 127 | 127 | * | 
| 128 | - * @return mixed|string | |
| 128 | + * @return string | |
| 129 | 129 | */ | 
| 130 | 130 | public function generatePictureImage(\Twig_Environment $environment, ResponsiveImageInterface $image, $pictureSetName, $generate = false) | 
| 131 | 131 |      { | 
| @@ -146,7 +146,7 @@ discard block | ||
| 146 | 146 | * @internal | 
| 147 | 147 | * | 
| 148 | 148 | * @param array $data | 
| 149 | - * @param array $keys | |
| 149 | + * @param string[] $keys | |
| 150 | 150 | */ | 
| 151 | 151 | private function convertPathsToUrls(array &$data, array $keys) | 
| 152 | 152 |      { | 
| @@ -188,7 +188,7 @@ discard block | ||
| 188 | 188 | * @param $pictureSetName | 
| 189 | 189 | * @param bool $generate | 
| 190 | 190 | * | 
| 191 | - * @return mixed|string | |
| 191 | + * @return string | |
| 192 | 192 | */ | 
| 193 | 193 | public function generateSizesImage(\Twig_Environment $environment, ResponsiveImageInterface $image, $pictureSetName, $generate = false) | 
| 194 | 194 |      { | 
| @@ -216,7 +216,7 @@ discard block | ||
| 216 | 216 | * @param null $styleName | 
| 217 | 217 | * @param bool $generate | 
| 218 | 218 | * | 
| 219 | - * @return mixed|string | |
| 219 | + * @return string | |
| 220 | 220 | */ | 
| 221 | 221 | public function generateStyledImage(\Twig_Environment $environment, ResponsiveImageInterface $image, $styleName = null, $generate = false) | 
| 222 | 222 |      { | 
| @@ -231,7 +231,7 @@ discard block | ||
| 231 | 231 | * @param string $width | 
| 232 | 232 | * @param null $height | 
| 233 | 233 | * | 
| 234 | - * @return mixed|string | |
| 234 | + * @return string | |
| 235 | 235 | */ | 
| 236 | 236 | public function cropImage(\Twig_Environment $environment, ResponsiveImageInterface $image, $width = '', $height = null) | 
| 237 | 237 |      { | 
| @@ -250,7 +250,7 @@ discard block | ||
| 250 | 250 | * @param string $width | 
| 251 | 251 | * @param string $height | 
| 252 | 252 | * | 
| 253 | - * @return mixed|string | |
| 253 | + * @return string | |
| 254 | 254 | */ | 
| 255 | 255 | public function scaleImage(\Twig_Environment $environment, ResponsiveImageInterface $image, $width = '', $height = '') | 
| 256 | 256 |      { | 
| @@ -266,9 +266,9 @@ discard block | ||
| 266 | 266 | /** | 
| 267 | 267 | * @param \Twig_Environment $environment | 
| 268 | 268 | * @param ResponsiveImageInterface $image | 
| 269 | - * @param null $styleName | |
| 269 | + * @param null|string $styleName | |
| 270 | 270 | * | 
| 271 | - * @return mixed|string | |
| 271 | + * @return string | |
| 272 | 272 | */ | 
| 273 | 273 | protected function renderImage(\Twig_Environment $environment, ResponsiveImageInterface $image, $styleName = null) | 
| 274 | 274 |      { | 
| @@ -14,7 +14,6 @@ | ||
| 14 | 14 | use IrishDan\ResponsiveImageBundle\Event\ImageEvent; | 
| 15 | 15 | use IrishDan\ResponsiveImageBundle\Event\ImageEvents; | 
| 16 | 16 | use IrishDan\ResponsiveImageBundle\ImageProcessing\ImageManager; | 
| 17 | - | |
| 18 | 17 | use Symfony\Component\EventDispatcher\EventSubscriberInterface; | 
| 19 | 18 | |
| 20 | 19 | /** | 
| @@ -13,7 +13,6 @@ | ||
| 13 | 13 | use IrishDan\ResponsiveImageBundle\Event\UploaderEvent; | 
| 14 | 14 | use IrishDan\ResponsiveImageBundle\Event\UploaderEvents; | 
| 15 | 15 | use League\Flysystem\FilesystemInterface; | 
| 16 | - | |
| 17 | 16 | use Symfony\Component\EventDispatcher\EventSubscriberInterface; | 
| 18 | 17 | |
| 19 | 18 | /** | 
| @@ -97,8 +97,8 @@ discard block | ||
| 97 | 97 | * @param string $axis | 
| 98 | 98 | * @param $cropCoordinates | 
| 99 | 99 | * @param $aspectRatio | 
| 100 | - * @param $newWidth | |
| 101 | - * @param $newHeight | |
| 100 | + * @param integer $newWidth | |
| 101 | + * @param integer $newHeight | |
| 102 | 102 | * | 
| 103 | 103 | * @return array | 
| 104 | 104 | */ | 
| @@ -159,7 +159,7 @@ discard block | ||
| 159 | 159 | } | 
| 160 | 160 | |
| 161 | 161 | /** | 
| 162 | - * @param $axis | |
| 162 | + * @param string $axis | |
| 163 | 163 | * @param string $type | 
| 164 | 164 | * | 
| 165 | 165 | * @return mixed | 
| @@ -255,10 +255,10 @@ discard block | ||
| 255 | 255 | } | 
| 256 | 256 | |
| 257 | 257 | /** | 
| 258 | - * @param $focusNear | |
| 258 | + * @param double $focusNear | |
| 259 | 259 | * @param $focusFar | 
| 260 | 260 | * @param $cropLength | 
| 261 | - * @param $imageLength | |
| 261 | + * @param integer $imageLength | |
| 262 | 262 | * | 
| 263 | 263 | * @return array | 
| 264 | 264 | */ | 
| @@ -296,7 +296,7 @@ discard block | ||
| 296 | 296 | * Tests if a given offset is valid. | 
| 297 | 297 | * Valid offsets cropped images will include the focus rectangle and will not fall outside of the original image. | 
| 298 | 298 | * | 
| 299 | - * @param $point | |
| 299 | + * @param integer $point | |
| 300 | 300 | * @param $cropLength | 
| 301 | 301 | * @param $imageLength | 
| 302 | 302 | * @param $focusNear | 
| @@ -120,8 +120,8 @@ discard block | ||
| 120 | 120 | * Performs the image manipulation using current style information | 
| 121 | 121 | * and user defined crop and focus rectangles. | 
| 122 | 122 | * | 
| 123 | - * @param $source | |
| 124 | - * @param $destination | |
| 123 | + * @param string $source | |
| 124 | + * @param string $destination | |
| 125 | 125 | * @param array $style | 
| 126 | 126 | * @param null $cropFocusCoords | 
| 127 | 127 | * | 
| @@ -177,6 +177,10 @@ discard block | ||
| 177 | 177 | $this->image->fit( | 
| 178 | 178 | $this->styleData['width'], | 
| 179 | 179 | $this->styleData['height'], | 
| 180 | + | |
| 181 | + /** | |
| 182 | + * @param string $constraint | |
| 183 | + */ | |
| 180 | 184 |                          function ($constraint) { | 
| 181 | 185 | $constraint->upsize(); | 
| 182 | 186 | } |