adding stubs for deptrac
there are some things in our code that deptrac doesn't understand or are missing for some php versions. stub them to quieten all those violation warnings
This commit is contained in:
parent
853f978216
commit
a1f2ba09a8
1
Makefile
1
Makefile
|
|
@ -5,6 +5,7 @@ DOCKER_COMPOSE ?= docker compose
|
|||
DC_RUN_PHP = $(DOCKER_COMPOSE) run --rm php
|
||||
|
||||
.DEFAULT_GOAL : help
|
||||
.PHONY: deptrac
|
||||
|
||||
help: ## Show this help
|
||||
@printf "\033[33m%s:\033[0m\n" 'Available commands'
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ deptrac:
|
|||
- ./src
|
||||
- ./proto
|
||||
- ./tests
|
||||
- ./deptrac/stubs
|
||||
exclude_files:
|
||||
- '#.*test.*#'
|
||||
layers:
|
||||
|
|
@ -109,10 +110,15 @@ deptrac:
|
|||
collectors:
|
||||
- type: className
|
||||
regex: ^Nyholm\\Psr7Server\\*
|
||||
- name: Stubs
|
||||
collectors:
|
||||
- type: directory
|
||||
value: deptrac/stubs/.*
|
||||
|
||||
ruleset:
|
||||
Context:
|
||||
- FFI
|
||||
- Stubs
|
||||
SemConv: ~
|
||||
ConfigSDK:
|
||||
- SymfonyConfig
|
||||
|
|
@ -124,10 +130,12 @@ deptrac:
|
|||
- Context
|
||||
- Contrib
|
||||
- Extension
|
||||
- Stubs
|
||||
API:
|
||||
- Context
|
||||
- PsrLog
|
||||
- SPI
|
||||
- Stubs
|
||||
SDK:
|
||||
- +API
|
||||
- ConfigSDK
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
namespace OpenTelemetry\Config\SDK\Configuration;
|
||||
|
||||
class ComponentPlugin {}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
namespace OpenTelemetry\Config\SDK\Configuration;
|
||||
|
||||
class ComponentProvider {}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
namespace OpenTelemetry\Config\SDK\Configuration;
|
||||
|
||||
class ComponentProviderRegistry {}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
namespace OpenTelemetry\Config\SDK\Configuration;
|
||||
|
||||
class Context {}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
//stub Override attribute for PHP <8.3
|
||||
|
||||
namespace {
|
||||
if (!class_exists('Override')) {
|
||||
#[\Attribute(\Attribute::TARGET_METHOD)]
|
||||
final class Override {}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
Stubs for deptrac, which represent classes missing from some PHP versions, or classes
|
||||
that deptrac does not understand.
|
||||
Loading…
Reference in New Issue