Skip to content

Commit 6892342

Browse files
committed
Merge branch 'refactor/remove_unsused_code' of github.com:damianopetrungaro/safe into fsockopen
2 parents 7b3dc69 + 7f94fec commit 6892342

File tree

7 files changed

+4
-21
lines changed

7 files changed

+4
-21
lines changed

generator/src/DocPage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ public function detectFalsyFunction(): bool
3232

3333
if (preg_match('/&warn\.deprecated\.function-(\d+-\d+-\d+)\.removed-(\d+-\d+-\d+)/', $file, $matches)) {
3434
$removedVersion = $matches[2];
35-
[$major, $minor, $fix] = explode('-', $removedVersion);
35+
[$major, $minor] = explode('-', $removedVersion);
3636
if ($major < 7 || ($major == 7 && $minor == 0)) {
3737
// Ignore function if it was removed before PHP 7.1
3838
return false;
3939
}
4040
}
4141
if (preg_match('/&warn\.removed\.function-(\d+-\d+-\d+)/', $file, $matches) && isset($matches[2])) {
4242
$removedVersion = $matches[2];
43-
[$major, $minor, $fix] = explode('-', $removedVersion);
43+
[$major, $minor] = explode('-', $removedVersion);
4444
if ($major < 7 || ($major == 7 && $minor == 0)) {
4545
// Ignore function if it was removed before PHP 7.1
4646
return false;

generator/src/FileCreator.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,9 @@
77
use function file_exists;
88
use PhpOffice\PhpSpreadsheet\Spreadsheet;
99
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
10-
use function ucfirst;
1110

1211
class FileCreator
1312
{
14-
public function __construct()
15-
{
16-
}
17-
1813
/**
1914
* This function generate an xls file
2015
*
@@ -25,7 +20,6 @@ public function generateXlsFile(array $protoFunctions, string $path): void
2520
{
2621
$spreadsheet = new Spreadsheet();
2722
$numb = 1;
28-
$status = '';
2923

3024
$sheet = $spreadsheet->getActiveSheet();
3125
$sheet->setCellValue('A1', 'Function name');

generator/src/Method.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function getParams(): array
7575

7676
if (preg_match('/This parameter has been removed in PHP (\d+\.\d+\.\d+)/', $notes, $matches)) {
7777
$removedVersion = $matches[1];
78-
[$major, $minor, $fix] = explode('.', $removedVersion);
78+
[$major, $minor] = explode('.', $removedVersion);
7979
if ($major < 7 || ($major == 7 && $minor == 0)) {
8080
// Ignore parameter if it was removed before PHP 7.1
8181
continue;

generator/src/Parameter.php

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

44
use Safe\PhpStanFunctions\PhpStanFunction;
5-
use Safe\PhpStanFunctions\PhpStanFunctionMapReader;
65

76
class Parameter
87
{

generator/src/PhpStanFunctions/PhpStanFunctionMapReader.php

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

44
namespace Safe\PhpStanFunctions;
55

6-
use Safe\PhpStanFunctions\PhpStanFunction;
7-
86
class PhpStanFunctionMapReader
97
{
108
/**

generator/src/ScanObjectsCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use Symfony\Component\Console\Command\Command;
77
use Symfony\Component\Console\Input\InputInterface;
88
use Symfony\Component\Console\Output\OutputInterface;
9-
use Symfony\Component\Process\Process;
109

1110
class ScanObjectsCommand extends Command
1211
{

generator/src/WritePhpFunction.php

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

33
namespace Safe;
44

5-
use function in_array;
6-
use function is_numeric;
7-
use function strtolower;
8-
use function strtoupper;
9-
use function var_export;
10-
115
class WritePhpFunction
126
{
137
/**
@@ -27,9 +21,8 @@ public function getPhpPrototypeFunction(): string
2721
{
2822
if ($this->method->getFunctionName()) {
2923
return 'function '.$this->method->getFunctionName().'('.$this->displayParamsWithType($this->method->getParams()).')'.': '.$this->method->getReturnType().'{}';
30-
} else {
31-
return '';
3224
}
25+
return '';
3326
}
3427

3528
/*

0 commit comments

Comments
 (0)