Skip to content

Commit 18ef231

Browse files
committed
Removed all the unnecessary packages in require-dev
1 parent 0108bf6 commit 18ef231

File tree

3 files changed

+24
-19
lines changed

3 files changed

+24
-19
lines changed

composer.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
2323
"ergebnis/composer-normalize": "^2.0.2",
2424
"jakub-onderka/php-parallel-lint": "^1.0",
25-
"nette/application": "^2.3.0 || ^3.0.0",
26-
"nette/component-model": "^2.3.0 || ^3.0.0",
27-
"nette/di": "^2.3.0 || ^3.0.0",
28-
"nette/forms": "^2.3.0 || ^3.0.0",
29-
"nette/http": "^2.3.0 || ^3.0.0",
3025
"nette/utils": "^2.3.0 || ^3.0.0",
3126
"phing/phing": "^2.13.0",
3227
"phpstan/phpstan-php-parser": "^0.12",

tests/Rule/Nette/RethrowExceptionRuleTest.php

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

33
namespace PHPStan\Rule\Nette;
44

5-
use Nette\Application\AbortException;
6-
use Nette\Application\UI\Presenter;
5+
use AbortException;
6+
use FooPresenter;
77
use PHPStan\Rules\Rule;
88
use PHPStan\Testing\RuleTestCase;
99

@@ -16,27 +16,27 @@ class RethrowExceptionRuleTest extends RuleTestCase
1616
protected function getRule(): Rule
1717
{
1818
return new RethrowExceptionRule(
19-
[Presenter::class => ['redirect' => AbortException::class]]
19+
[FooPresenter::class => ['redirect' => AbortException::class]]
2020
);
2121
}
2222

2323
public function testRule(): void
2424
{
2525
$this->analyse([__DIR__ . '/data/rethrow-abort.php'], [
2626
[
27-
'Exception Nette\Application\AbortException needs to be rethrown.',
27+
'Exception AbortException needs to be rethrown.',
2828
8,
2929
],
3030
[
31-
'Exception Nette\Application\AbortException needs to be rethrown.',
31+
'Exception AbortException needs to be rethrown.',
3232
14,
3333
],
3434
[
35-
'Exception Nette\Application\AbortException needs to be rethrown.',
35+
'Exception AbortException needs to be rethrown.',
3636
76,
3737
],
3838
[
39-
'Exception Nette\Application\AbortException needs to be rethrown.',
39+
'Exception AbortException needs to be rethrown.',
4040
95,
4141
],
4242
]);

tests/Rule/Nette/data/rethrow-abort.php

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

3-
class FooPresenter extends \Nette\Application\UI\Presenter
3+
class FooPresenter
44
{
55

66
public function doFoo()
@@ -31,7 +31,7 @@ public function doIpsum()
3131
{
3232
try {
3333
$this->redirect('this'); // OK
34-
} catch (\Nette\Application\AbortException $e) {
34+
} catch (AbortException $e) {
3535
throw $e;
3636
}
3737
}
@@ -40,7 +40,7 @@ public function doBaz()
4040
{
4141
try {
4242
$this->redirect('this'); // OK
43-
} catch (\Nette\Application\AbortException | \InvalidArgumentException $e) {
43+
} catch (AbortException | \InvalidArgumentException $e) {
4444
throw $e;
4545
}
4646
}
@@ -49,15 +49,15 @@ public function doLorem()
4949
{
5050
try {
5151
$this->redirect('this'); // OK
52-
} catch (\Nette\Application\AbortException $e) {
52+
} catch (AbortException $e) {
5353
throw $e;
5454
} catch (\Throwable $e) {
5555

5656
}
5757

5858
try {
5959
$this->redirect('this'); // OK
60-
} catch (\Nette\Application\AbortException $e) {
60+
} catch (AbortException $e) {
6161
throw $e;
6262
} catch (\Exception $e) {
6363

@@ -67,7 +67,7 @@ public function doLorem()
6767
$this->redirect('this'); // OK
6868
} catch (\InvalidArgumentException $e) {
6969

70-
} catch (\Nette\Application\AbortException $e) {
70+
} catch (AbortException $e) {
7171
throw $e;
7272
} catch (\Exception $e) {
7373

@@ -94,7 +94,7 @@ public function doDolor()
9494

9595
try {
9696
$this->redirect('this');
97-
} catch (\Nette\Application\AbortException $e) {
97+
} catch (AbortException $e) {
9898
// does not rethrow
9999
} catch (\Throwable $e) {
100100

@@ -113,4 +113,14 @@ public function doDolor()
113113
}
114114
}
115115

116+
public function redirect(string $destination): void
117+
{
118+
119+
}
120+
121+
}
122+
123+
class AbortException extends \Exception
124+
{
125+
116126
}

0 commit comments

Comments
 (0)