File tree Expand file tree Collapse file tree 3 files changed +23
-10
lines changed Expand file tree Collapse file tree 3 files changed +23
-10
lines changed Original file line number Diff line number Diff line change 1
- services :
2
- - Mathematicator\MandelbrotSet\MandelbrotSet ( %tempDir%/mandelbrot-set )
1
+ extensions :
2
+ mathematicator.mandelbrotSet : Mathematicator\MandelbrotSet\MandelbrotSetExtension
Original file line number Diff line number Diff line change @@ -19,9 +19,6 @@ final class MandelbrotSet
19
19
private $ tempDir ;
20
20
21
21
22
- /**
23
- * @param string $tempDir
24
- */
25
22
public function __construct (string $ tempDir )
26
23
{
27
24
ini_set ('max_execution_time ' , '100000 ' );
@@ -32,9 +29,6 @@ public function __construct(string $tempDir)
32
29
33
30
/**
34
31
* Load image from temp by Request and return as base64 image.
35
- *
36
- * @param MandelbrotSetRequest $request
37
- * @return string
38
32
*/
39
33
public function loadImage (MandelbrotSetRequest $ request ): string
40
34
{
@@ -48,8 +42,6 @@ public function loadImage(MandelbrotSetRequest $request): string
48
42
49
43
/**
50
44
* Process image by request and save to temp file.
51
- *
52
- * @param MandelbrotSetRequest $request
53
45
*/
54
46
public function generate (MandelbrotSetRequest $ request ): void
55
47
{
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Mathematicator \MandelbrotSet ;
6
+
7
+
8
+ use Nette \DI \CompilerExtension ;
9
+
10
+ final class MandelbrotSetExtension extends CompilerExtension
11
+ {
12
+ public function beforeCompile (): void
13
+ {
14
+ $ builder = $ this ->getContainerBuilder ();
15
+
16
+ $ builder ->addDefinition ($ this ->prefix ('mandelbrotSet ' ))
17
+ ->setFactory (MandelbrotSet::class, [
18
+ 'tempDir ' => '%tempDir%/mandelbrot-set ' , // TODO: Check it
19
+ ]);
20
+ }
21
+ }
You can’t perform that action at this time.
0 commit comments