From 4cee87ee0aff2840e087e664fc35c943b0eaf661 Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Mon, 8 Jan 2024 15:52:21 +0100 Subject: [PATCH] updated cs fixer --- src/Jackalope/Transport/Jackrabbit/Client.php | 2 +- tests/ImplementationLoader.php | 35 +++++++++++-------- .../Transport/Jackrabbit/PrefetchTest.php | 3 +- tests/JackrabbitFixtureLoader.php | 4 ++- 4 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/Jackalope/Transport/Jackrabbit/Client.php b/src/Jackalope/Transport/Jackrabbit/Client.php index aab071ce..299a3af4 100644 --- a/src/Jackalope/Transport/Jackrabbit/Client.php +++ b/src/Jackalope/Transport/Jackrabbit/Client.php @@ -1790,7 +1790,7 @@ private function generateLockFromDavResponse($response, bool $sessionOwning = fa * * @return bool|\DOMNode * - * @throws \PHPCR\RepositoryException When the element is not found and an $errorMessage is set + * @throws RepositoryException When the element is not found and an $errorMessage is set */ private function getRequiredDomElementByTagNameNS($dom, string $namespace, string $element, string $errorMessage = '') { diff --git a/tests/ImplementationLoader.php b/tests/ImplementationLoader.php index 699e4f67..18717ece 100644 --- a/tests/ImplementationLoader.php +++ b/tests/ImplementationLoader.php @@ -1,9 +1,16 @@ getRepository()->login($this->getCredentials())->getWorkspace(); - if (!in_array($GLOBALS['phpcr.workspace'], $workspace->getAccessibleWorkspaceNames())) { + if (!in_array($GLOBALS['phpcr.workspace'], $workspace->getAccessibleWorkspaceNames(), true)) { $workspace->createWorkspace($GLOBALS['phpcr.workspace']); } - if (false == $GLOBALS['phpcr.additionalWorkspace']) { + if (!$GLOBALS['phpcr.additionalWorkspace']) { $this->multiWorkspaceSupported = false; - } elseif (!in_array($GLOBALS['phpcr.additionalWorkspace'], $workspace->getAccessibleWorkspaceNames())) { + } elseif (!in_array($GLOBALS['phpcr.additionalWorkspace'], $workspace->getAccessibleWorkspaceNames(), true)) { $workspace->createWorkspace($GLOBALS['phpcr.additionalWorkspace']); } @@ -115,33 +122,33 @@ public function getRepositoryFactoryParameters() { return [ 'jackalope.jackrabbit_uri' => $GLOBALS['jackrabbit.uri'], - \Jackalope\Session::OPTION_AUTO_LASTMODIFIED => false, - 'jackalope.logger' => new \Jackalope\Transport\Logging\Psr3Logger(new \Psr\Log\NullLogger()), + Session::OPTION_AUTO_LASTMODIFIED => false, + 'jackalope.logger' => new Psr3Logger(new NullLogger()), ]; } public function getSessionWithLastModified() { - /** @var $session \Jackalope\Session */ + /** @var $session Session */ $session = $this->getSession(); - $session->setSessionOption(\Jackalope\Session::OPTION_AUTO_LASTMODIFIED, true); + $session->setSessionOption(Session::OPTION_AUTO_LASTMODIFIED, true); return $session; } public function getCredentials() { - return new \PHPCR\SimpleCredentials($GLOBALS['phpcr.user'], $GLOBALS['phpcr.pass']); + return new SimpleCredentials($GLOBALS['phpcr.user'], $GLOBALS['phpcr.pass']); } public function getInvalidCredentials() { - return new \PHPCR\SimpleCredentials('nonexistinguser', ''); + return new SimpleCredentials('nonexistinguser', ''); } public function getRestrictedCredentials() { - return new \PHPCR\SimpleCredentials('anonymous', 'abc'); + return new SimpleCredentials('anonymous', 'abc'); } public function prepareAnonymousLogin() @@ -154,8 +161,8 @@ public function getUserId() return $GLOBALS['phpcr.user']; } - public function getFixtureLoader() + public function getFixtureLoader(): JackrabbitFixtureLoader { - return new JackrabbitFixtureLoader(__DIR__.'/../vendor/phpcr/phpcr-api-tests/fixtures/', isset($GLOBALS['jackrabbit.jar']) ? $GLOBALS['jackrabbit.jar'] : null); + return new JackrabbitFixtureLoader(__DIR__.'/../vendor/phpcr/phpcr-api-tests/fixtures/', $GLOBALS['jackrabbit.jar'] ?? null); } } diff --git a/tests/Jackalope/Transport/Jackrabbit/PrefetchTest.php b/tests/Jackalope/Transport/Jackrabbit/PrefetchTest.php index 2260c71f..89e2f948 100644 --- a/tests/Jackalope/Transport/Jackrabbit/PrefetchTest.php +++ b/tests/Jackalope/Transport/Jackrabbit/PrefetchTest.php @@ -2,6 +2,7 @@ namespace Jackalope\Transport\Jackrabbit; +use Jackalope\Factory; use Jackalope\TestCase; /** @@ -53,7 +54,7 @@ public static function setUpBeforeClass(): void protected function getTransport(): Client { - $transport = new \Jackalope\Transport\Jackrabbit\Client(new \Jackalope\Factory(), $GLOBALS['jackrabbit.uri']); + $transport = new Client(new Factory(), $GLOBALS['jackrabbit.uri']); $transport->login(self::$loader->getCredentials(), self::$loader->getWorkspaceName()); return $transport; diff --git a/tests/JackrabbitFixtureLoader.php b/tests/JackrabbitFixtureLoader.php index 96d6f0e3..ddf289a6 100644 --- a/tests/JackrabbitFixtureLoader.php +++ b/tests/JackrabbitFixtureLoader.php @@ -1,5 +1,7 @@ * */ -class JackrabbitFixtureLoader implements \PHPCR\Test\FixtureLoaderInterface +class JackrabbitFixtureLoader implements FixtureLoaderInterface { protected $fixturePath; protected $jar;