Passed
Pull Request — develop (#27)
by Glynn
02:39
created

ObjectFactory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 24
rs 10
c 1
b 0
f 0
wmc 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PinkCrab\FunctionConstructors\Tests\Providers;
6
7
use PHPUnit\Framework\TestCase;
8
use PinkCrab\FunctionConstructors\Arrays as Arr;
9
use PinkCrab\FunctionConstructors\Numbers as Num;
10
use PinkCrab\FunctionConstructors\Strings as Str;
11
use PinkCrab\FunctionConstructors\FunctionsLoader;
12
use PinkCrab\FunctionConstructors\GeneralFunctions as Func;
13
14
class ObjectFactory
15
{
16
    /**
17
     * Returns a class with proivate, protected and public properties.
18
     * Value match the property names, which match the visibility.
19
     * ie $class->public = 'public'
20
     *
21
     * @return void
22
     */
23
    public static function mixedPropertyTypes()
24
    {
25
        return new class () {
26
            protected $protected = 'protected';
27
            private $private = 'private';
28
            public $public = 'public';
29
30
            public function setPrivate($value): void
31
            {
32
                $this->private = $value;
33
            }
34
35
            public function setProtected($value): void
36
            {
37
                $this->protected = $value;
38
            }
39
        };
40
    }
41
}
42