|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* This file is part of Blitz PHP framework. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) 2022 Dimitri Sitchet Tomkeu <[email protected]> |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view |
|
9
|
|
|
* the LICENSE file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace BlitzPHP\Http\Concerns; |
|
13
|
|
|
|
|
14
|
|
|
use BlitzPHP\Wolke\Model; |
|
|
|
|
|
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* @credit <a href="http://laravel.com/">Laravel - Illuminate\Http\Concerns\InteractsWithFlashData</a> |
|
18
|
|
|
*/ |
|
19
|
|
|
trait InteractsWithFlashData |
|
20
|
|
|
{ |
|
21
|
|
|
/** |
|
22
|
|
|
* Récupérer un ancien élément d'entrée. |
|
23
|
|
|
* |
|
24
|
|
|
* @param array|Model|string|null $default |
|
25
|
|
|
* |
|
26
|
|
|
* @return array|string|null |
|
27
|
|
|
*/ |
|
28
|
|
|
public function old(?string $key = null, $default = null) |
|
29
|
|
|
{ |
|
30
|
|
|
if (class_exists(Model::class) && $default instanceof Model) { |
|
31
|
|
|
$default = $default->getAttribute($key); |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
if (null !== $value = $this->getOldInput($key)) { |
|
|
|
|
|
|
35
|
|
|
return $value; |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
return $default; |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* Flashez l'entrée de la demande actuelle à la session. |
|
43
|
|
|
*/ |
|
44
|
|
|
public function flash(): void |
|
45
|
|
|
{ |
|
46
|
|
|
$this->session()->flashInput($this->input()); |
|
|
|
|
|
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
/** |
|
50
|
|
|
* Ne flashez qu'une partie des entrées de la session. |
|
51
|
|
|
* |
|
52
|
|
|
* @param array|mixed $keys |
|
53
|
|
|
*/ |
|
54
|
|
|
public function flashOnly($keys): void |
|
55
|
|
|
{ |
|
56
|
|
|
$this->session()->flashInput( |
|
57
|
|
|
$this->only(is_array($keys) ? $keys : func_get_args()) |
|
|
|
|
|
|
58
|
|
|
); |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* Ne flashez qu'une partie des entrées de la session. |
|
63
|
|
|
* |
|
64
|
|
|
* @param array|mixed $keys |
|
65
|
|
|
*/ |
|
66
|
|
|
public function flashExcept($keys): void |
|
67
|
|
|
{ |
|
68
|
|
|
$this->session()->flashInput( |
|
69
|
|
|
$this->except(is_array($keys) ? $keys : func_get_args()) |
|
|
|
|
|
|
70
|
|
|
); |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* Videz toutes les anciennes entrées de la session. |
|
75
|
|
|
*/ |
|
76
|
|
|
public function flush() |
|
77
|
|
|
{ |
|
78
|
|
|
$this->session()->flashInput([]); |
|
79
|
|
|
} |
|
80
|
|
|
} |
|
81
|
|
|
|
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