Skip to content

Commit

Permalink
Merge pull request #184 from jackalope/cs
Browse files Browse the repository at this point in the history
adjust to newest php-cs-fixer
  • Loading branch information
dbu authored Feb 19, 2024
2 parents 04c223f + 7af6e4d commit 4a22a0b
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class QueryObjectModelFactory extends BaseQueryObjectModelFactory
{
public function createQuery(
SourceInterface $source,
ConstraintInterface $constraint = null,
?ConstraintInterface $constraint = null,
array $orderings = [],
array $columns = [],
$simpleQuery = false
Expand Down
2 changes: 1 addition & 1 deletion src/Jackalope/RepositoryFactoryJackrabbit.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class RepositoryFactoryJackrabbit implements RepositoryFactoryInterface
*
* @api
*/
public function getRepository(array $parameters = null)
public function getRepository(?array $parameters = null)
{
if (null === $parameters) {
throw new ConfigurationException('Jackalope-jackrabbit needs parameters');
Expand Down
2 changes: 1 addition & 1 deletion src/Jackalope/Tools/Console/Helper/JackrabbitHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class JackrabbitHelper
* @param string|null $workspace_dir if provided this will be used as workspace directory, otherwise the directory of the jar file is used
* @param int|null $port if provided this will be used as port for HTTP server, otherwise the default is used
*/
public function __construct(string $jackrabbit_jar, string $workspace_dir = null, int $port = null)
public function __construct(string $jackrabbit_jar, ?string $workspace_dir = null, ?int $port = null)
{
$this->jackrabbit_jar = $jackrabbit_jar;
$this->workspace_dir = $workspace_dir ?: dirname($jackrabbit_jar);
Expand Down
18 changes: 9 additions & 9 deletions src/Jackalope/Transport/Jackrabbit/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public function getWorkspaceUri(): ?string

// CoreInterface //

public function login(CredentialsInterface $credentials = null, string $workspaceName = null): string
public function login(?CredentialsInterface $credentials = null, ?string $workspaceName = null): string
{
if ($this->credentials) {
throw new RepositoryException(
Expand Down Expand Up @@ -519,7 +519,7 @@ public function getNodeByIdentifier(string $uuid): \stdClass
return $data;
}

public function getNodePathForIdentifier(string $uuid, string $workspace = null): string
public function getNodePathForIdentifier(string $uuid, ?string $workspace = null): string
{
if (null !== $workspace && $workspace !== $this->workspace) {
$client = new Client($this->factory, $this->server);
Expand Down Expand Up @@ -625,12 +625,12 @@ private function decodeBinaryDom(string $xml): array
return $ret;
}

public function getReferences(string $path, string $name = null): array
public function getReferences(string $path, ?string $name = null): array
{
return $this->getNodeReferences($path, $name);
}

public function getWeakReferences(string $path, string $name = null): array
public function getWeakReferences(string $path, ?string $name = null): array
{
return $this->getNodeReferences($path, $name, true);
}
Expand All @@ -642,7 +642,7 @@ public function getWeakReferences(string $path, string $name = null): array
*
* @return array list of paths to nodes that reference $path
*/
private function getNodeReferences(string $path, string $name = null, bool $weak_reference = false): array
private function getNodeReferences(string $path, ?string $name = null, bool $weak_reference = false): array
{
$path = $this->encodeAndValidatePathForDavex($path);
$identifier = $weak_reference ? 'weakreferences' : 'references';
Expand Down Expand Up @@ -967,7 +967,7 @@ private function deleteItem(string $path): void
$this->setJsopBody('-'.$path.' : ');
}

public function copyNode(string $srcAbsPath, string $destAbsPath, string $srcWorkspace = null): void
public function copyNode(string $srcAbsPath, string $destAbsPath, ?string $srcWorkspace = null): void
{
if ($srcWorkspace) {
$this->copyNodeOtherWorkspace($srcAbsPath, $destAbsPath, $srcWorkspace);
Expand Down Expand Up @@ -1422,7 +1422,7 @@ public function getPermissions($path): array
return $result;
}

public function lockNode(string $absPath, bool $isDeep, bool $isSessionScoped, int $timeoutHint = PHP_INT_MAX, string $ownerInfo = null): LockInterface
public function lockNode(string $absPath, bool $isDeep, bool $isSessionScoped, int $timeoutHint = PHP_INT_MAX, ?string $ownerInfo = null): LockInterface
{
$timeout = PHP_INT_MAX === $timeoutHint ? 'infinite' : $timeoutHint;
$ownerInfo = $ownerInfo ?? $this->credentials->getUserID();
Expand Down Expand Up @@ -1513,7 +1513,7 @@ public function getUserData(): ?string
return $this->userData;
}

public function createWorkspace(string $name, string $srcWorkspace = null): void
public function createWorkspace(string $name, ?string $srcWorkspace = null): void
{
if (null !== $srcWorkspace) {
// https://issues.apache.org/jira/browse/JCR-3144
Expand Down Expand Up @@ -1723,7 +1723,7 @@ protected function addWorkspacePathToUri(string $uri): string
* we created it in this request)
* @param string|null $path the owning node path, if we created this node
*/
private function generateLockFromDavResponse($response, bool $sessionOwning = false, string $path = null): LockInterface
private function generateLockFromDavResponse($response, bool $sessionOwning = false, ?string $path = null): LockInterface
{
$lock = new Lock();
$lockDom = $this->getRequiredDomElementByTagNameNS($response, self::NS_DAV, 'activelock', 'No lock received');
Expand Down
2 changes: 1 addition & 1 deletion src/Jackalope/Transport/Jackrabbit/EventBuffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ private function extractEventType(\DOMElement $event): int
*
* @throws RepositoryException
*/
private function getDomElement(\DOMElement $event, string $tagName, string $errorMessage = null): ?\DOMNode
private function getDomElement(\DOMElement $event, string $tagName, ?string $errorMessage = null): ?\DOMNode
{
$list = $event->getElementsByTagName($tagName);

Expand Down
4 changes: 2 additions & 2 deletions src/Jackalope/Transport/Jackrabbit/LoggingClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function getPermissions(string $path): array

// LockingInterface //

public function lockNode(string $absPath, bool $isDeep, bool $isSessionScoped, int $timeoutHint = PHP_INT_MAX, string $ownerInfo = null): LockInterface
public function lockNode(string $absPath, bool $isDeep, bool $isSessionScoped, int $timeoutHint = PHP_INT_MAX, ?string $ownerInfo = null): LockInterface
{
return $this->transport->lockNode($absPath, $isDeep, $isSessionScoped, $timeoutHint, $ownerInfo);
}
Expand Down Expand Up @@ -142,7 +142,7 @@ public function getUserData(): ?string

// WorkspaceManagementInterface //

public function createWorkspace(string $name, string $srcWorkspace = null): void
public function createWorkspace(string $name, ?string $srcWorkspace = null): void
{
$this->transport->createWorkspace($name, $srcWorkspace);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Jackalope/Transport/Jackrabbit/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public function addCurlOptions(array $options): void
* Set the credentials for the request. Setting them to null will make a
* request without authentication header.
*/
public function setCredentials(CredentialsInterface $creds = null): void
public function setCredentials(?CredentialsInterface $creds = null): void
{
$this->credentials = $creds;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Jackalope/Transport/Jackrabbit/curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class curl
*
* @see curl_init
*/
public function __construct(string $url = null)
public function __construct(?string $url = null)
{
$this->curl = curl_init($url);
$this->setopt(CURLINFO_HEADER_OUT, true);
Expand Down Expand Up @@ -105,7 +105,7 @@ public function errno(): int
*
* @see curl_getinfo
*/
public function getinfo(int $option = null)
public function getinfo(?int $option = null)
{
if (null === $option) {
return curl_getinfo($this->curl);
Expand Down
4 changes: 2 additions & 2 deletions tests/Jackalope/Transport/Jackrabbit/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class RequestTest extends JackrabbitTestCase
{
protected function getCurlFixture(string $fixture = null, int $httpCode = 200, int $errno = null): curl
protected function getCurlFixture(?string $fixture = null, int $httpCode = 200, ?int $errno = null): curl
{
$curl = $this->createMock(curl::class);

Expand Down Expand Up @@ -41,7 +41,7 @@ public function getClientMock()
return $this->createMock(Client::class);
}

public function getRequest(string $fixture = null, int $httpCode = 200, int $errno = null)
public function getRequest(?string $fixture = null, int $httpCode = 200, ?int $errno = null)
{
$factory = new Factory();

Expand Down

0 comments on commit 4a22a0b

Please sign in to comment.