Skip to content

Commit

Permalink
Merge branch hotfix/v2.3.28
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Sep 24, 2024
1 parent fac7d6a commit a6c681c
Show file tree
Hide file tree
Showing 26 changed files with 69 additions and 233 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['8.0', '8.1']
php-version: ['8.1', '8.2', '8.3']
steps:
- uses: shivammathur/setup-php@v2
with:
Expand All @@ -36,7 +36,7 @@ jobs:
- name: Install Dependencies
run: composer install --no-scripts --no-ansi --no-interaction --no-progress
- name: Run PHPUnit tests
run: vendor/bin/phpunit -v --bootstrap=tests/bootstrap.php --whitelist ./src --coverage-clover ./build/logs/clover.xml tests/
run: vendor/bin/phpunit -v --whitelist ./src tests
- name: Run PHP Code Sniffer
run: vendor/bin/phpcs -p ./src
- name: Run PHPStan
Expand Down
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#
# Roadiz
#
/pimple.json

# Ignore Google webmaster tool verification
/google*.html
Expand Down
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright © 2023 Ambroise Maupate
Copyright © 2024 Ambroise Maupate

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
10 changes: 0 additions & 10 deletions Makefile

This file was deleted.

25 changes: 15 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
}
],
"require": {
"php": ">=8.0",
"doctrine/orm": "<2.17",
"php": ">=8.1",
"doctrine/orm": "~2.19.0",
"jms/serializer": "^3.9.0",
"symfony/string": "5.4.*",
"symfony/translation-contracts": "^2.3",
"symfony/http-foundation": "5.4.*",
"symfony/serializer": "5.4.*",
"symfony/validator": "5.4.*"
"symfony/string": "6.4.*",
"symfony/translation-contracts": "^3.0",
"symfony/http-foundation": "6.4.*",
"symfony/serializer": "6.4.*",
"symfony/validator": "6.4.*"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
Expand All @@ -35,7 +35,12 @@
},
"autoload": {
"psr-4": {
"RZ\\": "src/"
"RZ\\Roadiz\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"RZ\\Roadiz\\Tests\\": "tests/"
}
},
"config": {
Expand All @@ -46,8 +51,8 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.1.x-dev",
"dev-develop": "2.2.x-dev"
"dev-master": "2.3.x-dev",
"dev-develop": "2.4.x-dev"
}
}
}
6 changes: 3 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
parameters:
level: max
level: 7
paths:
- src
excludePaths:
- */node_modules/*
- */bower_components/*
- */static/*
ignoreErrors:
- identifier: missingType.iterableValue
- identifier: missingType.generics
- '#unknown class Parsedown(Extra)?#'
- '#Instantiated class Memcached not found#'
- '#Instantiated class Redis not found#'
reportUnmatchedIgnoredErrors: false
checkGenericClassInNonGenericObjectType: false
checkMissingIterableValueType: false
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct()
* @param mixed|null $default
* @return mixed|null
*/
public function get(string $key, $default = null)
public function get(string $key, $default = null): mixed
{
if (!$this->ready) {
$this->populateParameters();
Expand All @@ -50,7 +50,7 @@ public function all(string $key = null): array
*
* @return bool
*/
public function has(string $key)
public function has(string $key): bool
{
if (!$this->ready) {
$this->populateParameters();
Expand All @@ -62,7 +62,7 @@ public function has(string $key)
/**
* @return array
*/
public function keys()
public function keys(): array
{
if (!$this->ready) {
$this->populateParameters();
Expand All @@ -75,7 +75,7 @@ public function keys()
* @return \ArrayIterator
*/
#[\ReturnTypeWillChange]
public function getIterator()
public function getIterator(): \ArrayIterator
{
if (!$this->ready) {
$this->populateParameters();
Expand All @@ -88,7 +88,7 @@ public function getIterator()
* @return int
*/
#[\ReturnTypeWillChange]
public function count()
public function count(): int
{
if (!$this->ready) {
$this->populateParameters();
Expand All @@ -105,7 +105,7 @@ public function count()
*
* @return mixed
*/
public function filter(string $key, $default = null, int $filter = \FILTER_DEFAULT, $options = [])
public function filter(string $key, $default = null, int $filter = \FILTER_DEFAULT, $options = []): mixed
{
if (!$this->ready) {
$this->populateParameters();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ abstract class AbstractField extends AbstractPositioned
];

#[
ORM\Column(name: "group_name", type: "string", nullable: true),
ORM\Column(name: "group_name", type: "string", length: 250, nullable: true),
Assert\Length(max: 250),
SymfonySerializer\Groups(["node_type", "setting"]),
Serializer\Groups(["node_type", "setting"]),
Expand All @@ -265,7 +265,7 @@ abstract class AbstractField extends AbstractPositioned
protected ?string $groupName = null;

#[
ORM\Column(name: "group_name_canonical", type: "string", nullable: true),
ORM\Column(name: "group_name_canonical", type: "string", length: 250, nullable: true),
Serializer\Groups(["node_type", "setting"]),
SymfonySerializer\Groups(["node_type", "setting"]),
Assert\Length(max: 250),
Expand All @@ -275,7 +275,7 @@ abstract class AbstractField extends AbstractPositioned
protected ?string $groupNameCanonical = null;

#[
ORM\Column(type: "string"),
ORM\Column(type: "string", length: 250),
Serializer\Expose,
Serializer\Groups(["node_type", "setting"]),
SymfonySerializer\Groups(["node_type", "setting"]),
Expand All @@ -287,7 +287,7 @@ abstract class AbstractField extends AbstractPositioned
protected string $name;

#[
ORM\Column(type: "string"),
ORM\Column(type: "string", length: 250),
Serializer\Expose,
Serializer\Groups(["node_type", "setting"]),
Serializer\Type("string"),
Expand All @@ -299,7 +299,7 @@ abstract class AbstractField extends AbstractPositioned
protected ?string $label;

#[
ORM\Column(type: "string", nullable: true),
ORM\Column(type: "string", length: 250, nullable: true),
Serializer\Expose,
Serializer\Groups(["node_type", "setting"]),
SymfonySerializer\Groups(["node_type", "setting"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
abstract class AbstractHuman extends AbstractDateTimed
{
#[
ORM\Column(type: "string", unique: true),
ORM\Column(type: "string", length: 200, unique: true),
Serializer\Groups(["user_personal", "human"]),
SymfonySerializer\Groups(["user_personal", "human"]),
Assert\NotNull(),
Expand All @@ -37,47 +37,47 @@ abstract class AbstractHuman extends AbstractDateTimed
* Public name (pseudonyme) that can be displayed to a public audience.
*/
#[
ORM\Column(name: "publicName", type: "string", nullable: true),
ORM\Column(name: "publicName", type: "string", length: 250, nullable: true),
Serializer\Groups(["user_public", "human"]),
SymfonySerializer\Groups(["user_public", "human"]),
Assert\Length(max: 250)
]
protected ?string $publicName = null;

#[
ORM\Column(name: "firstName", type: "string", nullable: true),
ORM\Column(name: "firstName", type: "string", length: 250, nullable: true),
Serializer\Groups(["user_personal", "human"]),
SymfonySerializer\Groups(["user_personal", "human"]),
Assert\Length(max: 250)
]
protected ?string $firstName = null;

#[
ORM\Column(name: "lastName", type: "string", nullable: true),
ORM\Column(name: "lastName", type: "string", length: 250, nullable: true),
Serializer\Groups(["user_personal", "human"]),
SymfonySerializer\Groups(["user_personal", "human"]),
Assert\Length(max: 250)
]
protected ?string $lastName = null;

#[
ORM\Column(type: "string", nullable: true),
ORM\Column(type: "string", length: 50, nullable: true),
Serializer\Groups(["user_personal", "human"]),
SymfonySerializer\Groups(["user_personal", "human"]),
Assert\Length(max: 20)
Assert\Length(max: 50)
]
protected ?string $phone = null;

#[
ORM\Column(type: "string", nullable: true),
ORM\Column(type: "string", length: 250, nullable: true),
Serializer\Groups(["user_personal", "human"]),
SymfonySerializer\Groups(["user_personal", "human"]),
Assert\Length(max: 250)
]
protected ?string $company = null;

#[
ORM\Column(type: "string", nullable: true),
ORM\Column(type: "string", length: 250, nullable: true),
Serializer\Groups(["user_personal", "human"]),
SymfonySerializer\Groups(["user_personal", "human"]),
Assert\Length(max: 250)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ trait LeafTrait
{
use PositionedTrait;

/**
* @return Collection<int, LeafInterface>
*/
public function getChildren(): Collection
{
return $this->children;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

abstract class AbstractHandler
{
protected ObjectManager $objectManager;

/**
* @return ObjectManager
*/
Expand All @@ -18,22 +16,9 @@ public function getObjectManager(): ObjectManager
return $this->objectManager;
}

/**
* @param ObjectManager $objectManager
* @return static
*/
public function setObjectManager(ObjectManager $objectManager)
{
$this->objectManager = $objectManager;
return $this;
}

/**
* @param ObjectManager $objectManager
*/
public function __construct(ObjectManager $objectManager)
{
$this->objectManager = $objectManager;
public function __construct(
protected readonly ObjectManager $objectManager
) {
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,5 @@

interface HandlerFactoryInterface
{
/**
* @param AbstractEntity $entity
* @return AbstractHandler
*/
public function getHandler(AbstractEntity $entity): AbstractHandler;
}
34 changes: 0 additions & 34 deletions src/Roadiz/Core/AbstractEntities/AbstractDateTimedPositioned.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static function variablize(?string $string): string

return (new UnicodeString($string))
->ascii()
->replaceMatches('#([^a-zA-Z0-9\.]+)#', '_')
->replaceMatches('#([^a-zA-Z0-9]+)#', '_')
->snake()
->lower()
->trim('-')
Expand Down
Loading

0 comments on commit a6c681c

Please sign in to comment.