| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | 1 | public function render( |
|
| 22 | ImageManager $imageManager, |
||
| 23 | FieldParserInterface $parser, |
||
| 24 | callable $fontResolver = null, |
||
| 25 | callable $graphicResolver = null |
||
| 26 | ) { |
||
| 27 | 1 | $image = $imageManager->canvas($parser->getWidth(), $parser->getHeight(), '#000'); |
|
| 28 | 1 | $fontPath = $fontResolver(FontFace::FACE_BARCODE); |
|
| 29 | |||
| 30 | 1 | $fontCallback = function ($font) use ($fontPath, $parser) { |
|
| 31 | 1 | $font->file($fontPath); |
|
| 32 | 1 | $font->size($parser->getFontSize() * self::FONT_SIZE_MULTIPLIER); |
|
| 33 | 1 | $font->color('#fff'); |
|
| 34 | 1 | $font->align('center'); |
|
| 35 | 1 | $font->valign('middle'); |
|
| 36 | 1 | }; |
|
| 37 | |||
| 38 | 1 | $image->text($parser->getText(), $parser->getWidth() / 2, $parser->getHeight(), $fontCallback); |
|
| 39 | |||
| 40 | 1 | return $image; |
|
| 41 | } |
||
| 42 | |||
| 51 |
This check looks for
@paramannotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.