Issues (20)

src/Base/Filesystem/FlyAzure.php (2 issues)

Checks if used types are declared or listed as dependencies.

Bug Major
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2015-2024
6
 * @package Base
7
 * @subpackage Filesystem
8
 */
9
10
11
namespace Aimeos\Base\Filesystem;
12
13
use MicrosoftAzure\Storage\Blob\BlobRestProxy;
0 ignored issues
show
The type MicrosoftAzure\Storage\Blob\BlobRestProxy was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
use League\Flysystem\AzureBlobStorage\AzureBlobStorageAdapter;
0 ignored issues
show
The type League\Flysystem\AzureBl...AzureBlobStorageAdapter was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
use League\Flysystem\Filesystem;
16
17
18
/**
19
 * Implementation of Flysystem Azure file system adapter
20
 *
21
 * @package Base
22
 * @subpackage Filesystem
23
 */
24
class FlyAzure extends FlyBase implements Iface, DirIface, MetaIface
25
{
26
	private ?Filesystem $fs = null;
27
28
29
	/**
30
	 * Returns the file system provider
31
	 *
32
	 * @return \League\Flysystem\Filesystem File system provider
33
	 */
34
	protected function getProvider()
35
	{
36
		if( !isset( $this->fs ) )
37
		{
38
			$config = $this->getConfig();
39
40
			if( !isset( $config['endpoint'] ) ) {
41
				throw new Exception( sprintf( 'Configuration option "%1$s" missing', 'endpoint' ) );
42
			}
43
44
			if( !isset( $config['container'] ) ) {
45
				throw new Exception( sprintf( 'Configuration option "%1$s" missing', 'container' ) );
46
			}
47
48
			$service = BlobRestProxy::createBlobService( $config['endpoint'] );
49
			$adapter = new AzureBlobStorageAdapter( $service, $config['container'], $config['prefix'] ?? '' );
50
			$this->fs = new Filesystem( $adapter );
51
		}
52
53
		return $this->fs;
54
	}
55
}
56