PluginProbe ʕ •ᴥ•ʔ
WP 2FA – Two-factor authentication for WordPress / 4.0.0
WP 2FA – Two-factor authentication for WordPress v4.0.0
4.0.0 1.7.1 2.0.0 2.0.1 2.1.0 2.2.0 2.2.1 2.3.0 2.4.0 2.4.1 2.4.2 2.5.0 2.6.0 2.6.1 2.6.2 2.6.3 2.6.4 2.7.0 2.8.0 2.9.0 2.9.1 2.9.2 2.9.3 3.0.0 3.0.1 3.1.0 3.1.1 3.1.1.2 trunk 1.2.0 1.3.0 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.2 1.6.0 1.6.1 1.6.2 1.7.0
wp-2fa / includes / classes / bacon / bacon-qr-code / src / Renderer / Eye / ModuleEye.php
wp-2fa / includes / classes / bacon / bacon-qr-code / src / Renderer / Eye Last commit date
CompositeEye.php 1 week ago EyeInterface.php 1 week ago ModuleEye.php 1 week ago SimpleCircleEye.php 1 week ago SquareEye.php 1 week ago index.php 1 week ago
ModuleEye.php
46 lines
1 <?php
2
3 declare (strict_types=1);
4 namespace WP2FA_Vendor\BaconQrCode\Renderer\Eye;
5
6 use WP2FA_Vendor\BaconQrCode\Encoder\ByteMatrix;
7 use WP2FA_Vendor\BaconQrCode\Renderer\Module\ModuleInterface;
8 use WP2FA_Vendor\BaconQrCode\Renderer\Path\Path;
9 /**
10 * Renders an eye based on a module renderer.
11 */
12 final class ModuleEye implements EyeInterface
13 {
14 /**
15 * @var ModuleInterface
16 */
17 private $module;
18 public function __construct(ModuleInterface $module)
19 {
20 $this->module = $module;
21 }
22 public function getExternalPath() : Path
23 {
24 $matrix = new ByteMatrix(7, 7);
25 for ($x = 0; $x < 7; ++$x) {
26 $matrix->set($x, 0, 1);
27 $matrix->set($x, 6, 1);
28 }
29 for ($y = 1; $y < 6; ++$y) {
30 $matrix->set(0, $y, 1);
31 $matrix->set(6, $y, 1);
32 }
33 return $this->module->createPath($matrix)->translate(-3.5, -3.5);
34 }
35 public function getInternalPath() : Path
36 {
37 $matrix = new ByteMatrix(3, 3);
38 for ($x = 0; $x < 3; ++$x) {
39 for ($y = 0; $y < 3; ++$y) {
40 $matrix->set($x, $y, 1);
41 }
42 }
43 return $this->module->createPath($matrix)->translate(-1.5, -1.5);
44 }
45 }
46