Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 2.74 KB

File metadata and controls

29 lines (23 loc) · 2.74 KB

ATmosphere - Code Quality TODO

Open

Service locator anti-pattern: nullable languageManager in base class

  • src/Transformer/TransformerBase.phplanguageManager is a nullable property set by concrete subclasses (PostTransformer) rather than declared in the base constructor. This is acceptable for the current two-subclass hierarchy where only PostTransformer needs language context. If a third transformer needs getLangs(), consider adding an abstract method or moving the property to a shared constructor.

Resolved

The following issues have been fixed:

  • src/Transformer/PublicationTransformer.phphexToRgb() changed from public static to private static
  • src/Form/SettingsForm.php:26$config_factory renamed to $configFactory per Drupal OOP camelCase convention
  • src/Transformer/TidGenerator.phpstrpos() === FALSE replaced with str_contains()
  • src/Transformer/DocumentTransformer.php — Added use Drupal\atmosphere\ContentParser\ContentParserInterface import; removed inline FQCN
  • atmosphere.module — Uppercase TRUE/FALSE standardized to lowercase
  • src/Service/ApiClient.php — Uppercase TRUE/FALSE standardized; added @param/@return docblocks to all public methods
  • src/Service/Publisher.php — Uppercase TRUE/FALSE standardized; added @param/@return docblocks to publish(), update(), delete(), deleteByTids(), syncPublication()
  • src/Service/ConnectionManager.php — Added @return docblocks to isConnected(), getConnection(), getDid(), getHandle(), getPdsEndpoint(), getTokenEndpoint(), getAuthServer(), getAccessToken(), getRefreshToken(), getDpopJwk(), getExpiresAt()
  • src/OAuth/Client.php — Uppercase TRUE/FALSE standardized; added @return docblocks to clientId(), redirectUri(), accessToken(), dpopJwk(), disconnect()
  • src/Controller/BackfillController.php — Added @param/@return docblocks to count() and batch()
  • \Drupal::service('file_system') in DocumentTransformer, PostTransformer, PublicationTransformer — now injected via FileSystemInterface
  • \Drupal::entityTypeManager() in PostTransformer — now injected via EntityTypeManagerInterface
  • \Drupal::languageManager() in TransformerBase — now uses injected LanguageManagerInterface
  • $GLOBALS['base_url'] in ClientMetadataController, DocumentTransformer, PublicationTransformer — replaced with UrlGeneratorInterface
  • \Drupal::logger() in Publisher — now uses injected LoggerInterface
  • PreviewSubscriber JSON double-encoding bug — fixed to new JsonResponse($record)
  • truncateText() now uses grapheme_strlen/grapheme_substr with mb_ fallback