Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #30 from flagbit/hotfix/FLAGBIT-5088
Browse files Browse the repository at this point in the history
[FLAGBIT-5088] Remove nullable parameter and return type definitions
  • Loading branch information
Björn Meyer authored Mar 4, 2019
2 parents 8f7c87d + b03ff32 commit 4fcd01e
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 56 deletions.
8 changes: 4 additions & 4 deletions Adapter/AdapterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function has(string $path): bool;
* @param array $config
* @return bool
*/
public function write(string $path, string $contents, array $config = []): bool;
public function write(string $path, $contents, array $config = []): bool;

/**
* @param string $path
Expand All @@ -35,7 +35,7 @@ public function writeStream(string $path, $resource, array $config = []): bool;
* @param array $config
* @return bool
*/
public function put(string $path, string $contents, array $config = []): bool;
public function put(string $path, $contents, array $config = []): bool;

/**
* @param string $path
Expand All @@ -57,7 +57,7 @@ public function readAndDelete(string $path);
* @param array $config
* @return bool
*/
public function update(string $path, string $contents, array $config = []): bool;
public function update(string $path, $contents, array $config = []): bool;

/**
* @param string $path
Expand Down Expand Up @@ -117,7 +117,7 @@ public function createDir(string $dirname, array $config = []): bool;
* @param bool $recursive
* @return array|null
*/
public function listContents(string $directory = '', bool $recursive = false): ?array;
public function listContents(string $directory = '', bool $recursive = false);

/**
* @param string $path
Expand Down
8 changes: 4 additions & 4 deletions Adapter/FilesystemAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function has(string $path): bool
* @return bool
* @throws \League\Flysystem\FileExistsException
*/
public function write(string $path, ?string $contents, array $config = []): bool
public function write(string $path, $contents, array $config = []): bool
{
return $this->filesystem->write($path, $contents, $config);
}
Expand All @@ -62,7 +62,7 @@ public function writeStream(string $path, $resource, array $config = []): bool
* @param array $config
* @return bool
*/
public function put(string $path, ?string $contents, array $config = []): bool
public function put(string $path, $contents, array $config = []): bool
{
return $this->filesystem->put($path, $contents, $config);
}
Expand Down Expand Up @@ -95,7 +95,7 @@ public function readAndDelete(string $path)
* @return bool
* @throws \League\Flysystem\FileNotFoundException
*/
public function update(string $path, ?string $contents, array $config = []): bool
public function update(string $path, $contents, array $config = []): bool
{
return $this->filesystem->update($path, $contents, $config);
}
Expand Down Expand Up @@ -190,7 +190,7 @@ public function createDir(string $dirname, array $config = []): bool
* @param bool $recursive
* @return array|null
*/
public function listContents(string $directory = '', bool $recursive = false): ?array
public function listContents(string $directory = '', bool $recursive = false)
{
return $this->filesystem->listContents($directory, $recursive);
}
Expand Down
6 changes: 3 additions & 3 deletions Block/Adminhtml/Filesystem/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ protected function _construct()
/**
* @return string|null
*/
public function getFilebrowserSetupObject(): ?string
public function getFilebrowserSetupObject()
{
$setupObject = [
'newFolderPrompt' => __('New Folder Name:'),
Expand Down Expand Up @@ -186,15 +186,15 @@ public function getWysiwygModalUrl(): string
/**
* @return string|null
*/
public function getTargetElementId(): ?string
public function getTargetElementId()
{
return (string)$this->getRequest()->getParam('target_element_id');
}

/**
* @return string|null
*/
public function getModalIdentifier(): ?string
public function getModalIdentifier()
{
return (string)$this->getRequest()->getParam('identifier');
}
Expand Down
4 changes: 2 additions & 2 deletions Block/Adminhtml/Filesystem/Content/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function getFilesCount(): int
* @param array $file
* @return string|null
*/
public function getFileId(array $file): ?string
public function getFileId(array $file)
{
if(!isset($file['path'])) {
return null;
Expand All @@ -158,7 +158,7 @@ public function getFileId(array $file): ?string
* @param array $file
* @return string|null
*/
public function getFileShortName(array $file): ?string {
public function getFileShortName(array $file) {
if(!isset($file['path'])) {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion Block/Adminhtml/Filesystem/Content/Uploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function _construct()
/**
* @return string|null
*/
protected function _getMediaType(): ?string
protected function _getMediaType()
{
if ($this->hasData('media_type')) {
return $this->_getData('media_type');
Expand Down
4 changes: 2 additions & 2 deletions Block/Adminhtml/Filesystem/Tree.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct(
* @return string|null
* @throws \Exception
*/
public function getTreeJson(): ?string
public function getTreeJson()
{
$jsonArray = [];

Expand Down Expand Up @@ -125,7 +125,7 @@ public function getTreeCurrentPath(): array
/**
* @return string|null
*/
public function getTreeWidgetOptions(): ?string
public function getTreeWidgetOptions()
{
$serialized = $this->_serializer->serialize([
"folderTree" => [
Expand Down
26 changes: 13 additions & 13 deletions Helper/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function __construct(
/**
* @return string|null
*/
public function getSource(): ?string
public function getSource()
{
return $this->_scopeConfig->getValue(self::XPATH_CONFIG_GENERAL_SOURCE);
}
Expand All @@ -85,7 +85,7 @@ public function getFileComparingEnabled(): bool
/**
* @return string|null
*/
public function getLocalPath(): ?string
public function getLocalPath()
{
return $this->_scopeConfig->getValue(self::XPATH_CONFIG_LOCAL_PATH);
}
Expand All @@ -101,23 +101,23 @@ public function getLocalLock(): int
/**
* @return string|null
*/
public function getFtpHost(): ?string
public function getFtpHost()
{
return $this->_scopeConfig->getValue(self::XPATH_CONFIG_FTP_HOST);
}

/**
* @return string|null
*/
public function getFtpUser(): ?string
public function getFtpUser()
{
return $this->_scopeConfig->getValue(self::XPATH_CONFIG_FTP_USER);
}

/**
* @return string|null
*/
public function getFtpPassword(): ?string
public function getFtpPassword()
{
return $this->_scopeConfig->getValue(self::XPATH_CONFIG_FTP_PASSWORD);
}
Expand All @@ -133,7 +133,7 @@ public function getFtpPort(): int
/**
* @return string|null
*/
public function getFtpPath(): ?string
public function getFtpPath()
{
return $this->_scopeConfig->getValue(self::XPATH_CONFIG_FTP_PATH);
}
Expand Down Expand Up @@ -165,7 +165,7 @@ public function getFtpTimeout(): int
/**
* @return string|null
*/
public function getSftpHost(): ?string
public function getSftpHost()
{
return $this->_scopeConfig->getValue(self::XPATH_CONFIG_SFTP_HOST);
}
Expand All @@ -181,39 +181,39 @@ public function getSftpPort(): int
/**
* @return string|null
*/
public function getSftpUsername(): ?string
public function getSftpUsername()
{
return $this->_scopeConfig->getValue(self::XPATH_CONFIG_SFTP_USERNAME);
}

/**
* @return string|null
*/
public function getSftpPassword(): ?string
public function getSftpPassword()
{
return $this->_scopeConfig->getValue(self::XPATH_CONFIG_SFTP_PASSWORD);
}

/**
* @return string|null
*/
public function getSftpPrivateKeyPath(): ?string
public function getSftpPrivateKeyPath()
{
return $this->_scopeConfig->getValue(self::XPATH_CONFIG_SFTP_PRIVATE_KEY_PATH);
}

/**
* @return string|null
*/
public function getSftpPrivateKeyContent(): ?string
public function getSftpPrivateKeyContent()
{
return $this->_scopeConfig->getValue(self::XPATH_CONFIG_SFTP_PRIVATE_KEY_CONTENT);
}

/**
* @return string|null
*/
public function getSftpRoot(): ?string
public function getSftpRoot()
{
return $this->_scopeConfig->getValue(self::XPATH_CONFIG_SFTP_ROOT);
}
Expand All @@ -229,7 +229,7 @@ public function getSftpTimeout(): int
/**
* @return int|null
*/
public function getSftpDirectoryPermissions(): ?int
public function getSftpDirectoryPermissions()
{
$directoryPermissions = $this->_scopeConfig->getValue(self::XPATH_CONFIG_SFTP_DIRECTORY_PERMISSIONS);

Expand Down
20 changes: 10 additions & 10 deletions Model/Filesystem/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function __construct(
* @return FilesystemAdapter|null
* @throws LocalizedException
*/
public function create(?string $source = null): ?FilesystemAdapter
public function create($source = null)
{
if (!$source) {
$source = $this->_flysystemConfig->getSource();
Expand Down Expand Up @@ -120,7 +120,7 @@ public function create(?string $source = null): ?FilesystemAdapter
* @return FilesystemAdapter|null
* @throws LocalizedException
*/
public function getAdapter(bool $createIfNotExists = true): ?FilesystemAdapter
public function getAdapter(bool $createIfNotExists = true)
{
if (!$this->_adapter && $createIfNotExists) {
$this->create();
Expand All @@ -136,23 +136,23 @@ public function getAdapter(bool $createIfNotExists = true): ?FilesystemAdapter
* @param FilesystemAdapter|null $adapter
* @return void
*/
public function setAdapter(?FilesystemAdapter $adapter)
public function setAdapter($adapter)
{
$this->_adapter = $adapter;
}

/**
* @return string|null
*/
public function getPath(): ?string
public function getPath()
{
return $this->_path;
}

/**
* @param string|null $path
*/
public function setPath(?string $path)
public function setPath($path)
{
$this->_path = $path;
}
Expand All @@ -161,7 +161,7 @@ public function setPath(?string $path)
* @param string|null $path
* @return FilesystemAdapter|null
*/
public function createLocalAdapter(?string $path = null): ?FilesystemAdapter
public function createLocalAdapter($path = null)
{
try {
if (empty($path)) {
Expand All @@ -183,7 +183,7 @@ public function createLocalAdapter(?string $path = null): ?FilesystemAdapter
/**
* @return FilesystemAdapter|null
*/
protected function createFtpAdapter(): ?FilesystemAdapter
protected function createFtpAdapter()
{
try {
$host = $this->_flysystemConfig->getFtpHost();
Expand Down Expand Up @@ -219,7 +219,7 @@ protected function createFtpAdapter(): ?FilesystemAdapter
/**
* @return FilesystemAdapter|null
*/
protected function createSftpAdapter(): ?FilesystemAdapter
protected function createSftpAdapter()
{
try {
$host = $this->_flysystemConfig->getSftpHost();
Expand Down Expand Up @@ -284,15 +284,15 @@ public function getSession(): Session
* @param string|null $identifier
* @return Session
*/
public function setModalIdentifier(?string $identifier): Session
public function setModalIdentifier($identifier): Session
{
return $this->getSession()->setFlysystemModalId($identifier);
}

/**
* @return string|null
*/
public function getModalIdentifier(): ?string
public function getModalIdentifier()
{
return $this->getSession()->getFlysystemModalId();
}
Expand Down
Loading

0 comments on commit 4fcd01e

Please sign in to comment.