Skip to content

Commit 1d46a15

Browse files
committed
Removed not used protected get_stack_trace() function.
Add tests function for comfortable run in local env.
1 parent 1beb064 commit 1d46a15

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

Makefile

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,26 @@ php.connect74:
33
docker run --rm -it -v "${PWD}":/usr/src/myapp -w /usr/src/myapp pimlab/composer:2.0.0-alpha3-php7.4 sh
44

55

6-
php.connect82:
7-
docker run --rm -it -v "${PWD}":/usr/src/myapp -w /usr/src/myapp shopware/development:8.2-composer-2 bash
6+
#php.connect82:
7+
# docker run --rm -it -v "${PWD}":/usr/src/myapp -w /usr/src/myapp shopware/development:8.2-composer-2 bash
8+
9+
10+
php.connect82xdebug:
11+
docker run --rm -it -v "${PWD}":/usr/src/myapp -w /usr/src/myapp sineverba/php8xc:1.15.0 bash
12+
13+
14+
php.connect83xdebug:
15+
docker run --rm -it -v "${PWD}":/usr/src/myapp -w /usr/src/myapp sineverba/php8xc:1.18.0 bash
16+
17+
18+
##########################
19+
# Tests
20+
##########################
21+
unit.run:
22+
docker run --rm -it -v "${PWD}":/usr/src/myapp -w /usr/src/myapp shopware/development:8.2-composer-2 sh -c 'composer run phpunit -- --do-not-cache-result'
23+
24+
unit.generate.report.html:
25+
docker run --rm -it -v "${PWD}":/usr/src/myapp -w /usr/src/myapp shopware/development:8.2-composer-2 sh -c 'composer run phpunit-report-html'
26+
27+
unit.generate.report.clover:
28+
docker run --rm -it -v "${PWD}":/usr/src/myapp -w /usr/src/myapp shopware/development:8.2-composer-2 sh -c 'composer run phpunit-report-clover'

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
"phpstan": "phpstan analyse -c phpstan.neon",
5050
"phpstan.baselane": "phpstan analyse -c phpstan.neon --generate-baseline",
5151
"phpunit": "phpunit",
52-
"phpunit-coverage": "phpunit --coverage-clover clover.xml"
52+
"phpunit-coverage": "phpunit --coverage-clover clover.xml",
53+
"phpunit-report-html": "phpunit --coverage-html ./tmp/phpunit/coverage-report-html"
5354
},
5455
"config": {
5556
"allow-plugins": {

src/Container.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -212,25 +212,4 @@ protected function resolve_parameter( ReflectionParameter $param ) {
212212
$message = "Parameter `{$param->getName()}` of `{$param->getDeclaringClass()->getName()}` can't be resolved.";
213213
throw new Exception( $message );
214214
}
215-
216-
protected function get_stack_trace(): string {
217-
$stackTraceArray = debug_backtrace();
218-
$stackTraceString = '';
219-
220-
foreach ( $stackTraceArray as $item ) {
221-
$file = $item['file'] ?? '[internal function]';
222-
$line = $item['line'] ?? '';
223-
$function = $item['function'] ?? ''; // @phpstan-ignore-line - 'function' on array always exists and is not nullable.
224-
$class = $item['class'] ?? '';
225-
$type = $item['type'] ?? '';
226-
227-
$stackTraceString .= "{$file}({$line}): ";
228-
if ( ! empty( $class ) ) {
229-
$stackTraceString .= "{$class}{$type}";
230-
}
231-
$stackTraceString .= "{$function}()\n";
232-
}
233-
234-
return $stackTraceString;
235-
}
236215
}

0 commit comments

Comments
 (0)