1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* TPriorityPropertyTrait class |
4
|
|
|
* |
5
|
|
|
* @author Brad Anderson <[email protected]> |
6
|
|
|
* @link https://github.com/pradosoft/prado |
7
|
|
|
* @license https://github.com/pradosoft/prado/blob/master/LICENSE |
8
|
|
|
*/ |
9
|
|
|
|
10
|
|
|
namespace Prado\Collections; |
11
|
|
|
|
12
|
|
|
use Prado\TPropertyValue; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* TPriorityPropertyTrait class |
16
|
|
|
* |
17
|
|
|
* This trait implements the common properties and methods of IPriorityItem. You still |
18
|
|
|
* must "implement IPriorityItem" in your class when you use this trait as they go |
19
|
|
|
* together. |
20
|
|
|
* |
21
|
|
|
* The trait adds methods: |
22
|
|
|
* - {@link getPriority} returns the default priority of items without priority. |
23
|
|
|
* - {@link setPriority} sets the default priority. (protected) |
24
|
|
|
* - {@link _priorityItemZappableSleepProps} to add the excluded trait properties on sleep. |
25
|
|
|
* |
26
|
|
|
* The priority is implement with a float. |
27
|
|
|
* |
28
|
|
|
* @author Brad Anderson <[email protected]> |
29
|
|
|
* @since 4.2.3 |
30
|
|
|
*/ |
31
|
|
|
trait TPriorityPropertyTrait |
32
|
|
|
{ |
33
|
|
|
/** @var ?float The set Priority of the item. Default null */ |
34
|
|
|
private ?float $_priority = null; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @return ?float The priority of the item. Default is null. |
38
|
|
|
*/ |
39
|
|
|
public function getPriority(): ?float |
40
|
|
|
{ |
41
|
|
|
return $this->_priority; |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @param numeric $value The priority of the item. |
|
|
|
|
46
|
|
|
*/ |
47
|
|
|
public function setPriority($value) |
48
|
|
|
{ |
49
|
|
|
$this->_priority = TPropertyValue::ensureFloat($value); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Call this to exclude the priority property from sleep properties when there |
54
|
|
|
* is no priority. |
55
|
|
|
* @param array $exprops by reference |
56
|
|
|
*/ |
57
|
|
|
protected function _priorityItemZappableSleepProps(&$exprops) |
58
|
|
|
{ |
59
|
|
|
if ($this->_priority === null) { |
60
|
|
|
$exprops[] = "\0" . __CLASS__ . "\0_priority"; |
61
|
|
|
} |
62
|
|
|
} |
63
|
|
|
} |
64
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths