Skip to content

Commit e7fd847

Browse files
committed
Update Type
1 parent 7e7e955 commit e7fd847

17 files changed

+83
-123
lines changed

Action/ActionHandlerInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
interface ActionHandlerInterface
88
{
9-
public function setAppInstance(ApplicationInterface $instance): ActionHandlerInterface;
9+
public function setAppInstance(ApplicationInterface $instance): self;
1010

11-
public function setControllerNamespace(string $namespace): ActionHandlerInterface;
11+
public function setControllerNamespace(string $namespace): self;
1212

1313
public function add(string $name, $callback, int $priority = 10): void;
1414
}

Api/ApiHandlerInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
interface ApiHandlerInterface
1111
{
12-
1312
public function setAppInstance(ApplicationInterface $instance): self;
1413

1514
public function setNamespace(string $namespace): self;

Api/ApiInterface.php

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,27 @@
11
<?php
22

3-
43
namespace PluginMaster\Contracts\Api;
54

65

76
interface ApiInterface
87
{
8+
public static function group(array $config, callable $callback): void;
99

10-
public static function group($config, $callback);
11-
12-
public static function prefix($config, $callback);
13-
14-
public static function middleware($config, $callback);
15-
16-
public static function get($route, $callback, $public = false);
10+
public static function prefix(string $prefix, callable $callback): void;
1711

18-
public static function post($route, $callback, $public = false);
12+
public static function middleware(string $middlewareName, callable $callback): void;
1913

20-
public static function put($route, $callback, $public = false);
14+
public static function get(string $route, $callback, bool $public = false): void;
2115

22-
public static function patch($route, $callback, $public = false);
16+
public static function post(string $route, $callback, bool $public = false): void;
2317

24-
public static function delete($route, $callback, $public = false);
18+
public static function put(string $route, $callback, bool $public = false): void;
2519

26-
public static function all($route, $callback, $public = false);
20+
public static function patch(string $route, $callback, bool $public = false): void;
2721

28-
public static function dynamic($route, $class, $public = false);
22+
public static function delete(string $route, $callback, bool $public = false): void;
2923

24+
public static function all(string $route, $callback, bool $public = false): void;
3025

26+
public static function dynamic(string $route, string $class, bool $public = false): void;
3127
}

Cache/CacheHandlerInterface.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@
44

55
interface CacheHandlerInterface
66
{
7-
8-
public function createFile(string $fileName, string $content, string $directory = ''): int|false;
7+
public function createFile(string $fileName, string $content, string $directory = ''): bool;
98

109
public function cacheFilePath(string $fileName, string $directory = ''): string;
1110

1211
public function check(string $fileName, string $directory = ''): bool;
1312

1413
public function reset(string $fileName = ''): bool;
1514

16-
public function setAppVersion(string $instance): self;
15+
public function setAppVersion(string $appVersion): self;
1716

1817
public function setCachePath(string $path): self;
1918

Cache/CacheInterface.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44

55
interface CacheInterface
66
{
7+
public static function get(string $fileName, string $directory = null);
78

8-
public static function get($fileName, $directory = null);
9-
10-
public static function set($fileName, $content, $directory = null);
9+
public static function set(string $fileName, $content, string $directory = null);
1110

1211
public static function reset();
1312

14-
public static function check($fileName, $directory = null);
15-
13+
public static function check(string $fileName, string $directory = null);
1614
}

Config/ConfigHandlerInterface.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
interface ConfigHandlerInterface
66
{
7-
public function setPath(string $path): string;
8-
9-
public function resolveData(string $key): mixed;
7+
public function setPath(string $path): void;
108

9+
public function resolveData(string $key);
1110
}

Config/ConfigInterface.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
interface ConfigInterface
66
{
7-
public static function get($key): mixed;
7+
public static function get($key);
88

99
public static function set($key);
10-
1110
}

DB/DBInterface.php

Lines changed: 46 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,150 +1,141 @@
11
<?php
22

3-
43
namespace PluginMaster\Contracts\DB;
54

6-
75
use Closure;
86

97
interface DBInterface
108
{
119
/**
12-
* @param string $name
10+
* @param string $name
1311
* @return self
1412
*/
1513
static public function table(string $name): self;
1614

1715

1816
/**
19-
* @param Closure $closer
17+
* @param Closure $closer
2018
* @return ?self
2119
*/
2220
static public function transaction(Closure $closer): ?self;
2321

2422
/**
25-
* @param string|Closure $column
26-
* @param string|null $operator
27-
* @param null $value
23+
* @param mixed $column
24+
* @param string|null $operator
25+
* @param mixed|null $value
2826
* @return self
2927
*/
30-
public function where(string|Closure $column, ?string $operator = null, mixed $value = null): self;
28+
public function where($column, string $operator = null, $value = null): self;
3129

3230
/**
33-
* @param string $table
34-
* @param string|Closure $first
35-
* @param string|null $operator
36-
* @param string|null $second
31+
* @param string $table
32+
* @param mixed $first
33+
* @param string|null $operator
34+
* @param string|null $second
3735
* @return mixed
3836
*/
39-
public function join(string $table, string|Closure $first, ?string $operator = null, ?string $second = null): self;
37+
public function join(string $table, $first, string $operator = null, string $second = null): self;
4038

4139
/**
42-
* @param string $table
43-
* @param string|Closure $first
44-
* @param string|null $operator
45-
* @param string|null $second
40+
* @param string $table
41+
* @param string|Closure $first
42+
* @param string|null $operator
43+
* @param string|null $second
4644
* @return self
4745
*/
48-
public function leftJoin(
49-
string $table,
50-
string|Closure $first,
51-
?string $operator = null,
52-
?string $second = null
53-
): self;
46+
public function leftJoin(string $table, $first, ?string $operator = null, string $second = null): self;
5447

5548
/**
56-
* @param string $first
57-
* @param string $operator
58-
* @param string $second
49+
* @param string $first
50+
* @param string $operator
51+
* @param string $second
5952
* @return self
6053
*/
6154
public function on(string $first, string $operator, string $second): self;
6255

6356
/**
64-
* @param string $first
65-
* @param string $operator
66-
* @param string $second
57+
* @param string $first
58+
* @param string $operator
59+
* @param string $second
6760
* @return self
6861
*/
6962
public function orOn(string $first, string $operator, string $second): self;
7063

7164
/**
72-
* @param string $column
73-
* @param string|null $operator
74-
* @param null $value
65+
* @param string $column
66+
* @param string|null $operator
67+
* @param null $value
7568
* @return self
7669
*/
77-
public function onWhere(string $column, ?string $operator = null, mixed $value = null): self;
70+
public function onWhere(string $column, string $operator = null, $value = null): self;
7871

7972
/**
80-
* @param string|Closure $column
81-
* @param string|null $operator
82-
* @param null $value
73+
* @param string|Closure $column
74+
* @param string|null $operator
75+
* @param null $value
8376
* @return self
8477
*/
85-
public function orWhere(string|Closure $column, ?string $operator = null, mixed $value = null): self;
78+
public function orWhere($column, string $operator = null, $value = null): self;
8679

8780
/**
88-
* @param string $columns
89-
* @param string $direction
81+
* @param string $columns
82+
* @param string $direction
9083
* @return self
9184
*/
9285
public function orderBy(string $columns, string $direction): self;
9386

94-
9587
/**
96-
* @param string|int $number
88+
* @param string|int $number
9789
* @return self
9890
*/
99-
public function limit(string|int $number): self;
91+
public function limit(int $number): self;
10092

10193

10294
/**
103-
* @param string|int $number
95+
* @param int $number
10496
* @return self
10597
*/
106-
public function offset(string|int $number): self;
98+
public function offset(int $number): self;
10799

108100

109101
/**
110-
* @param string|int $column
102+
* @param string|int $column
111103
* @return self
112104
*/
113-
public function groupBy(string|int $column): self;
105+
public function groupBy(string $column): self;
114106

115107
/**
116-
* @param string $fields
108+
* @param string $fields
117109
* @return self
118110
*/
119111
public function select(string $fields): self;
120112

121113
/**
122-
* @param array $data
114+
* @param array $data
123115
* @return int|null
124116
*/
125117
public function insert(array $data): ?int;
126118

127119
/**
128-
* @param array $data
129-
* @return bool|int|null
120+
* @param array $data
121+
* @return int|null
130122
*/
131-
public function update(array $data): bool|int|null;
132-
123+
public function update(array $data): ?int;
133124

134125
/**
135126
* @return bool|int|null
136127
*/
137-
public function delete(): bool|int|null;
128+
public function delete(): ?int;
138129

139130
/**
140131
* @return object|null
141132
*/
142-
public function first(): object|null;
133+
public function first(): ?object;
143134

144135
/**
145136
* @return array|object|null
146137
*/
147-
public function get(): array|object|null;
138+
public function get(): ?object;
148139

149140
/**
150141
* @return string

Database/MigrationInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@
44

55
interface MigrationInterface
66
{
7-
87
public static function handler(): void;
9-
108
}

Enqueue/EnqueueHandlerInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
interface EnqueueHandlerInterface
1010
{
11-
1211
public function setAppInstance(ApplicationInterface $app): self;
1312

1413
public function loadEnqueueFile(string $enqueueFile): void;

0 commit comments

Comments
 (0)