Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8cf6ecc

Browse files
committed
strict declare return type. update some info
1 parent 4e21469 commit 8cf6ecc

File tree

18 files changed

+38
-45
lines changed

18 files changed

+38
-45
lines changed

‎libs/arr-utils/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
}
2626
},
2727
"suggest": {
28-
"inhere/simple-print-tool": "Very lightweight data printing tools",
2928
"inhere/php-validate": "Very lightweight data validate tool",
3029
"inhere/console": "a lightweight php console application library."
3130
}

‎libs/arr-utils/src/ArrBuffer.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,31 +34,31 @@ public function __construct(string $content = '')
3434
/**
3535
* @param string $content
3636
*/
37-
public function write(string $content)
37+
public function write(string $content): void
3838
{
3939
$this->body[] = $content;
4040
}
4141

4242
/**
4343
* @param string $content
4444
*/
45-
public function append(string $content)
45+
public function append(string $content): void
4646
{
4747
$this->write($content);
4848
}
4949

5050
/**
5151
* @param string $content
5252
*/
53-
public function prepend(string $content)
53+
public function prepend(string $content): void
5454
{
5555
array_unshift($this->body, $content);
5656
}
5757

5858
/**
5959
* clear
6060
*/
61-
public function clear()
61+
public function clear(): void
6262
{
6363
$this->body = [];
6464
}
@@ -74,7 +74,7 @@ public function getBody(): array
7474
/**
7575
* @param string[] $body
7676
*/
77-
public function setBody(array $body)
77+
public function setBody(array $body): void
7878
{
7979
$this->body = $body;
8080
}
@@ -106,7 +106,7 @@ public function getDelimiter(): string
106106
/**
107107
* @param string $delimiter
108108
*/
109-
public function setDelimiter(string $delimiter)
109+
public function setDelimiter(string $delimiter): void
110110
{
111111
$this->delimiter = $delimiter;
112112
}

‎libs/arr-utils/src/ArrayHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ public static function getValueByNodes(array $data, array $nodes, $default = nul
456456
* @param mixed $value
457457
* @param string $separator
458458
*/
459-
public static function setByPath(&$data, string $path, $value, string $separator = '.')
459+
public static function setByPath(&$data, string $path, $value, string $separator = '.'): void
460460
{
461461
if (false === \strpos($path, $separator)) {
462462
$data[$path] = $value;
@@ -699,7 +699,7 @@ public static function flatten($array, $depth = INF): array
699699
* @param array|string $keys
700700
* @return void
701701
*/
702-
public static function forget(&$array, $keys)
702+
public static function forget(&$array, $keys): void
703703
{
704704
$original = &$array;
705705
$keys = (array)$keys;

‎libs/data-parser/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
}
2626
},
2727
"suggest": {
28-
"inhere/simple-print-tool": "Very lightweight data printing tools",
2928
"inhere/php-validate": "Very lightweight data validate tool",
3029
"inhere/console": "a lightweight php console application library."
3130
}

‎libs/di/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
}
2828
},
2929
"suggest": {
30-
"inhere/simple-print-tool": "Very lightweight data printing tools",
3130
"inhere/php-validate": "Very lightweight data validate tool",
3231
"inhere/console": "a lightweight php console application library."
3332
}

‎libs/file-utils/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
}
2626
},
2727
"suggest": {
28-
"inhere/simple-print-tool": "Very lightweight data printing tools",
2928
"inhere/php-validate": "Very lightweight data validate tool",
3029
"inhere/console": "a lightweight php console application library."
3130
}

‎libs/helper-utils/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
}
3434
},
3535
"suggest": {
36-
"inhere/simple-print-tool": "Very lightweight data printing tools",
3736
"inhere/php-validate": "Very lightweight data validate tool",
3837
"inhere/console": "a lightweight php console application library."
3938
}

‎libs/obj-utils/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
}
2626
},
2727
"suggest": {
28-
"inhere/simple-print-tool": "Very lightweight data printing tools",
2928
"inhere/php-validate": "Very lightweight data validate tool",
3029
"inhere/console": "a lightweight php console application library."
3130
},

‎libs/php-utils/src/AutoLoader.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ public static function getFiles(): array
103103
/**
104104
* @param array $files
105105
*/
106-
public static function setFiles(array $files)
106+
public static function setFiles(array $files): void
107107
{
108108
self::$files = $files;
109109
}
110110

111111
/**
112112
* @param array $files
113113
*/
114-
public static function addFiles(array $files)
114+
public static function addFiles(array $files): void
115115
{
116116
if (self::$files) {
117117
self::$files = \array_merge(self::$files, $files);
@@ -128,15 +128,15 @@ public static function addFiles(array $files)
128128
* @param string $prefix
129129
* @param string $path
130130
*/
131-
public function addPsr0(string $prefix, string $path)
131+
public function addPsr0(string $prefix, string $path): void
132132
{
133133
$this->psr0Map[$prefix] = $path;
134134
}
135135

136136
/**
137137
* @param array $psr0Map Class to filename map
138138
*/
139-
public function addPsr0Map(array $psr0Map)
139+
public function addPsr0Map(array $psr0Map): void
140140
{
141141
if ($this->psr0Map) {
142142
$this->psr0Map = \array_merge($this->psr0Map, $psr0Map);
@@ -150,7 +150,7 @@ public function addPsr0Map(array $psr0Map)
150150
* @param string $path
151151
* @throws \InvalidArgumentException
152152
*/
153-
public function addPsr4(string $prefix, string $path)
153+
public function addPsr4(string $prefix, string $path): void
154154
{
155155
// Register directories for a new namespace.
156156
$length = \strlen($prefix);
@@ -165,7 +165,7 @@ public function addPsr4(string $prefix, string $path)
165165
/**
166166
* @param array $psr4Map Class to filename map
167167
*/
168-
public function addPsr4Map(array $psr4Map)
168+
public function addPsr4Map(array $psr4Map): void
169169
{
170170
if ($this->psr4Map) {
171171
$this->psr4Map = \array_merge($this->psr4Map, $psr4Map);
@@ -185,7 +185,7 @@ public function getPsr4Map(): array
185185
/**
186186
* @param array $psr4Map
187187
*/
188-
public function setPsr4Map($psr4Map)
188+
public function setPsr4Map($psr4Map): void
189189
{
190190
$this->psr4Map = $psr4Map;
191191
}
@@ -201,15 +201,15 @@ public function getClassMap(): array
201201
/**
202202
* @param array $classMap
203203
*/
204-
public function setClassMap(array $classMap)
204+
public function setClassMap(array $classMap): void
205205
{
206206
$this->classMap = $classMap;
207207
}
208208

209209
/**
210210
* @param array $classMap Class to filename map
211211
*/
212-
public function addClassMap(array $classMap)
212+
public function addClassMap(array $classMap): void
213213
{
214214
if ($this->classMap) {
215215
$this->classMap = \array_merge($this->classMap, $classMap);
@@ -222,15 +222,15 @@ public function addClassMap(array $classMap)
222222
* Registers this instance as an autoloader.
223223
* @param bool $prepend Whether to prepend the autoloader or not
224224
*/
225-
public function register(bool $prepend = false)
225+
public function register(bool $prepend = false): void
226226
{
227227
\spl_autoload_register([$this, 'loadClass'], true, $prepend);
228228
}
229229

230230
/**
231231
* Un-registers this instance as an autoloader.
232232
*/
233-
public function unRegister()
233+
public function unRegister(): void
234234
{
235235
\spl_autoload_unregister([$this, 'loadClass']);
236236
}
@@ -240,7 +240,7 @@ public function unRegister()
240240
* @param string $class The name of the class
241241
* @return bool|null True if loaded, null otherwise
242242
*/
243-
public function loadClass(string $class)
243+
public function loadClass(string $class): ?bool
244244
{
245245
if ($file = $this->findFile($class)) {
246246
_includeClassFile($file);

‎libs/php-utils/src/PhpDotEnv.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function __construct(string $fileDir, string $fileName = '.env')
5757
/**
5858
* @param string $file
5959
*/
60-
public function add(string $file)
60+
public function add(string $file): void
6161
{
6262
if (\is_file($file) && \is_readable($file)) {
6363
$this->settingEnv(\parse_ini_file($file));
@@ -68,7 +68,7 @@ public function add(string $file)
6868
* setting env data
6969
* @param array $data
7070
*/
71-
private function settingEnv(array $data)
71+
private function settingEnv(array $data): void
7272
{
7373
$loadedVars = \array_flip(\explode(',', \getenv(self::FULL_KEY)));
7474
unset($loadedVars['']);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /