PluginProbe
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution / trunk
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution vtrunk
2.4.0 2.3.0 2.2.5 2.2.0 2.1.2 2.1.1 trunk 1.10.0 1.10.01 1.10.02 1.5.0 1.5.01 1.5.02 1.5.1 1.5.10 1.5.20 1.5.21 1.5.22 1.5.23 1.5.24 1.5.25 1.6.0 1.7.0 1.7.1 1.7.2 All 33 releases
← All changes | vendor/wpfluent/framework/src/WPFluent/Http/Controller.php +16 -4 1.5.21trunk View file →
@@ -6,8 +6,19 @@
6 6 use ReflectionException;
7 7 use FluentBooking\Framework\Foundation\App;
8 8 use FluentBooking\Framework\Validator\ValidationException;
9 9
10 +/**
11 + * Base controller — exposes the Application, Request, and Response
12 + * via protected properties. The `@property` annotations below are
13 + * intentional in addition to the protected declarations: they help
14 + * PHPStan disambiguate when a subclass declares a method with the
15 + * same name as one of these properties (e.g., `function app()`).
16 + *
17 + * @property \FluentBooking\Framework\Foundation\Application $app
18 + * @property \FluentBooking\Framework\Http\Request\Request $request
19 + * @property \FluentBooking\Framework\Http\Response\Response $response
20 + */
10 21 abstract class Controller
11 22 {
12 23 /**
13 24 * Application Instance
@@ -16,15 +27,15 @@
16 27 protected $app = null;
17 28
18 29 /**
19 30 * Request Instane
20 - * @var \FluentBooking\Framework\Request\Request
31 + * @var \FluentBooking\Framework\Http\Request\Request
21 32 */
22 33 protected $request = null;
23 34
24 35 /**
25 36 * Response Instane
26 - * @var \FluentBooking\Framework\Response\Response
37 + * @var \FluentBooking\Framework\Http\Response\Response
27 38 */
28 39 protected $response = null;
29 40
30 41 /**
@@ -52,8 +63,9 @@
52 63 */
53 64 public function validate($data, $rules, $messages = [])
54 65 {
55 66 try {
67 + // @phpstan-ignore-next-line
56 68 $validator = $this->app->validator->make($data, $rules, $messages);
57 69
58 70 if ($validator->validate()->fails()) {
59 71 throw new ValidationException(
@@ -118,11 +130,11 @@
118 130 return $this->response->send($data, $code);
119 131 }
120 132
121 133 /**
122 - * Send a success json response
134 + * Send a success json response.
135 + *
123 136 * @param array $data
124 - * @param integer $code
125 137 * @return \WP_REST_Response
126 138 */
127 139 public function sendSuccess($data = [])
128 140 {