Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Jun 6, 2024
1 parent 6814430 commit 0886127
Show file tree
Hide file tree
Showing 25 changed files with 12 additions and 159 deletions.
3 changes: 0 additions & 3 deletions Admin/RedirectAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,6 @@ public function configureViews(ViewCollection $viewCollection): void
);
}

/**
* {@inheritdoc}
*/
public function getSecurityContexts()
{
return [
Expand Down
6 changes: 0 additions & 6 deletions Command/ImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ public function __construct(FileImport $import)
$this->import = $import;
}

/**
* {@inheritdoc}
*/
public function configure(): void
{
$this->addArgument('fileName', InputArgument::REQUIRED)
Expand All @@ -49,9 +46,6 @@ public function configure(): void
);
}

/**
* {@inheritdoc}
*/
public function execute(InputInterface $input, OutputInterface $output)
{
$progressBar = new ProgressBar($output);
Expand Down
6 changes: 0 additions & 6 deletions Controller/RedirectRouteImportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,11 @@ public function __construct(FileImportInterface $import, $importPath)
$this->importPath = $importPath;
}

/**
* {@inheritdoc}
*/
public function getSecurityContext(): string
{
return RedirectAdmin::SECURITY_CONTEXT;
}

/**
* {@inheritdoc}
*/
public function getLocale(Request $request)
{
return $request->get('locale', null);
Expand Down
3 changes: 0 additions & 3 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('sulu_redirect');
Expand Down
6 changes: 0 additions & 6 deletions DependencyInjection/SuluRedirectExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ class SuluRedirectExtension extends Extension implements PrependExtensionInterfa
{
use PersistenceExtensionTrait;

/**
* {@inheritdoc}
*/
public function prepend(ContainerBuilder $container): void
{
if ($container->hasExtension('jms_serializer')) {
Expand Down Expand Up @@ -91,9 +88,6 @@ public function prepend(ContainerBuilder $container): void
}
}

/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container): void
{
$configuration = new Configuration();
Expand Down
36 changes: 0 additions & 36 deletions Entity/RedirectRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,107 +52,71 @@ class RedirectRoute implements RedirectRouteInterface, AuditableInterface
*/
protected $target;

/**
* {@inheritdoc}
*/
public function getId()
{
return $this->id;
}

/**
* {@inheritdoc}
*/
public function setId($id)
{
$this->id = $id;

return $this;
}

/**
* {@inheritdoc}
*/
public function isEnabled()
{
return $this->enabled;
}

/**
* {@inheritdoc}
*/
public function setEnabled($enabled)
{
$this->enabled = $enabled;

return $this;
}

/**
* {@inheritdoc}
*/
public function getStatusCode()
{
return $this->statusCode;
}

/**
* {@inheritdoc}
*/
public function setStatusCode($statusCode)
{
$this->statusCode = $statusCode;

return $this;
}

/**
* {@inheritdoc}
*/
public function getSource()
{
return $this->source;
}

/**
* {@inheritdoc}
*/
public function setSource($source)
{
$this->source = mb_strtolower('/' . ltrim($source, '/'));

return $this;
}

/**
* {@inheritdoc}
*/
public function getSourceHost()
{
return $this->sourceHost;
}

/**
* {@inheritdoc}
*/
public function setSourceHost($sourceHost)
{
$this->sourceHost = empty($sourceHost) ? null : mb_strtolower($sourceHost);

return $this;
}

/**
* {@inheritdoc}
*/
public function getTarget()
{
return $this->target;
}

/**
* {@inheritdoc}
*/
public function setTarget($target)
{
$this->target = $target;
Expand Down
15 changes: 0 additions & 15 deletions Entity/RedirectRouteRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
*/
class RedirectRouteRepository extends EntityRepository implements RedirectRouteRepositoryInterface
{
/**
* {@inheritdoc}
*/
public function findById($id)
{
/** @var RedirectRouteInterface|null $redirectRoute */
Expand All @@ -32,9 +29,6 @@ public function findById($id)
return $redirectRoute;
}

/**
* {@inheritdoc}
*/
public function findEnabledBySource($source, $sourceHost = null)
{
$queryBuilder = $this->createFindBySourceQueryBuilder($source, $sourceHost);
Expand All @@ -43,27 +37,18 @@ public function findEnabledBySource($source, $sourceHost = null)
return $queryBuilder->getQuery()->getOneOrNullResult();
}

/**
* {@inheritdoc}
*/
public function findBySource($source, $sourceHost = null)
{
$queryBuilder = $this->createFindBySourceQueryBuilder($source, $sourceHost);

return $queryBuilder->getQuery()->getOneOrNullResult();
}

/**
* {@inheritdoc}
*/
public function persist(RedirectRouteInterface $entity): void
{
$this->_em->persist($entity);
}

/**
* {@inheritdoc}
*/
public function remove(RedirectRouteInterface $entity): void
{
$this->_em->remove($entity);
Expand Down
3 changes: 0 additions & 3 deletions GoneSubscriber/GoneDocumentSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ public function __construct(
$this->environment = $environment;
}

/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return [
Expand Down
6 changes: 0 additions & 6 deletions Import/Converter/Converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ public function __construct(RedirectRouteRepositoryInterface $repository)
$this->repository = $repository;
}

/**
* {@inheritdoc}
*/
public function convert(array $item)
{
$accessor = PropertyAccess::createPropertyAccessor();
Expand All @@ -66,9 +63,6 @@ public function convert(array $item)
return $entity;
}

/**
* {@inheritdoc}
*/
public function supports(array $item)
{
$keys = array_keys($item);
Expand Down
6 changes: 0 additions & 6 deletions Import/Converter/ConverterFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ public function __construct(array $converters = [])
$this->converters = $converters;
}

/**
* {@inheritdoc}
*/
public function convert(array $item)
{
foreach ($this->converters as $converter) {
Expand All @@ -43,9 +40,6 @@ public function convert(array $item)
return null;
}

/**
* {@inheritdoc}
*/
public function supports(array $item)
{
foreach ($this->converters as $converter) {
Expand Down
2 changes: 0 additions & 2 deletions Import/FileImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ public function __construct(ReaderInterface $reader, ConverterInterface $convert
}

/**
* {@inheritdoc}
*
* @return iterable<int, Item>
*/
public function import($fileName)
Expand Down
2 changes: 1 addition & 1 deletion Import/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Item
* @param int $lineNumber
* @param string $lineContent
*/
public function __construct($lineNumber, $lineContent, RedirectRouteInterface $data = null, ImportException $exception = null)
public function __construct($lineNumber, $lineContent, ?RedirectRouteInterface $data = null, ?ImportException $exception = null)
{
$this->lineNumber = $lineNumber;
$this->lineContent = $lineContent;
Expand Down
10 changes: 2 additions & 8 deletions Import/Reader/CsvReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Sulu\Bundle\RedirectBundle\Import\Reader;

use SplFileObject;
use Sulu\Bundle\RedirectBundle\Import\Converter\Converter;

/**
Expand All @@ -20,17 +19,15 @@
class CsvReader implements ReaderInterface
{
/**
* {@inheritdoc}
*
* @return iterable<int, ReaderItem>
*/
public function read($fileName)
{
ini_set('auto_detect_line_endings', true); // For mac's office excel csv

$csv = new SplFileObject($fileName);
$csv = new \SplFileObject($fileName);
$csv->setCsvControl();
$csv->setFlags(SplFileObject::READ_CSV);
$csv->setFlags(\SplFileObject::READ_CSV);

$header = [Converter::SOURCE, Converter::TARGET, Converter::STATUS_CODE, Converter::ENABLED, Converter::SOURCE_HOST];
/** @var string[] $line */
Expand All @@ -51,9 +48,6 @@ public function read($fileName)
}
}

/**
* {@inheritdoc}
*/
public function supports($fileName)
{
return 'csv' === pathinfo($fileName, PATHINFO_EXTENSION);
Expand Down
6 changes: 0 additions & 6 deletions Import/Reader/ReaderFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ public function __construct(array $readers = [])
$this->readers = $readers;
}

/**
* {@inheritdoc}
*/
public function read($fileName)
{
foreach ($this->readers as $reader) {
Expand All @@ -43,9 +40,6 @@ public function read($fileName)
return null;
}

/**
* {@inheritdoc}
*/
public function supports($fileName)
{
foreach ($this->readers as $reader) {
Expand Down
2 changes: 1 addition & 1 deletion Import/Reader/ReaderItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ReaderItem
*/
private $exception;

public function __construct(int $lineNumber, string $lineContent, array $data, ImportException $exception = null)
public function __construct(int $lineNumber, string $lineContent, array $data, ?ImportException $exception = null)
{
$this->lineNumber = $lineNumber;
$this->lineContent = $lineContent;
Expand Down
6 changes: 0 additions & 6 deletions Import/Writer/Writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ public function __construct(RedirectRouteManagerInterface $manager, EntityManage
$this->entityManager = $entityManager;
}

/**
* {@inheritdoc}
*/
public function write(RedirectRouteInterface $entity): void
{
$this->validate($entity);
Expand All @@ -63,9 +60,6 @@ public function write(RedirectRouteInterface $entity): void
}
}

/**
* {@inheritdoc}
*/
public function finalize(): void
{
$this->entityManager->flush();
Expand Down
Loading

0 comments on commit 0886127

Please sign in to comment.