Skip to content

Commit

Permalink
Cleaned code with php-cs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Berthereau authored and Daniel Berthereau committed Aug 22, 2022
1 parent a695900 commit 48c0c78
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
use Laminas\EventManager\Event;
use Laminas\EventManager\SharedEventManagerInterface;
use Laminas\Mvc\MvcEvent;
use Laminas\ServiceManager\ServiceLocatorInterface;
use Laminas\View\Renderer\PhpRenderer;
use Omeka\Api\Adapter\ItemAdapter;
use Omeka\Api\Adapter\ItemSetAdapter;
Expand Down
1 change: 0 additions & 1 deletion config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* thing, but will this improve performance (search with a ternary key)?
* This will be checked if a new group of something is needed (for sites).
*/

namespace Group;

return [
Expand Down
6 changes: 3 additions & 3 deletions src/Api/Adapter/GroupAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public function sortQuery(QueryBuilder $qb, array $query): void
}
}

public function hydrate(Request $request, EntityInterface $entity,ErrorStore $errorStore): void
public function hydrate(Request $request, EntityInterface $entity, ErrorStore $errorStore): void
{
if ($this->shouldHydrate($request, 'o:name')) {
$name = $request->getValue('o:name');
Expand Down Expand Up @@ -292,8 +292,8 @@ protected function sanitizeString($string): string
{
// Quote is allowed.
$string = strip_tags((string) $string);
// The first character is a space and the last one is a no-break space.
$string = trim($string, ' /\\?<>:*%|"`&; ' . "\t\n\r");
// The first character is a space and "a0" is a no-break space.
$string = trim($string, " /\\?<>:*%|\"`&;\u{a0}\t\n\r");
$string = preg_replace('/[\(\{]/', '[', $string);
$string = preg_replace('/[\)\}]/', ']', $string);
$string = preg_replace('/[[:cntrl:]\/\\\?<>\*\%\|\"`\&\;#+\^\$\s]/', ' ', $string);
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/GroupMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function processRow(array $row)
$this->processGlobalArgs();

// TODO Allow to bypass the default multivalue separator for users and resources.
$multivalueMap = isset($this->args['column-multivalue']) ? $this->args['column-multivalue'] : [];
$multivalueMap = $this->args['column-multivalue'] ?? [];
foreach ($row as $index => $values) {
if (array_key_exists($index, $multivalueMap) && strlen($multivalueMap[$index])) {
$values = explode($multivalueMap[$index], $values);
Expand Down
2 changes: 1 addition & 1 deletion src/Mvc/Controller/Plugin/ListGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Group\Mvc\Controller\Plugin;

use Group\Api\Adapter\GroupAdapter;
use Laminas\Mvc\Controller\Plugin\AbstractPlugin;
use Omeka\Api\Manager as ApiManager;
use Omeka\Api\Representation\AbstractEntityRepresentation;
use Omeka\Permissions\Acl;
use Group\Api\Adapter\GroupAdapter;

class ListGroups extends AbstractPlugin
{
Expand Down

0 comments on commit 48c0c78

Please sign in to comment.