Skip to content

Commit 17f7be9

Browse files
authored
Drop thecodingmachine/safe (#191)
1 parent bf724c4 commit 17f7be9

21 files changed

+45
-103
lines changed

bin/phpstan-baseline-analyze.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22

33
use staabm\PHPStanBaselineAnalysis\ResultPrinter;
4-
use function Safe\ini_set;
54

65
// Finding composer
76

bin/phpstan-baseline-filter.php

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

33
use staabm\PHPStanBaselineAnalysis\FilterApplication;
44
use staabm\PHPStanBaselineAnalysis\ResultPrinter;
5-
use function Safe\ini_set;
65

76
// Finding composer
87

bin/phpstan-baseline-graph.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
use function Safe\ini_set;
4-
53
// Finding composer
64

75
$paths = [

bin/phpstan-baseline-trend.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
<?php
22

3-
use function Safe\ini_set;
4-
use function Safe\substr;
5-
use function Safe\sprintf;
6-
73
// Finding composer
84

95
$paths = [

composer.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,14 @@
1313
"require": {
1414
"php": "^7.4 || ^8.0",
1515
"nette/neon": "^3.2",
16-
"symfony/polyfill-php80": "^1.26",
17-
"thecodingmachine/safe": "^1.3 || ^2.0"
16+
"symfony/polyfill-php80": "^1.26"
1817
},
1918
"require-dev": {
2019
"phpstan/extension-installer": "^1.4",
2120
"phpstan/phpstan": "^1.12",
2221
"phpstan/phpstan-deprecation-rules": "^1.2",
2322
"phpunit/phpunit": "^9.6",
2423
"symfony/var-dumper": "^5.3",
25-
"thecodingmachine/phpstan-safe-rule": "^1.2",
2624
"tomasvotruba/cognitive-complexity": "0.2.3",
2725
"tomasvotruba/type-coverage": "1.0.0",
2826
"tomasvotruba/unused-public": "1.1.0"

lib/AnalyzeApplication.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ final class AnalyzeApplication
2020
*
2121
* @return self::EXIT_*
2222
*
23-
* @throws \Safe\Exceptions\FilesystemException
24-
*
2523
* @api
2624
*/
2725
public function start(string $glob, string $format): int

lib/AnalyzerResultReader.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,9 @@
22

33
namespace staabm\PHPStanBaselineAnalysis;
44

5-
use function Safe\file_get_contents;
6-
use function Safe\json_decode;
7-
85
final class AnalyzerResultReader {
96
/**
107
* @return array<string, AnalyzerResult>
11-
* @throws \Safe\Exceptions\FilesystemException
12-
* @throws \Safe\Exceptions\JsonException
138
*/
149
public function readFile(string $filePath): array
1510
{
@@ -41,12 +36,10 @@ public function readFile(string $filePath): array
4136
/**
4237
* @param string $filePath
4338
* @return array<mixed>
44-
* @throws \Safe\Exceptions\FilesystemException
45-
* @throws \Safe\Exceptions\JsonException
4639
*/
4740
private function readResultArray(string $filePath): array
4841
{
49-
\Safe\fwrite(STDERR, 'Reading file ' . $filePath . PHP_EOL);
42+
fwrite(STDERR, 'Reading file ' . $filePath . PHP_EOL);
5043

5144
$content = file_get_contents($filePath);
5245
if ($content === '') {

lib/Baseline.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
use Iterator;
66
use Nette\Neon\Neon;
77
use RuntimeException;
8-
use Safe\Exceptions\FilesystemException;
9-
use function Safe\file_get_contents;
10-
use function Safe\sprintf;
118

129
final class Baseline {
1310
/**
@@ -20,9 +17,6 @@ final class Baseline {
2017
*/
2118
private $filePath;
2219

23-
/**
24-
* @throws FilesystemException
25-
*/
2620
static public function forFile(string $filePath):self {
2721
$baselineExtension = pathinfo($filePath, PATHINFO_EXTENSION);
2822

lib/BaselineAnalyzer.php

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

33
namespace staabm\PHPStanBaselineAnalysis;
44

5-
use Safe\DateTimeImmutable;
6-
use function Safe\preg_match;
5+
use DateTimeImmutable;
76

87
final class BaselineAnalyzer
98
{
@@ -152,6 +151,6 @@ private function printfToScanfFormat(string $format): string {
152151

153152
private function normalizeMessage(BaselineError $baselineError): string {
154153
// makes the message format of tomasvotruba/type-coverage 0.2.* compatible with tomasvotruba/type-coverage 0.1.*
155-
return \Safe\preg_replace('/only \d+ \- (\d+).\d %/', 'only $1 %', $baselineError->unwrapMessage());
154+
return preg_replace('/only \d+ \- (\d+).\d %/', 'only $1 %', $baselineError->unwrapMessage());
156155
}
157156
}

lib/BaselineError.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace staabm\PHPStanBaselineAnalysis;
44

5-
use function Safe\preg_match;
6-
75
/**
86
* @immutable
97
*/

0 commit comments

Comments
 (0)