Skip to content

PHP 8.x deprecations #3

@Lundis

Description

@Lundis

Hey,

This library logs a lot of deprecation errors in PHP 8.4. A claude scan shows:

  ┌─────┬────────────────────────────────────┬───────────────────────────────────────────┬───────────────────────────────────────────────────────────────────────────────┐
  │  #  │              Property              │            Where it's assigned            │                                   File:line                                   │
  ├─────┼────────────────────────────────────┼───────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────┤
  │ 1   │ Blastream\Collaborator::$_data     │ constructor                               │ src/Collaborators.php:7                                                       │
  ├─────┼────────────────────────────────────┼───────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────┤
  │ 2   │ Blastream\Collaborator::$_instance │ constructor                               │ src/Collaborators.php:8                                                       │
  ├─────┼────────────────────────────────────┼───────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────┤
  │ 3   │ Blastream\Scene::$_data            │ constructor                               │ src/Scenes.php:7                                                              │
  ├─────┼────────────────────────────────────┼───────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────┤
  │ 4   │ Blastream\Scene::$_instance        │ constructor                               │ src/Scenes.php:8                                                              │
  ├─────┼────────────────────────────────────┼───────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────┤
  │ 5   │ Blastream\Instance::$_slug         │ Space::setSlug() (trait used by Instance) │ src/Space.php:31 (also assigned via Channel::setSlug() at src/Channel.php:18) │
  └─────┴────────────────────────────────────┴───────────────────────────────────────────┴───────────────────────────────────────────────────────────────────────────────┘


Claude found a bunch of other issues as well:

  6. src/Channel.php:111-117 — typo $prams instead of $params in setCustom(). The whole isV1() branch writes to a local that's never used; the real $params (without css/js) is sent. Entire block is dead code due to the typo.
  7. src/Instance.php:164 — bare statement $url; on an undefined variable, just before the if/else that actually assigns it. Dead line; looks like an attempt at a forward declaration that doesn't exist in PHP. Harmless but obviously unintentional.
  8. src/Instance.php:115-116 — TLS verification disabled by default (CURLOPT_SSL_VERIFYHOST=0, CURLOPT_SSL_VERIFYPEER=0). Not a deprecation but a real security issue for an SDK that ships keys.
  9. src/Instance.php:127-128 — json_decode($result)->error is called blindly on a possibly-non-JSON / non-error-shaped body when http_code != 200. Throws TypeError: Attempt to read property "error" on null instead of the intended exception message, masking the real failure.
  10. Method name typo thowException (missing r) — public API. src/Instance.php:154, used at src/Instance.php:109, src/Instance.php:122, src/Instance.php:128, src/Space.php:24, src/Space.php:29, src/Space.php:60. Renaming is a BC break; suggested fix is to add a throwException method and have
  thowException delegate to it (or vice versa), then deprecate the typo'd name.                                                                                                                                                                                                                          
  11. src/Polls.php:6 — createPool() typo, already aliased to createPoll(). Worth marking with @deprecated so consumers can migrate.
  12. composer.json has no "require": { "php": "..." } constraint. Adding one (e.g. ">=8.0") lets Composer warn before runtime instead of failing silently against future PHP versions.  

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions