bankiru /
doctrine-api-client
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Bankiru\Api\Doctrine; |
||
| 4 | |||
| 5 | use Bankiru\Api\Doctrine\Cache\CacheConfiguration; |
||
| 6 | use Bankiru\Api\Doctrine\Type\TypeRegistryInterface; |
||
| 7 | use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver; |
||
| 8 | use Psr\Cache\CacheItemPoolInterface; |
||
| 9 | use Psr\Log\LoggerInterface; |
||
| 10 | use Psr\Log\NullLogger; |
||
| 11 | |||
| 12 | class Configuration |
||
| 13 | { |
||
| 14 | /** @var EntityMetadataFactory */ |
||
| 15 | private $metadataFactory; |
||
| 16 | /** @var MappingDriver */ |
||
| 17 | private $driver; |
||
| 18 | /** @var ClientRegistryInterface */ |
||
| 19 | private $registry; |
||
| 20 | /** @var ApiFactoryResolverInterface */ |
||
| 21 | private $resolver; |
||
| 22 | /** @var string */ |
||
| 23 | private $proxyDir; |
||
| 24 | /** @var string */ |
||
| 25 | private $proxyNamespace; |
||
| 26 | /** @var bool */ |
||
| 27 | private $autogenerateProxies = true; |
||
| 28 | /** @var TypeRegistryInterface */ |
||
| 29 | private $typeRegistry; |
||
| 30 | /** @var array */ |
||
| 31 | private $cacheConfiguration = []; |
||
| 32 | /** @var CacheItemPoolInterface */ |
||
| 33 | private $apiCache; |
||
| 34 | /** @var LoggerInterface */ |
||
| 35 | private $apiCacheLogger; |
||
| 36 | /** @var CacheConfiguration[] */ |
||
| 37 | private $cacheConfigurationCache = []; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Configuration constructor. |
||
| 41 | */ |
||
| 42 | 18 | public function __construct() |
|
| 43 | { |
||
| 44 | 18 | $this->apiCacheLogger = new NullLogger(); |
|
| 45 | 18 | } |
|
| 46 | |||
| 47 | /** |
||
| 48 | * @return ClientRegistryInterface |
||
| 49 | */ |
||
| 50 | 18 | public function getRegistry() |
|
| 51 | { |
||
| 52 | 18 | return $this->registry; |
|
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @param ClientRegistryInterface $registry |
||
| 57 | */ |
||
| 58 | 18 | public function setRegistry($registry) |
|
| 59 | { |
||
| 60 | 18 | $this->registry = $registry; |
|
| 61 | 18 | } |
|
| 62 | |||
| 63 | /** |
||
| 64 | * @return ApiFactoryResolverInterface |
||
| 65 | */ |
||
| 66 | 17 | public function getResolver() |
|
| 67 | { |
||
| 68 | 17 | return $this->resolver; |
|
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @param ApiFactoryResolverInterface $resolver |
||
| 73 | */ |
||
| 74 | 18 | public function setResolver(ApiFactoryResolverInterface $resolver) |
|
| 75 | { |
||
| 76 | 18 | $this->resolver = $resolver; |
|
| 77 | 18 | } |
|
| 78 | |||
| 79 | /** |
||
| 80 | * @return LoggerInterface |
||
| 81 | */ |
||
| 82 | 1 | public function getApiCacheLogger() |
|
| 83 | { |
||
| 84 | 1 | return $this->apiCacheLogger; |
|
| 85 | } |
||
| 86 | |||
| 87 | /** |
||
| 88 | * @param LoggerInterface $apiCacheLogger |
||
| 89 | */ |
||
| 90 | 1 | public function setApiCacheLogger($apiCacheLogger) |
|
| 91 | { |
||
| 92 | 1 | $this->apiCacheLogger = $apiCacheLogger; |
|
| 93 | 1 | } |
|
| 94 | |||
| 95 | /** |
||
| 96 | * @return CacheItemPoolInterface |
||
| 97 | */ |
||
| 98 | 1 | public function getApiCache() |
|
| 99 | { |
||
| 100 | 1 | return $this->apiCache; |
|
| 101 | } |
||
| 102 | |||
| 103 | /** |
||
| 104 | * @param CacheItemPoolInterface|null $apiCache |
||
| 105 | */ |
||
| 106 | 1 | public function setApiCache(CacheItemPoolInterface $apiCache = null) |
|
| 107 | { |
||
| 108 | 1 | $this->apiCache = $apiCache; |
|
| 109 | 1 | } |
|
| 110 | |||
| 111 | /** |
||
| 112 | * Returns class cache configuration |
||
| 113 | * |
||
| 114 | * @param $class |
||
| 115 | * |
||
| 116 | * @return CacheConfiguration |
||
| 117 | */ |
||
| 118 | 17 | public function getCacheConfiguration($class) |
|
| 119 | { |
||
| 120 | 17 | if (!array_key_exists($class, $this->cacheConfiguration)) { |
|
| 121 | 16 | return CacheConfiguration::disabled(); |
|
| 122 | } |
||
| 123 | |||
| 124 | 1 | if (!array_key_exists($class, $this->cacheConfigurationCache)) { |
|
| 125 | |||
| 126 | 1 | $this->cacheConfigurationCache[$class] = CacheConfiguration::create($this->cacheConfiguration[$class]); |
|
| 127 | 1 | } |
|
| 128 | |||
| 129 | 1 | return $this->cacheConfigurationCache[$class]; |
|
| 130 | } |
||
| 131 | |||
| 132 | /** |
||
| 133 | * @param string $class |
||
| 134 | * @param array $options |
||
| 135 | */ |
||
| 136 | 1 | public function setCacheConfiguration($class, array $options = null) |
|
| 137 | { |
||
| 138 | 1 | $this->cacheConfiguration[$class] = $options; |
|
| 139 | |||
| 140 | 1 | if (null === $this->cacheConfiguration[$class]) { |
|
| 141 | unset($this->cacheConfiguration[$class]); |
||
| 142 | } |
||
| 143 | 1 | } |
|
| 144 | |||
| 145 | /** |
||
| 146 | * @return TypeRegistryInterface |
||
| 147 | */ |
||
| 148 | 17 | public function getTypeRegistry() |
|
| 149 | { |
||
| 150 | 17 | return $this->typeRegistry; |
|
| 151 | } |
||
| 152 | |||
| 153 | /** |
||
| 154 | * @param TypeRegistryInterface $typeRegistry |
||
| 155 | */ |
||
| 156 | 18 | public function setTypeRegistry(TypeRegistryInterface $typeRegistry) |
|
| 157 | { |
||
| 158 | 18 | $this->typeRegistry = $typeRegistry; |
|
| 159 | 18 | } |
|
| 160 | |||
| 161 | /** |
||
| 162 | * @return string |
||
| 163 | */ |
||
| 164 | 18 | public function getProxyDir() |
|
| 165 | { |
||
| 166 | 18 | return $this->proxyDir; |
|
| 167 | } |
||
| 168 | |||
| 169 | /** |
||
| 170 | * @param string $proxyDir |
||
| 171 | */ |
||
| 172 | 18 | public function setProxyDir($proxyDir) |
|
| 173 | { |
||
| 174 | 18 | $this->proxyDir = $proxyDir; |
|
| 175 | 18 | } |
|
| 176 | |||
| 177 | /** |
||
| 178 | * @return string |
||
| 179 | */ |
||
| 180 | 18 | public function getProxyNamespace() |
|
| 181 | { |
||
| 182 | 18 | return $this->proxyNamespace; |
|
| 183 | } |
||
| 184 | |||
| 185 | /** |
||
| 186 | * @param string $proxyNamespace |
||
| 187 | */ |
||
| 188 | 18 | public function setProxyNamespace($proxyNamespace) |
|
| 189 | { |
||
| 190 | 18 | $this->proxyNamespace = $proxyNamespace; |
|
| 191 | 18 | } |
|
| 192 | |||
| 193 | /** |
||
| 194 | * @return boolean |
||
| 195 | */ |
||
| 196 | 18 | public function isAutogenerateProxies() |
|
| 197 | { |
||
| 198 | 18 | return $this->autogenerateProxies; |
|
| 199 | } |
||
| 200 | |||
| 201 | /** |
||
| 202 | * @param boolean $autogenerateProxies |
||
| 203 | */ |
||
| 204 | public function setAutogenerateProxies($autogenerateProxies) |
||
| 205 | { |
||
| 206 | $this->autogenerateProxies = $autogenerateProxies; |
||
| 207 | } |
||
| 208 | |||
| 209 | /** |
||
| 210 | * @return MappingDriver |
||
| 211 | */ |
||
| 212 | 18 | public function getDriver() |
|
| 213 | { |
||
| 214 | 18 | return $this->driver; |
|
| 215 | } |
||
| 216 | |||
| 217 | /** |
||
| 218 | * @param MappingDriver $driver |
||
| 219 | */ |
||
| 220 | 18 | public function setDriver($driver) |
|
| 221 | { |
||
| 222 | 18 | $this->driver = $driver; |
|
| 223 | 18 | } |
|
| 224 | |||
| 225 | /** |
||
| 226 | * @return EntityMetadataFactory |
||
| 227 | */ |
||
| 228 | 18 | public function getMetadataFactory() |
|
| 229 | { |
||
| 230 | 18 | return $this->metadataFactory; |
|
| 231 | } |
||
| 232 | |||
| 233 | /** |
||
| 234 | * @param string $metadataFactory |
||
| 235 | */ |
||
| 236 | 18 | public function setMetadataFactory($metadataFactory) |
|
| 237 | { |
||
| 238 | 18 | $this->metadataFactory = $metadataFactory; |
|
|
0 ignored issues
–
show
|
|||
| 239 | 18 | } |
|
| 240 | } |
||
| 241 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..