Completed
Push — refactor ( a403e4...c06c99 )
by Bogdan
02:18
created

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php declare(strict_types=1);
2
3
use Pinepain\ObjectMaps\ObjectBiMap;
4
use Pinepain\ObjectMaps\ObjectBiMapInterface;
5
6
7
require_once "/home/vagrant/Development/php-object-maps/vendor/autoload.php";
8
9
$map = new ObjectBiMap(ObjectBiMapInterface::WEAK_KEY_VALUE);
10
11
$key_1   = new stdClass();
12
$value_1 = new stdClass();
13
14
$key_2   = new stdClass();
15
$value_2 = new stdClass();
16
17
$map->put($key_1, $value_1);
18
echo PHP_EOL;
19
$map->put($key_2, $value_2);
20
echo PHP_EOL;
21
22
var_dump(2, $map->count());
23
24
$vmap = $map->values();
25
26
var_dump(ObjectBiMapInterface::class, $vmap);
27
28
var_dump(2, $map->count());
29
var_dump(2, $vmap->count());
30
31
$key_1 = null;
32
var_dump(1, $map->count());
33
var_dump(1, $vmap->count());
34
35
echo PHP_EOL;
36
37
$value_2 = null;
38
var_dump(0, $map->count());
39
var_dump(0, $vmap->count());
40
41
echo PHP_EOL;
42
43
$key_1   = new stdClass();
44
$value_1 = new stdClass();
45
46
$key_2   = new stdClass();
47
$value_2 = new stdClass();
48
49
$vmap->put($key_1, $value_1);
50
echo PHP_EOL;
51
52
$vmap->put($key_2, $value_2);
53
echo PHP_EOL;
54
55
var_dump(2, $map->count());
56
var_dump(2, $vmap->count());
57
58
$key_1 = null;
59
// $value_1 = null;
0 ignored issues
show
Unused Code Comprehensibility introduced by
43% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
60
var_dump(1, $map->count());
61
var_dump(1, $vmap->count());
62
63
// $key_2 = null;
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
64
// var_dump(1);
65
$value_2 = null;
66
// debug_zval_dump($key_2);
0 ignored issues
show
Unused Code Comprehensibility introduced by
62% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
67
// debug_zval_dump($value_2);
68
debug_zval_dump($map);
69
// debug_zval_dump($vmap);
0 ignored issues
show
Unused Code Comprehensibility introduced by
67% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
70
echo PHP_EOL;
71
var_dump(0, $map->count());
72
var_dump(0, $vmap->count());
73