From 34f656b8c5ce96549c9658a8bf77f14f75996a39 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 5 Jun 2024 16:36:09 +1200 Subject: [PATCH] ENH Use class name instead of self --- src/Library.php | 8 ++++---- src/VendorPlugin.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Library.php b/src/Library.php index 877b10c..9829c2b 100644 --- a/src/Library.php +++ b/src/Library.php @@ -115,7 +115,7 @@ public function getBasePublicPath() { $projectPath = $this->getBasePath(); $resourceDir = $this->getResourcesDir(); - $publicPath = Util::joinPaths($projectPath, self::PUBLIC_PATH, $resourceDir); + $publicPath = Util::joinPaths($projectPath, Library::PUBLIC_PATH, $resourceDir); return $publicPath; } @@ -138,7 +138,7 @@ public function getPath() */ public function getRelativePath() { - return trim(substr($this->path ?? '', strlen($this->basePath ?? '')), self::TRIM_CHARS ?? ''); + return trim(substr($this->path ?? '', strlen($this->basePath ?? '')), Library::TRIM_CHARS ?? ''); } /** @@ -271,13 +271,13 @@ public function getResourcesDir() $rootProject = new JsonFile($rootComposerFile, null, new NullIO()); if (!$rootProject->exists()) { - return self::DEFAULT_RESOURCES_DIR; + return Library::DEFAULT_RESOURCES_DIR; } $rootProjectData = $rootProject->read(); $resourcesDir = isset($rootProjectData['extra']['resources-dir']) ? $rootProjectData['extra']['resources-dir'] - : self::DEFAULT_RESOURCES_DIR; + : Library::DEFAULT_RESOURCES_DIR; if (preg_match('/^[_\-a-z0-9]+$/i', $resourcesDir ?? '')) { diff --git a/src/VendorPlugin.php b/src/VendorPlugin.php index 2a987ce..fef5913 100644 --- a/src/VendorPlugin.php +++ b/src/VendorPlugin.php @@ -46,7 +46,7 @@ class VendorPlugin implements PluginInterface, EventSubscriberInterface, Capable /** * Define default as 'auto' */ - const METHOD_DEFAULT = self::METHOD_AUTO; + const METHOD_DEFAULT = VendorPlugin::METHOD_AUTO; /** * @var Filesystem