Skip to content

Commit 0c9a302

Browse files
committed
Remove all @throws PHPDoc, it's almost useless for SPC anymore
1 parent fa10142 commit 0c9a302

File tree

120 files changed

+169
-1203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+169
-1203
lines changed

src/SPC/builder/BuilderProvider.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
use SPC\builder\linux\LinuxBuilder;
99
use SPC\builder\macos\MacOSBuilder;
1010
use SPC\builder\windows\WindowsBuilder;
11-
use SPC\exception\FileSystemException;
12-
use SPC\exception\RuntimeException;
1311
use SPC\exception\WrongUsageException;
1412
use Symfony\Component\Console\Input\InputInterface;
1513

@@ -20,11 +18,6 @@ class BuilderProvider
2018
{
2119
private static ?BuilderBase $builder = null;
2220

23-
/**
24-
* @throws FileSystemException
25-
* @throws RuntimeException
26-
* @throws WrongUsageException
27-
*/
2821
public static function makeBuilderByInput(InputInterface $input): BuilderBase
2922
{
3023
ini_set('memory_limit', '4G');
@@ -39,9 +32,6 @@ public static function makeBuilderByInput(InputInterface $input): BuilderBase
3932
return self::$builder;
4033
}
4134

42-
/**
43-
* @throws WrongUsageException
44-
*/
4535
public static function getBuilder(): BuilderBase
4636
{
4737
if (self::$builder === null) {

src/SPC/builder/Extension.php

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ class Extension
2424

2525
protected string $source_dir;
2626

27-
/**
28-
* @throws FileSystemException
29-
* @throws RuntimeException
30-
* @throws WrongUsageException
31-
*/
3227
public function __construct(protected string $name, protected BuilderBase $builder)
3328
{
3429
$ext_type = Config::getExt($this->name, 'type');
@@ -63,9 +58,6 @@ public function getFrameworks(): array
6358

6459
/**
6560
* 获取开启该扩展的 PHP 编译添加的参数
66-
*
67-
* @throws FileSystemException
68-
* @throws WrongUsageException
6961
*/
7062
public function getConfigureArg(bool $shared = false): string
7163
{
@@ -80,9 +72,6 @@ public function getConfigureArg(bool $shared = false): string
8072

8173
/**
8274
* 根据 ext 的 arg-type 获取对应开启的参数,一般都是 --enable-xxx 和 --with-xxx
83-
*
84-
* @throws FileSystemException
85-
* @throws WrongUsageException
8675
*/
8776
public function getEnableArg(bool $shared = false): string
8877
{
@@ -112,10 +101,6 @@ public function getLibFilesString(): string
112101

113102
/**
114103
* 检查下依赖就行了,作用是导入依赖给 Extension 对象,今后可以对库依赖进行选择性处理
115-
*
116-
* @throws RuntimeException
117-
* @throws FileSystemException
118-
* @throws WrongUsageException
119104
*/
120105
public function checkDependency(): static
121106
{
@@ -259,8 +244,6 @@ public function patchBeforeSharedMake(): bool
259244
* i.e.; pdo_pgsql would return:
260245
*
261246
* `-d "extension=pgsql" -d "extension=pdo_pgsql"`
262-
* @throws FileSystemException
263-
* @throws WrongUsageException
264247
*/
265248
public function getSharedExtensionLoadString(): string
266249
{
@@ -300,9 +283,6 @@ public function getSharedExtensionLoadString(): string
300283
return $ret;
301284
}
302285

303-
/**
304-
* @throws RuntimeException
305-
*/
306286
public function runCliCheckUnix(): void
307287
{
308288
// Run compile check if build target is cli
@@ -333,9 +313,6 @@ public function runCliCheckUnix(): void
333313
}
334314
}
335315

336-
/**
337-
* @throws RuntimeException
338-
*/
339316
public function runCliCheckWindows(): void
340317
{
341318
// Run compile check if build target is cli
@@ -368,9 +345,6 @@ public function validate(): void
368345

369346
/**
370347
* Build shared extension
371-
*
372-
* @throws WrongUsageException
373-
* @throws RuntimeException
374348
*/
375349
public function buildShared(): void
376350
{
@@ -406,12 +380,6 @@ public function buildShared(): void
406380

407381
/**
408382
* Build shared extension for Unix
409-
*
410-
* @throws FileSystemException
411-
* @throws RuntimeException
412-
* @throws WrongUsageException
413-
* @throws \ReflectionException
414-
* @throws \Throwable
415383
*/
416384
public function buildUnixShared(): void
417385
{
@@ -506,9 +474,6 @@ public function isBuildStatic(): bool
506474
return $this->build_static;
507475
}
508476

509-
/**
510-
* @throws RuntimeException
511-
*/
512477
protected function addLibraryDependency(string $name, bool $optional = false): void
513478
{
514479
$depLib = $this->builder->getLib($name);
@@ -522,9 +487,6 @@ protected function addLibraryDependency(string $name, bool $optional = false): v
522487
}
523488
}
524489

525-
/**
526-
* @throws RuntimeException
527-
*/
528490
protected function addExtensionDependency(string $name, bool $optional = false): void
529491
{
530492
$depExt = $this->builder->getExt($name);

src/SPC/builder/LibraryBase.php

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ abstract class LibraryBase
2727

2828
protected bool $patched = false;
2929

30-
/**
31-
* @throws RuntimeException
32-
*/
3330
public function __construct(?string $source_dir = null)
3431
{
3532
if (static::NAME === 'unknown') {
@@ -40,10 +37,7 @@ public function __construct(?string $source_dir = null)
4037

4138
/**
4239
* Try to install or build this library.
43-
* @param bool $force If true, force install or build
44-
* @throws FileSystemException
45-
* @throws RuntimeException
46-
* @throws WrongUsageException
40+
* @param bool $force If true, force install or build
4741
*/
4842
public function setup(bool $force = false): int
4943
{
@@ -107,10 +101,6 @@ public function getDependencies(bool $recursive = false): array
107101

108102
/**
109103
* Calculate dependencies for current library.
110-
*
111-
* @throws RuntimeException
112-
* @throws FileSystemException
113-
* @throws WrongUsageException
114104
*/
115105
public function calcDependency(): void
116106
{
@@ -131,9 +121,6 @@ public function calcDependency(): void
131121

132122
/**
133123
* Get config static libs.
134-
*
135-
* @throws FileSystemException
136-
* @throws WrongUsageException
137124
*/
138125
public function getStaticLibs(): array
139126
{
@@ -142,9 +129,6 @@ public function getStaticLibs(): array
142129

143130
/**
144131
* Get config headers.
145-
*
146-
* @throws FileSystemException
147-
* @throws WrongUsageException
148132
*/
149133
public function getHeaders(): array
150134
{
@@ -153,19 +137,12 @@ public function getHeaders(): array
153137

154138
/**
155139
* Get binary files.
156-
*
157-
* @throws FileSystemException
158-
* @throws WrongUsageException
159140
*/
160141
public function getBinaryFiles(): array
161142
{
162143
return Config::getLib(static::NAME, 'bin', []);
163144
}
164145

165-
/**
166-
* @throws WrongUsageException
167-
* @throws FileSystemException
168-
*/
169146
public function tryInstall(array $lock, bool $force_install = false): int
170147
{
171148
$install_file = $lock['filename'];
@@ -194,10 +171,6 @@ public function tryInstall(array $lock, bool $force_install = false): int
194171
* BUILD_STATUS_OK if build success
195172
* BUILD_STATUS_ALREADY if already built
196173
* BUILD_STATUS_FAILED if build failed
197-
*
198-
* @throws RuntimeException
199-
* @throws FileSystemException
200-
* @throws WrongUsageException
201174
*/
202175
public function tryBuild(bool $force_build = false): int
203176
{
@@ -319,8 +292,6 @@ public function patchPhpConfig(): bool
319292

320293
/**
321294
* Build this library.
322-
*
323-
* @throws RuntimeException
324295
*/
325296
abstract protected function build();
326297

@@ -351,8 +322,6 @@ protected function install(): void
351322

352323
/**
353324
* Add lib dependency
354-
*
355-
* @throws RuntimeException
356325
*/
357326
protected function addLibraryDependency(string $name, bool $optional = false): void
358327
{

src/SPC/builder/extension/bz2.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,12 @@
66

77
use SPC\builder\Extension;
88
use SPC\builder\macos\MacOSBuilder;
9-
use SPC\exception\FileSystemException;
10-
use SPC\exception\WrongUsageException;
119
use SPC\store\FileSystem;
1210
use SPC\util\CustomExt;
1311

1412
#[CustomExt('bz2')]
1513
class bz2 extends Extension
1614
{
17-
/**
18-
* @throws FileSystemException
19-
* @throws WrongUsageException
20-
*/
2115
public function patchBeforeConfigure(): bool
2216
{
2317
$frameworks = $this->builder instanceof MacOSBuilder ? ' ' . $this->builder->getFrameworks(true) . ' ' : '';

src/SPC/builder/extension/curl.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
#[CustomExt('curl')]
1717
class curl extends Extension
1818
{
19-
/**
20-
* @throws FileSystemException
21-
*/
2219
public function patchBeforeBuildconf(): bool
2320
{
2421
logger()->info('patching before-configure for curl checks');
@@ -46,10 +43,6 @@ public function patchBeforeBuildconf(): bool
4643
return true;
4744
}
4845

49-
/**
50-
* @throws FileSystemException
51-
* @throws WrongUsageException
52-
*/
5346
public function patchBeforeConfigure(): bool
5447
{
5548
$frameworks = $this->builder instanceof MacOSBuilder ? ' ' . $this->builder->getFrameworks(true) . ' ' : '';

src/SPC/builder/extension/dom.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,12 @@
55
namespace SPC\builder\extension;
66

77
use SPC\builder\Extension;
8-
use SPC\exception\RuntimeException;
98
use SPC\store\FileSystem;
109
use SPC\util\CustomExt;
1110

1211
#[CustomExt('dom')]
1312
class dom extends Extension
1413
{
15-
/**
16-
* @throws RuntimeException
17-
*/
1814
public function getUnixConfigureArg(bool $shared = false): string
1915
{
2016
$arg = '--enable-dom' . ($shared ? '=shared' : '');

src/SPC/builder/extension/ev.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,12 @@
55
namespace SPC\builder\extension;
66

77
use SPC\builder\Extension;
8-
use SPC\exception\FileSystemException;
98
use SPC\store\FileSystem;
109
use SPC\util\CustomExt;
1110

1211
#[CustomExt('ev')]
1312
class ev extends Extension
1413
{
15-
/**
16-
* @throws FileSystemException
17-
*/
1814
public function patchBeforeBuildconf(): bool
1915
{
2016
/*

src/SPC/builder/extension/event.php

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

77
use SPC\builder\Extension;
88
use SPC\builder\macos\MacOSBuilder;
9-
use SPC\exception\FileSystemException;
109
use SPC\store\FileSystem;
1110
use SPC\util\CustomExt;
1211

@@ -27,18 +26,12 @@ public function getUnixConfigureArg(bool $shared = false): string
2726
return $arg;
2827
}
2928

30-
/**
31-
* @throws FileSystemException
32-
*/
3329
public function patchBeforeConfigure(): bool
3430
{
3531
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/configure', '/-levent_openssl/', $this->getLibFilesString());
3632
return true;
3733
}
3834

39-
/**
40-
* @throws FileSystemException
41-
*/
4235
public function patchBeforeMake(): bool
4336
{
4437
$patched = parent::patchBeforeMake();

src/SPC/builder/extension/gettext.php

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

77
use SPC\builder\Extension;
88
use SPC\builder\macos\MacOSBuilder;
9-
use SPC\exception\FileSystemException;
10-
use SPC\exception\WrongUsageException;
119
use SPC\store\FileSystem;
1210
use SPC\util\CustomExt;
1311

1412
#[CustomExt('gettext')]
1513
class gettext extends Extension
1614
{
17-
/**
18-
* @throws FileSystemException
19-
*/
2015
public function patchBeforeBuildconf(): bool
2116
{
2217
if ($this->builder instanceof MacOSBuilder) {
@@ -25,10 +20,6 @@ public function patchBeforeBuildconf(): bool
2520
return true;
2621
}
2722

28-
/**
29-
* @throws WrongUsageException
30-
* @throws FileSystemException
31-
*/
3223
public function patchBeforeConfigure(): bool
3324
{
3425
if ($this->builder instanceof MacOSBuilder) {

src/SPC/builder/extension/glfw.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,12 @@
55
namespace SPC\builder\extension;
66

77
use SPC\builder\Extension;
8-
use SPC\exception\RuntimeException;
98
use SPC\store\FileSystem;
109
use SPC\util\CustomExt;
1110

1211
#[CustomExt('glfw')]
1312
class glfw extends Extension
1413
{
15-
/**
16-
* @throws RuntimeException
17-
*/
1814
public function patchBeforeBuildconf(): bool
1915
{
2016
if (file_exists(SOURCE_PATH . '/php-src/ext/glfw')) {

0 commit comments

Comments
 (0)