open-telemetry / opentelemetry-php

The OpenTelemetry PHP Library
https://opentelemetry.io/docs/instrumentation/php/
Apache License 2.0
751 stars 186 forks source link

PHP organization/naming pass #425

Closed Blacksmoke16 closed 3 years ago

Blacksmoke16 commented 3 years ago

Currently all of the source PHP code lives within their own folders in the root directory. From what I remember talking with @bobstrecansky is that this was just how the original creator of the lib set it up, and not some OTLP requirement.

Related to this, the API is defined under the OpenTelemetry\Trace namespace and are using names like Span for interfaces.

Because we are still in a pre-alpha state, I propose to makes some changes before it becomes impossible due to needing to maintain backwards compatibility.

These suggestions include:

.
├── src
│   ├── API
│   ├── Context
│   ├── Proto
│   └── SDK
└── tests
    ├── API
    ├── Context
    └── SDK

_Originally posted by @Blacksmoke16 in https://github.com/open-telemetry/opentelemetry-php/pull/422#discussion_r712628145_

bobstrecansky commented 3 years ago

I'm happy for you to follow the PHP FIG conventions and class naming conventions. This might be a large effort but if you feel that it's worth it, I'm happy to endorse it.

Blacksmoke16 commented 3 years ago

@bobstrecansky Great! I don't actually think it'll be too bad. PHPStorm's refactoring features should handle a lot of the work. I'll give it a go and see how it plays out.

bobstrecansky commented 3 years ago

PHPStorm is the hero we all need 🍡