Skip to content

Commit

Permalink
fix most recent cs fixer rule changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Feb 26, 2024
1 parent cd6aa7e commit ce8d5dc
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ abstract class AbstractLoaderFactory implements LoaderFactoryInterface
{
protected static string $namePrefix = 'liip_imagine.binary.loader';

final protected function getChildLoaderDefinition(string $name = null): ChildDefinition
final protected function getChildLoaderDefinition(?string $name = null): ChildDefinition
{
return new ChildDefinition(sprintf('%s.prototype.%s', static::$namePrefix, $name ?: $this->getName()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ abstract class AbstractResolverFactory implements ResolverFactoryInterface
{
protected static string $namePrefix = 'liip_imagine.cache.resolver';

final protected function getChildResolverDefinition(string $name = null): ChildDefinition
final protected function getChildResolverDefinition(?string $name = null): ChildDefinition
{
return new ChildDefinition(sprintf('%s.prototype.%s', static::$namePrefix, $name ?: $this->getName()));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Events/CacheResolveEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CacheResolveEvent extends Event
/**
* Init default event state.
*/
public function __construct(string $path, string $filter, string $url = null)
public function __construct(string $path, string $filter, ?string $url = null)
{
$this->path = $path;
$this->filter = $filter;
Expand Down
2 changes: 1 addition & 1 deletion src/Factory/Config/Filter/Argument/PointFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
final class PointFactory
{
public function create(int $x = null, int $y = null): Point
public function create(?int $x = null, ?int $y = null): Point
{
return new Point($x, $y);
}
Expand Down
12 changes: 6 additions & 6 deletions src/Imagine/Cache/CacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct(
RouterInterface $router,
SignerInterface $signer,
EventDispatcherInterface $dispatcher,
string $defaultResolver = null,
?string $defaultResolver = null,
bool $webpGenerate = false
) {
$this->filterConfig = $filterConfig;
Expand Down Expand Up @@ -77,7 +77,7 @@ public function addResolver(string $filter, ResolverInterface $resolver): void
*
* @param string $path The path where the resolved file is expected
*/
public function getBrowserPath(string $path, string $filter, array $runtimeConfig = [], string $resolver = null, int $referenceType = UrlGeneratorInterface::ABSOLUTE_URL): string
public function getBrowserPath(string $path, string $filter, array $runtimeConfig = [], ?string $resolver = null, int $referenceType = UrlGeneratorInterface::ABSOLUTE_URL): string
{
if (!empty($runtimeConfig)) {
$rcPath = $this->getRuntimePath($path, $runtimeConfig);
Expand Down Expand Up @@ -109,7 +109,7 @@ public function getRuntimePath(string $path, array $runtimeConfig): string
* @param string $filter The name of the imagine filter in effect
* @param int $referenceType The type of reference to be generated (one of the UrlGenerator constants)
*/
public function generateUrl(string $path, string $filter, array $runtimeConfig = [], string $resolver = null, int $referenceType = UrlGeneratorInterface::ABSOLUTE_URL): string
public function generateUrl(string $path, string $filter, array $runtimeConfig = [], ?string $resolver = null, int $referenceType = UrlGeneratorInterface::ABSOLUTE_URL): string
{
$params = [
'path' => ltrim($path, '/'),
Expand All @@ -135,7 +135,7 @@ public function generateUrl(string $path, string $filter, array $runtimeConfig =
/**
* Checks whether the path is already stored within the respective Resolver.
*/
public function isStored(string $path, string $filter, string $resolver = null): bool
public function isStored(string $path, string $filter, ?string $resolver = null): bool
{
return $this->getResolver($filter, $resolver)->isStored($path, $filter);
}
Expand All @@ -147,7 +147,7 @@ public function isStored(string $path, string $filter, string $resolver = null):
*
* @return string The url of resolved image
*/
public function resolve(string $path, string $filter, string $resolver = null): string
public function resolve(string $path, string $filter, ?string $resolver = null): string
{
if (false !== mb_strpos($path, '/../') || 0 === mb_strpos($path, '../')) {
throw new NotFoundHttpException(sprintf("Source image was searched with '%s' outside of the defined root path", $path));
Expand All @@ -167,7 +167,7 @@ public function resolve(string $path, string $filter, string $resolver = null):
/**
* @see ResolverInterface::store
*/
public function store(BinaryInterface $binary, string $path, string $filter, string $resolver = null): void
public function store(BinaryInterface $binary, string $path, string $filter, ?string $resolver = null): void
{
$this->getResolver($filter, $resolver)->store($binary, $path, $filter);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Imagine/Data/DataManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public function __construct(
MimeTypeGuesserInterface $mimeTypeGuesser,
MimeTypesInterface $extensionGuesser,
FilterConfiguration $filterConfig,
string $defaultLoader = null,
string $globalDefaultImage = null
?string $defaultLoader = null,
?string $globalDefaultImage = null
) {
$this->mimeTypeGuesser = $mimeTypeGuesser;
$this->filterConfig = $filterConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class JpegOptimPostProcessor extends AbstractPostProcessor
* @param bool $progressive Force output to be progressive
* @param string|null $temporaryRootPath Directory where temporary file will be written
*/
public function __construct(string $executablePath = '/usr/bin/jpegoptim', bool $strip = true, int $quality = null, bool $progressive = true, string $temporaryRootPath = null)
public function __construct(string $executablePath = '/usr/bin/jpegoptim', bool $strip = true, ?int $quality = null, bool $progressive = true, ?string $temporaryRootPath = null)
{
parent::__construct($executablePath, $temporaryRootPath);

Expand Down
2 changes: 1 addition & 1 deletion src/Imagine/Filter/PostProcessor/MozJpegPostProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MozJpegPostProcessor extends AbstractPostProcessor
* @param string $executablePath Path to the mozjpeg cjpeg binary
* @param int|null $quality Quality factor
*/
public function __construct(string $executablePath = '/opt/mozjpeg/bin/cjpeg', int $quality = null)
public function __construct(string $executablePath = '/opt/mozjpeg/bin/cjpeg', ?int $quality = null)
{
parent::__construct($executablePath);

Expand Down
2 changes: 1 addition & 1 deletion src/Imagine/Filter/PostProcessor/OptiPngPostProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class OptiPngPostProcessor extends AbstractPostProcessor
* @param bool $strip Strip metadata objects
* @param string|null $temporaryRootPath Directory where temporary file will be written
*/
public function __construct(string $executablePath = '/usr/bin/optipng', int $level = 7, bool $strip = true, string $temporaryRootPath = null)
public function __construct(string $executablePath = '/usr/bin/optipng', int $level = 7, bool $strip = true, ?string $temporaryRootPath = null)
{
parent::__construct($executablePath, $temporaryRootPath);

Expand Down
2 changes: 1 addition & 1 deletion src/Model/Binary.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Binary implements BinaryInterface

protected ?string $format;

public function __construct(string $content, ?string $mimeType, string $format = null)
public function __construct(string $content, ?string $mimeType, ?string $format = null)
{
$this->content = $content;
$this->mimeType = $mimeType;
Expand Down
2 changes: 1 addition & 1 deletion src/Model/FileBinary.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class FileBinary implements FileBinaryInterface

protected ?string $format;

public function __construct(string $path, ?string $mimeType, string $format = null)
public function __construct(string $path, ?string $mimeType, ?string $format = null)
{
$this->path = $path;
$this->mimeType = $mimeType;
Expand Down
4 changes: 2 additions & 2 deletions src/Service/FilterService.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function warmUpCache(
return $warmedUp;
}

public function getUrlOfFilteredImage(string $path, string $filter, string $resolver = null, bool $webpSupported = false): string
public function getUrlOfFilteredImage(string $path, string $filter, ?string $resolver = null, bool $webpSupported = false): string
{
foreach ($this->buildFilterPathContainers($path) as $filterPathContainer) {
$this->warmUpCacheFilterPathContainer($filterPathContainer, $filter, $resolver);
Expand All @@ -105,7 +105,7 @@ public function getUrlOfFilteredImageWithRuntimeFilters(
string $path,
string $filter,
array $runtimeFilters = [],
string $resolver = null,
?string $resolver = null,
bool $webpSupported = false
): string {
$runtimePath = $this->cacheManager->getRuntimePath($path, $runtimeFilters);
Expand Down

0 comments on commit ce8d5dc

Please sign in to comment.