CookieTestArgs   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 36
rs 10
c 3
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
A SameSite() 0 8 1
1
<?php
2
/**
3
* @author SignpostMarv
4
*/
5
declare(strict_types=1);
6
7
namespace SignpostMarv\DaftFramework\Tests\fixtures\Routes;
8
9
use SignpostMarv\DaftRouter\TypedArgs;
10
11
/**
12
* @psalm-type T = array{name:string, value:string, secure:bool, http:bool, same-site:'lax'|'strict'}
13
*
14
* @tempalte-extends TypedArgs<T>
15
*
16
* @property-read string $name
17
* @property-read string $value
18
* @property-read bool $secure
19
* @property-read bool $http
20
*/
21
class CookieTestArgs extends TypedArgs
22
{
23
	/**
24
	* @var T
0 ignored issues
show
Bug introduced by
The type SignpostMarv\DaftFramework\Tests\fixtures\Routes\T was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
25
	*/
26
	protected $typed;
27
28
	/**
29
	* @template K as 'name'|'value'|'secure'|'http'|'same-site'
30
	*
31
	* @param array{name:string, value:string, secure:'0'|'1', http:'0'|'1', same-site:'lax'|'strict'} $args
32
	*/
33
	public function __construct(array $args)
34
	{
35
		$args['secure'] = (bool) $args['secure'];
36
		$args['http'] = (bool) $args['http'];
37
38
		/**
39
		* @var T
40
		*/
41
		$args = $args;
42
43
		$this->typed = $args;
0 ignored issues
show
Documentation Bug introduced by
It seems like $args of type array is incompatible with the declared type SignpostMarv\DaftFramework\Tests\fixtures\Routes\T of property $typed.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
44
	}
45
46
	/**
47
	* @return 'lax'|'strict'
0 ignored issues
show
Documentation Bug introduced by
The doc comment 'lax'|'strict' at position 0 could not be parsed: Unknown type name ''lax'' at position 0 in 'lax'|'strict'.
Loading history...
48
	*/
49
	public function SameSite() : string
50
	{
51
		/**
52
		* @var 'lax'|'strict'
53
		*/
54
		$out = $this->__get('same-site');
55
56
		return $out;
57
	}
58
}
59