Conditions | 1 |
Paths | 1 |
Total Lines | 21 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public function render( |
||
22 | ImageManager $imageManager, |
||
23 | FieldParserInterface $parser, |
||
24 | callable $fontResolver = null, |
||
25 | callable $graphicResolver = null |
||
26 | ) { |
||
27 | $image = $imageManager->canvas($parser->getWidth(), $parser->getHeight(), '#000'); |
||
28 | $fontPath = $fontResolver(FontFace::FACE_BARCODE); |
||
29 | |||
30 | $fontCallback = function ($font) use ($fontPath, $parser) { |
||
31 | $font->file($fontPath); |
||
32 | $font->size($parser->getFontSize() * self::FONT_SIZE_MULTIPLIER); |
||
33 | $font->color('#fff'); |
||
34 | $font->align('center'); |
||
35 | $font->valign('middle'); |
||
36 | }; |
||
37 | |||
38 | $image->text($parser->getText(), $parser->getWidth() / 2, $parser->getHeight(), $fontCallback); |
||
39 | |||
40 | return $image; |
||
41 | } |
||
42 | |||
51 |
This check looks for
@param
annotations 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.