@@ -9,118 +9,118 @@ |
||
9 | 9 | |
10 | 10 | trait Macroable |
11 | 11 | { |
12 | - /** |
|
13 | - * The registered string macros. |
|
14 | - * |
|
15 | - * @var array |
|
16 | - */ |
|
17 | - protected static $macros = []; |
|
18 | - |
|
19 | - /** |
|
20 | - * Register a custom macro. |
|
21 | - * |
|
22 | - * @param string $name |
|
23 | - * @param object|callable $macro |
|
24 | - * @return void |
|
25 | - */ |
|
26 | - public static function macro($name, $macro) |
|
27 | - { |
|
28 | - static::$macros[$name] = $macro; |
|
29 | - } |
|
30 | - |
|
31 | - /** |
|
32 | - * Mix another object into the class. |
|
33 | - * |
|
34 | - * @param object $mixin |
|
35 | - * @param bool $replace |
|
36 | - * @return void |
|
37 | - * |
|
38 | - * @throws \ReflectionException |
|
39 | - */ |
|
40 | - public static function mixin($mixin, $replace = true) |
|
41 | - { |
|
42 | - $methods = (new ReflectionClass($mixin))->getMethods( |
|
43 | - ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED |
|
44 | - ); |
|
45 | - |
|
46 | - foreach ($methods as $method) { |
|
47 | - if ($replace || ! static::hasMacro($method->name)) { |
|
48 | - $method->setAccessible(true); |
|
49 | - static::macro($method->name, $method->invoke($mixin)); |
|
50 | - } |
|
51 | - } |
|
52 | - } |
|
53 | - |
|
54 | - /** |
|
55 | - * Checks if macro is registered. |
|
56 | - * |
|
57 | - * @param string $name |
|
58 | - * @return bool |
|
59 | - */ |
|
60 | - public static function hasMacro($name) |
|
61 | - { |
|
62 | - return isset(static::$macros[$name]); |
|
63 | - } |
|
64 | - |
|
65 | - /** |
|
66 | - * Flush the existing macros. |
|
67 | - * |
|
68 | - * @return void |
|
69 | - */ |
|
70 | - public static function flushMacros() |
|
71 | - { |
|
72 | - static::$macros = []; |
|
73 | - } |
|
74 | - |
|
75 | - /** |
|
76 | - * Dynamically handle calls to the class. |
|
77 | - * |
|
78 | - * @param string $method |
|
79 | - * @param array $parameters |
|
80 | - * @return mixed |
|
81 | - * |
|
82 | - * @throws \BadMethodCallException |
|
83 | - */ |
|
84 | - public static function __callStatic($method, $parameters) |
|
85 | - { |
|
86 | - if (! static::hasMacro($method)) { |
|
87 | - throw new BadMethodCallException(sprintf( |
|
88 | - 'Method %s::%s does not exist.', static::class, $method |
|
89 | - )); |
|
90 | - } |
|
91 | - |
|
92 | - $macro = static::$macros[$method]; |
|
93 | - |
|
94 | - if ($macro instanceof Closure) { |
|
95 | - $macro = $macro->bindTo(null, static::class); |
|
96 | - } |
|
97 | - |
|
98 | - return $macro(...$parameters); |
|
99 | - } |
|
100 | - |
|
101 | - /** |
|
102 | - * Dynamically handle calls to the class. |
|
103 | - * |
|
104 | - * @param string $method |
|
105 | - * @param array $parameters |
|
106 | - * @return mixed |
|
107 | - * |
|
108 | - * @throws \BadMethodCallException |
|
109 | - */ |
|
110 | - public function __call($method, $parameters) |
|
111 | - { |
|
112 | - if (! static::hasMacro($method)) { |
|
113 | - throw new BadMethodCallException(sprintf( |
|
114 | - 'Method %s::%s does not exist.', static::class, $method |
|
115 | - )); |
|
116 | - } |
|
117 | - |
|
118 | - $macro = static::$macros[$method]; |
|
119 | - |
|
120 | - if ($macro instanceof Closure) { |
|
121 | - $macro = $macro->bindTo($this, static::class); |
|
122 | - } |
|
123 | - |
|
124 | - return $macro(...$parameters); |
|
125 | - } |
|
12 | + /** |
|
13 | + * The registered string macros. |
|
14 | + * |
|
15 | + * @var array |
|
16 | + */ |
|
17 | + protected static $macros = []; |
|
18 | + |
|
19 | + /** |
|
20 | + * Register a custom macro. |
|
21 | + * |
|
22 | + * @param string $name |
|
23 | + * @param object|callable $macro |
|
24 | + * @return void |
|
25 | + */ |
|
26 | + public static function macro($name, $macro) |
|
27 | + { |
|
28 | + static::$macros[$name] = $macro; |
|
29 | + } |
|
30 | + |
|
31 | + /** |
|
32 | + * Mix another object into the class. |
|
33 | + * |
|
34 | + * @param object $mixin |
|
35 | + * @param bool $replace |
|
36 | + * @return void |
|
37 | + * |
|
38 | + * @throws \ReflectionException |
|
39 | + */ |
|
40 | + public static function mixin($mixin, $replace = true) |
|
41 | + { |
|
42 | + $methods = (new ReflectionClass($mixin))->getMethods( |
|
43 | + ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED |
|
44 | + ); |
|
45 | + |
|
46 | + foreach ($methods as $method) { |
|
47 | + if ($replace || ! static::hasMacro($method->name)) { |
|
48 | + $method->setAccessible(true); |
|
49 | + static::macro($method->name, $method->invoke($mixin)); |
|
50 | + } |
|
51 | + } |
|
52 | + } |
|
53 | + |
|
54 | + /** |
|
55 | + * Checks if macro is registered. |
|
56 | + * |
|
57 | + * @param string $name |
|
58 | + * @return bool |
|
59 | + */ |
|
60 | + public static function hasMacro($name) |
|
61 | + { |
|
62 | + return isset(static::$macros[$name]); |
|
63 | + } |
|
64 | + |
|
65 | + /** |
|
66 | + * Flush the existing macros. |
|
67 | + * |
|
68 | + * @return void |
|
69 | + */ |
|
70 | + public static function flushMacros() |
|
71 | + { |
|
72 | + static::$macros = []; |
|
73 | + } |
|
74 | + |
|
75 | + /** |
|
76 | + * Dynamically handle calls to the class. |
|
77 | + * |
|
78 | + * @param string $method |
|
79 | + * @param array $parameters |
|
80 | + * @return mixed |
|
81 | + * |
|
82 | + * @throws \BadMethodCallException |
|
83 | + */ |
|
84 | + public static function __callStatic($method, $parameters) |
|
85 | + { |
|
86 | + if (! static::hasMacro($method)) { |
|
87 | + throw new BadMethodCallException(sprintf( |
|
88 | + 'Method %s::%s does not exist.', static::class, $method |
|
89 | + )); |
|
90 | + } |
|
91 | + |
|
92 | + $macro = static::$macros[$method]; |
|
93 | + |
|
94 | + if ($macro instanceof Closure) { |
|
95 | + $macro = $macro->bindTo(null, static::class); |
|
96 | + } |
|
97 | + |
|
98 | + return $macro(...$parameters); |
|
99 | + } |
|
100 | + |
|
101 | + /** |
|
102 | + * Dynamically handle calls to the class. |
|
103 | + * |
|
104 | + * @param string $method |
|
105 | + * @param array $parameters |
|
106 | + * @return mixed |
|
107 | + * |
|
108 | + * @throws \BadMethodCallException |
|
109 | + */ |
|
110 | + public function __call($method, $parameters) |
|
111 | + { |
|
112 | + if (! static::hasMacro($method)) { |
|
113 | + throw new BadMethodCallException(sprintf( |
|
114 | + 'Method %s::%s does not exist.', static::class, $method |
|
115 | + )); |
|
116 | + } |
|
117 | + |
|
118 | + $macro = static::$macros[$method]; |
|
119 | + |
|
120 | + if ($macro instanceof Closure) { |
|
121 | + $macro = $macro->bindTo($this, static::class); |
|
122 | + } |
|
123 | + |
|
124 | + return $macro(...$parameters); |
|
125 | + } |
|
126 | 126 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | ); |
45 | 45 | |
46 | 46 | foreach ($methods as $method) { |
47 | - if ($replace || ! static::hasMacro($method->name)) { |
|
47 | + if ($replace || !static::hasMacro($method->name)) { |
|
48 | 48 | $method->setAccessible(true); |
49 | 49 | static::macro($method->name, $method->invoke($mixin)); |
50 | 50 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public static function __callStatic($method, $parameters) |
85 | 85 | { |
86 | - if (! static::hasMacro($method)) { |
|
86 | + if (!static::hasMacro($method)) { |
|
87 | 87 | throw new BadMethodCallException(sprintf( |
88 | 88 | 'Method %s::%s does not exist.', static::class, $method |
89 | 89 | )); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function __call($method, $parameters) |
111 | 111 | { |
112 | - if (! static::hasMacro($method)) { |
|
112 | + if (!static::hasMacro($method)) { |
|
113 | 113 | throw new BadMethodCallException(sprintf( |
114 | 114 | 'Method %s::%s does not exist.', static::class, $method |
115 | 115 | )); |
@@ -4,17 +4,17 @@ |
||
4 | 4 | |
5 | 5 | interface HasBroadcastChannel |
6 | 6 | { |
7 | - /** |
|
8 | - * Get the broadcast channel route definition that is associated with the given entity. |
|
9 | - * |
|
10 | - * @return string |
|
11 | - */ |
|
12 | - public function broadcastChannelRoute(); |
|
7 | + /** |
|
8 | + * Get the broadcast channel route definition that is associated with the given entity. |
|
9 | + * |
|
10 | + * @return string |
|
11 | + */ |
|
12 | + public function broadcastChannelRoute(); |
|
13 | 13 | |
14 | - /** |
|
15 | - * Get the broadcast channel name that is associated with the given entity. |
|
16 | - * |
|
17 | - * @return string |
|
18 | - */ |
|
19 | - public function broadcastChannel(); |
|
14 | + /** |
|
15 | + * Get the broadcast channel name that is associated with the given entity. |
|
16 | + * |
|
17 | + * @return string |
|
18 | + */ |
|
19 | + public function broadcastChannel(); |
|
20 | 20 | } |
@@ -4,11 +4,11 @@ |
||
4 | 4 | |
5 | 5 | interface Factory |
6 | 6 | { |
7 | - /** |
|
8 | - * Get a broadcaster implementation by name. |
|
9 | - * |
|
10 | - * @param string|null $name |
|
11 | - * @return \Illuminate\Contracts\Broadcasting\Broadcaster |
|
12 | - */ |
|
13 | - public function connection($name = null); |
|
7 | + /** |
|
8 | + * Get a broadcaster implementation by name. |
|
9 | + * |
|
10 | + * @param string|null $name |
|
11 | + * @return \Illuminate\Contracts\Broadcasting\Broadcaster |
|
12 | + */ |
|
13 | + public function connection($name = null); |
|
14 | 14 | } |
@@ -4,10 +4,10 @@ |
||
4 | 4 | |
5 | 5 | interface ShouldBroadcast |
6 | 6 | { |
7 | - /** |
|
8 | - * Get the channels the event should broadcast on. |
|
9 | - * |
|
10 | - * @return \Illuminate\Broadcasting\Channel|\Illuminate\Broadcasting\Channel[]|string[]|string |
|
11 | - */ |
|
12 | - public function broadcastOn(); |
|
7 | + /** |
|
8 | + * Get the channels the event should broadcast on. |
|
9 | + * |
|
10 | + * @return \Illuminate\Broadcasting\Channel|\Illuminate\Broadcasting\Channel[]|string[]|string |
|
11 | + */ |
|
12 | + public function broadcastOn(); |
|
13 | 13 | } |
@@ -4,30 +4,30 @@ |
||
4 | 4 | |
5 | 5 | interface Broadcaster |
6 | 6 | { |
7 | - /** |
|
8 | - * Authenticate the incoming request for a given channel. |
|
9 | - * |
|
10 | - * @param \Illuminate\Http\Request $request |
|
11 | - * @return mixed |
|
12 | - */ |
|
13 | - public function auth($request); |
|
7 | + /** |
|
8 | + * Authenticate the incoming request for a given channel. |
|
9 | + * |
|
10 | + * @param \Illuminate\Http\Request $request |
|
11 | + * @return mixed |
|
12 | + */ |
|
13 | + public function auth($request); |
|
14 | 14 | |
15 | - /** |
|
16 | - * Return the valid authentication response. |
|
17 | - * |
|
18 | - * @param \Illuminate\Http\Request $request |
|
19 | - * @param mixed $result |
|
20 | - * @return mixed |
|
21 | - */ |
|
22 | - public function validAuthenticationResponse($request, $result); |
|
15 | + /** |
|
16 | + * Return the valid authentication response. |
|
17 | + * |
|
18 | + * @param \Illuminate\Http\Request $request |
|
19 | + * @param mixed $result |
|
20 | + * @return mixed |
|
21 | + */ |
|
22 | + public function validAuthenticationResponse($request, $result); |
|
23 | 23 | |
24 | - /** |
|
25 | - * Broadcast the given event. |
|
26 | - * |
|
27 | - * @param array $channels |
|
28 | - * @param string $event |
|
29 | - * @param array $payload |
|
30 | - * @return void |
|
31 | - */ |
|
32 | - public function broadcast(array $channels, $event, array $payload = []); |
|
24 | + /** |
|
25 | + * Broadcast the given event. |
|
26 | + * |
|
27 | + * @param array $channels |
|
28 | + * @param string $event |
|
29 | + * @param array $payload |
|
30 | + * @return void |
|
31 | + */ |
|
32 | + public function broadcast(array $channels, $event, array $payload = []); |
|
33 | 33 | } |
@@ -4,5 +4,5 @@ |
||
4 | 4 | |
5 | 5 | interface ShouldBroadcastNow extends ShouldBroadcast |
6 | 6 | { |
7 | - // |
|
7 | + // |
|
8 | 8 | } |
@@ -4,12 +4,12 @@ |
||
4 | 4 | |
5 | 5 | interface Hub |
6 | 6 | { |
7 | - /** |
|
8 | - * Send an object through one of the available pipelines. |
|
9 | - * |
|
10 | - * @param mixed $object |
|
11 | - * @param string|null $pipeline |
|
12 | - * @return mixed |
|
13 | - */ |
|
14 | - public function pipe($object, $pipeline = null); |
|
7 | + /** |
|
8 | + * Send an object through one of the available pipelines. |
|
9 | + * |
|
10 | + * @param mixed $object |
|
11 | + * @param string|null $pipeline |
|
12 | + * @return mixed |
|
13 | + */ |
|
14 | + public function pipe($object, $pipeline = null); |
|
15 | 15 | } |
@@ -6,35 +6,35 @@ |
||
6 | 6 | |
7 | 7 | interface Pipeline |
8 | 8 | { |
9 | - /** |
|
10 | - * Set the traveler object being sent on the pipeline. |
|
11 | - * |
|
12 | - * @param mixed $traveler |
|
13 | - * @return $this |
|
14 | - */ |
|
15 | - public function send($traveler); |
|
9 | + /** |
|
10 | + * Set the traveler object being sent on the pipeline. |
|
11 | + * |
|
12 | + * @param mixed $traveler |
|
13 | + * @return $this |
|
14 | + */ |
|
15 | + public function send($traveler); |
|
16 | 16 | |
17 | - /** |
|
18 | - * Set the stops of the pipeline. |
|
19 | - * |
|
20 | - * @param dynamic|array $stops |
|
21 | - * @return $this |
|
22 | - */ |
|
23 | - public function through($stops); |
|
17 | + /** |
|
18 | + * Set the stops of the pipeline. |
|
19 | + * |
|
20 | + * @param dynamic|array $stops |
|
21 | + * @return $this |
|
22 | + */ |
|
23 | + public function through($stops); |
|
24 | 24 | |
25 | - /** |
|
26 | - * Set the method to call on the stops. |
|
27 | - * |
|
28 | - * @param string $method |
|
29 | - * @return $this |
|
30 | - */ |
|
31 | - public function via($method); |
|
25 | + /** |
|
26 | + * Set the method to call on the stops. |
|
27 | + * |
|
28 | + * @param string $method |
|
29 | + * @return $this |
|
30 | + */ |
|
31 | + public function via($method); |
|
32 | 32 | |
33 | - /** |
|
34 | - * Run the pipeline with a final destination callback. |
|
35 | - * |
|
36 | - * @param \Closure $destination |
|
37 | - * @return mixed |
|
38 | - */ |
|
39 | - public function then(Closure $destination); |
|
33 | + /** |
|
34 | + * Run the pipeline with a final destination callback. |
|
35 | + * |
|
36 | + * @param \Closure $destination |
|
37 | + * @return mixed |
|
38 | + */ |
|
39 | + public function then(Closure $destination); |
|
40 | 40 | } |
@@ -4,37 +4,37 @@ |
||
4 | 4 | |
5 | 5 | interface Loader |
6 | 6 | { |
7 | - /** |
|
8 | - * Load the messages for the given locale. |
|
9 | - * |
|
10 | - * @param string $locale |
|
11 | - * @param string $group |
|
12 | - * @param string|null $namespace |
|
13 | - * @return array |
|
14 | - */ |
|
15 | - public function load($locale, $group, $namespace = null); |
|
7 | + /** |
|
8 | + * Load the messages for the given locale. |
|
9 | + * |
|
10 | + * @param string $locale |
|
11 | + * @param string $group |
|
12 | + * @param string|null $namespace |
|
13 | + * @return array |
|
14 | + */ |
|
15 | + public function load($locale, $group, $namespace = null); |
|
16 | 16 | |
17 | - /** |
|
18 | - * Add a new namespace to the loader. |
|
19 | - * |
|
20 | - * @param string $namespace |
|
21 | - * @param string $hint |
|
22 | - * @return void |
|
23 | - */ |
|
24 | - public function addNamespace($namespace, $hint); |
|
17 | + /** |
|
18 | + * Add a new namespace to the loader. |
|
19 | + * |
|
20 | + * @param string $namespace |
|
21 | + * @param string $hint |
|
22 | + * @return void |
|
23 | + */ |
|
24 | + public function addNamespace($namespace, $hint); |
|
25 | 25 | |
26 | - /** |
|
27 | - * Add a new JSON path to the loader. |
|
28 | - * |
|
29 | - * @param string $path |
|
30 | - * @return void |
|
31 | - */ |
|
32 | - public function addJsonPath($path); |
|
26 | + /** |
|
27 | + * Add a new JSON path to the loader. |
|
28 | + * |
|
29 | + * @param string $path |
|
30 | + * @return void |
|
31 | + */ |
|
32 | + public function addJsonPath($path); |
|
33 | 33 | |
34 | - /** |
|
35 | - * Get an array of all the registered namespaces. |
|
36 | - * |
|
37 | - * @return array |
|
38 | - */ |
|
39 | - public function namespaces(); |
|
34 | + /** |
|
35 | + * Get an array of all the registered namespaces. |
|
36 | + * |
|
37 | + * @return array |
|
38 | + */ |
|
39 | + public function namespaces(); |
|
40 | 40 | } |