Skip to content

Commit

Permalink
Ibexa 4 (#34)
Browse files Browse the repository at this point in the history
* Update namespaces to new ibexa namespaces

* Made the bundle usable for all ibexa 4.x versions

* Fix incorect version definition

* Remove UnnecessaryVarAnnotation

* Fix namespaces

* Fix class names

* Fix config

* Fixed tests

---------

Co-authored-by: Hannes Giesenow <[email protected]>
  • Loading branch information
thomaskoehnadesso and Hannes Giesenow authored Mar 12, 2024
1 parent 389f113 commit 54fb5a9
Show file tree
Hide file tree
Showing 37 changed files with 188 additions and 190 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
sleep 1
done
echo Failed waiting for MySQL && exit 1
- run: 'vendor/bin/phpunit --testsuite integration'
- run: 'php -d memory_limit=512M vendor/bin/phpunit --testsuite integration'
- store_test_results:
path: 'build'
- codecov/upload:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"require": {
"php": ">=8.1",
"ibexa/oss": "^4.5",
"ibexa/oss": "^4.0",
"ext-dom": "*"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ vendor/bin/psalm
To run integration tests, you need to spin up a database first. To ease this, you can use the docker-compose setup provided
```bash
docker-compose up -d
docker-compose run php bash
docker-compose run php sh
vendor/bin/phpunit --testsuite integration
```

Expand Down
6 changes: 3 additions & 3 deletions src/Data/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

namespace Elbformat\FieldHelperBundle\Data;

use eZ\Publish\API\Repository\Values\Content\Field;
use eZ\Publish\API\Repository\Values\Content\VersionInfo;
use eZ\Publish\SPI\Variation\VariationHandler;
use Ibexa\Contracts\Core\Repository\Values\Content\Field;
use Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo;
use Ibexa\Contracts\Core\Variation\VariationHandler;

class Image
{
Expand Down
8 changes: 4 additions & 4 deletions src/Data/ImageFormatsProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
namespace Elbformat\FieldHelperBundle\Data;

use ArrayAccess;
use eZ\Publish\API\Repository\Values\Content\Field;
use eZ\Publish\API\Repository\Values\Content\VersionInfo;
use eZ\Publish\Core\FieldType\Image\Value;
use eZ\Publish\SPI\Variation\VariationHandler;
use Ibexa\Contracts\Core\Repository\Values\Content\Field;
use Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo;
use Ibexa\Core\FieldType\Image\Value;
use Ibexa\Contracts\Core\Variation\VariationHandler;

/**
* This proxy makes sure, that image formats will only be generated as soon as they are needed in the template.
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Elbformat\FieldHelperBundle\Data;

use eZ\Publish\Core\FieldType\Url\Value;
use Ibexa\Core\FieldType\Url\Value;

/**
* @author Hannes Giesenow <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/FieldNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Elbformat\FieldHelperBundle\Exception;

use eZ\Publish\API\Repository\Values\Content\Content;
use Ibexa\Contracts\Core\Repository\Values\Content\Content;

/**
* Thrown, when a field by the given name was not found in this content object.
Expand Down
4 changes: 2 additions & 2 deletions src/FieldHelper/AbstractFieldHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace Elbformat\FieldHelperBundle\FieldHelper;

use eZ\Publish\API\Repository\Values\Content\Content;
use eZ\Publish\API\Repository\Values\Content\Field;
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
use Ibexa\Contracts\Core\Repository\Values\Content\Field;
use Elbformat\FieldHelperBundle\Exception\FieldNotFoundException;

/**
Expand Down
9 changes: 4 additions & 5 deletions src/FieldHelper/AuthorFieldHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
namespace Elbformat\FieldHelperBundle\FieldHelper;

use Elbformat\FieldHelperBundle\Exception\InvalidFieldTypeException;
use eZ\Publish\API\Repository\Values\Content\Content;
use eZ\Publish\Core\FieldType\Author\Author;
use eZ\Publish\Core\FieldType\Author\AuthorCollection;
use eZ\Publish\Core\FieldType\Author\Value as AuthorValue;
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
use Ibexa\Core\FieldType\Author\Author;
use Ibexa\Core\FieldType\Author\AuthorCollection;
use Ibexa\Core\FieldType\Author\Value as AuthorValue;

class AuthorFieldHelper extends AbstractFieldHelper
{
Expand All @@ -31,7 +31,6 @@ public function getNames(Content $content, string $fieldName): string
$authors = $this->getValues($content, $fieldName);

$names = [];
/** @var Author $author */
foreach ($authors as $author) {
$names[] = $author->name;
}
Expand Down
8 changes: 4 additions & 4 deletions src/FieldHelper/BoolFieldHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

use Elbformat\FieldHelperBundle\Exception\FieldNotFoundException;
use Elbformat\FieldHelperBundle\Exception\InvalidFieldTypeException;
use eZ\Publish\API\Repository\Values\Content\Content;
use eZ\Publish\API\Repository\Values\Content\ContentStruct;
use eZ\Publish\API\Repository\Values\Content\Field;
use eZ\Publish\Core\FieldType\Checkbox\Value as CheckboxValue;
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
use Ibexa\Contracts\Core\Repository\Values\Content\ContentStruct;
use Ibexa\Contracts\Core\Repository\Values\Content\Field;
use Ibexa\Core\FieldType\Checkbox\Value as CheckboxValue;

/**
* @author Hannes Giesenow <[email protected]>
Expand Down
12 changes: 6 additions & 6 deletions src/FieldHelper/DateTimeFieldHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
use DateTimeInterface;
use Elbformat\FieldHelperBundle\Exception\FieldNotFoundException;
use Elbformat\FieldHelperBundle\Exception\InvalidFieldTypeException;
use eZ\Publish\API\Repository\Values\Content\Content;
use eZ\Publish\API\Repository\Values\Content\ContentStruct;
use eZ\Publish\API\Repository\Values\Content\Field;
use eZ\Publish\Core\FieldType\Date\Value as DateValue;
use eZ\Publish\Core\FieldType\DateAndTime\Value as DateTimeValue;
use eZ\Publish\Core\FieldType\Time\Value as TimeValue;
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
use Ibexa\Contracts\Core\Repository\Values\Content\ContentStruct;
use Ibexa\Contracts\Core\Repository\Values\Content\Field;
use Ibexa\Core\FieldType\Date\Value as DateValue;
use Ibexa\Core\FieldType\DateAndTime\Value as DateTimeValue;
use Ibexa\Core\FieldType\Time\Value as TimeValue;

/**
* @author Hannes Giesenow <[email protected]>
Expand Down
6 changes: 3 additions & 3 deletions src/FieldHelper/FileFieldHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

use Elbformat\FieldHelperBundle\Exception\FieldNotFoundException;
use Elbformat\FieldHelperBundle\Exception\InvalidFieldTypeException;
use eZ\Publish\API\Repository\Values\Content\Content;
use eZ\Publish\API\Repository\Values\Content\Field;
use eZ\Publish\Core\FieldType\BinaryFile\Value as BinaryValue;
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
use Ibexa\Contracts\Core\Repository\Values\Content\Field;
use Ibexa\Core\FieldType\BinaryFile\Value as BinaryValue;

class FileFieldHelper extends AbstractFieldHelper
{
Expand Down
16 changes: 8 additions & 8 deletions src/FieldHelper/ImageFieldHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@

use Elbformat\FieldHelperBundle\Data\Image;
use Elbformat\FieldHelperBundle\Exception\InvalidFieldTypeException;
use eZ\Publish\API\Repository\Exceptions\NotFoundException;
use eZ\Publish\API\Repository\Repository;
use eZ\Publish\API\Repository\Values\Content\Content;
use eZ\Publish\API\Repository\Values\Content\Field;
use eZ\Publish\Core\FieldType\RelationList\Value as RelationValue;
use eZ\Publish\Core\MVC\ConfigResolverInterface;
use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException;
use Ibexa\Contracts\Core\Repository\Repository;
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
use Ibexa\Contracts\Core\Repository\Values\Content\Field;
use Ibexa\Core\FieldType\RelationList\Value as RelationValue;
use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface;
use Ibexa\Contracts\Core\Variation\VariationHandler;
use Ibexa\Contracts\HttpCache\ResponseTagger\ResponseTagger;
use eZ\Publish\Core\FieldType\Image\Value as ImageValue;
use eZ\Publish\Core\FieldType\ImageAsset\Value as ImageAssetValue;
use Ibexa\Core\FieldType\Image\Value as ImageValue;
use Ibexa\Core\FieldType\ImageAsset\Value as ImageAssetValue;

/**
* Create an image object from Image content object, or a filed with a relation
Expand Down
4 changes: 2 additions & 2 deletions src/FieldHelper/NetgenTagsFieldHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

use Elbformat\FieldHelperBundle\Exception\FieldNotFoundException;
use Elbformat\FieldHelperBundle\Exception\InvalidFieldTypeException;
use eZ\Publish\API\Repository\Values\Content\Content;
use eZ\Publish\API\Repository\Values\Content\Field;
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
use Ibexa\Contracts\Core\Repository\Values\Content\Field;
use Netgen\TagsBundle\API\Repository\TagsService;
use Netgen\TagsBundle\API\Repository\Values\Tags\Tag;
use Netgen\TagsBundle\Core\FieldType\Tags\Value as NetgenTagsValue;
Expand Down
10 changes: 5 additions & 5 deletions src/FieldHelper/NumberFieldHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

use Elbformat\FieldHelperBundle\Exception\FieldNotFoundException;
use Elbformat\FieldHelperBundle\Exception\InvalidFieldTypeException;
use eZ\Publish\API\Repository\Values\Content\Content;
use eZ\Publish\API\Repository\Values\Content\ContentStruct;
use eZ\Publish\API\Repository\Values\Content\Field;
use eZ\Publish\Core\FieldType\Float\Value as FloatValue;
use eZ\Publish\Core\FieldType\Integer\Value as IntValue;
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
use Ibexa\Contracts\Core\Repository\Values\Content\ContentStruct;
use Ibexa\Contracts\Core\Repository\Values\Content\Field;
use Ibexa\Core\FieldType\Float\Value as FloatValue;
use Ibexa\Core\FieldType\Integer\Value as IntValue;

/**
* Helps reading, updating and comparing numeric field types.
Expand Down
10 changes: 5 additions & 5 deletions src/FieldHelper/RelationFieldHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

use Elbformat\FieldHelperBundle\Exception\FieldNotFoundException;
use Elbformat\FieldHelperBundle\Exception\InvalidFieldTypeException;
use eZ\Publish\API\Repository\Repository;
use eZ\Publish\API\Repository\Values\Content\Content;
use eZ\Publish\API\Repository\Values\Content\ContentStruct;
use eZ\Publish\Core\FieldType\Relation\Value as RelationValue;
use eZ\Publish\Core\FieldType\RelationList\Value as RelationListValue;
use Ibexa\Contracts\Core\Repository\Repository;
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
use Ibexa\Contracts\Core\Repository\Values\Content\ContentStruct;
use Ibexa\Core\FieldType\Relation\Value as RelationValue;
use Ibexa\Core\FieldType\RelationList\Value as RelationListValue;
use Ibexa\Contracts\HttpCache\ResponseTagger\ResponseTagger;
use Psr\Log\LoggerInterface;

Expand Down
12 changes: 6 additions & 6 deletions src/FieldHelper/RichtextFieldHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
namespace Elbformat\FieldHelperBundle\FieldHelper;

use Elbformat\FieldHelperBundle\Exception\FieldNotFoundException;
use eZ\Publish\API\Repository\Values\Content\Content;
use eZ\Publish\API\Repository\Values\Content\ContentStruct;
use eZ\Publish\API\Repository\Values\Content\Field;
use eZ\Publish\Core\Helper\FieldHelper;
use EzSystems\EzPlatformRichText\eZ\FieldType\RichText\Value;
use EzSystems\EzPlatformRichText\eZ\RichText\Converter as RichtextConverter;
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
use Ibexa\Contracts\Core\Repository\Values\Content\ContentStruct;
use Ibexa\Contracts\Core\Repository\Values\Content\Field;
use Ibexa\Core\Helper\FieldHelper;
use Ibexa\FieldTypeRichText\FieldType\RichText\Value;
use Ibexa\Contracts\FieldTypeRichText\RichText\Converter as RichtextConverter;

/**
* Helps reading, updating and comparing richtext field types.
Expand Down
4 changes: 2 additions & 2 deletions src/FieldHelper/SelectionFieldHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

use Elbformat\FieldHelperBundle\Exception\FieldNotFoundException;
use Elbformat\FieldHelperBundle\Exception\InvalidFieldTypeException;
use eZ\Publish\API\Repository\Values\Content\Content;
use eZ\Publish\Core\FieldType\Selection\Value as SelectionValue;
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
use Ibexa\Core\FieldType\Selection\Value as SelectionValue;

class SelectionFieldHelper extends AbstractFieldHelper
{
Expand Down
12 changes: 6 additions & 6 deletions src/FieldHelper/TextFieldHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

use Elbformat\FieldHelperBundle\Exception\FieldNotFoundException;
use Elbformat\FieldHelperBundle\Exception\InvalidFieldTypeException;
use eZ\Publish\API\Repository\Values\Content\Content;
use eZ\Publish\API\Repository\Values\Content\ContentStruct;
use eZ\Publish\API\Repository\Values\Content\Field;
use eZ\Publish\Core\FieldType\EmailAddress\Value as MailValue;
use eZ\Publish\Core\FieldType\TextBlock\Value as TextBlockValue;
use eZ\Publish\Core\FieldType\TextLine\Value as TextLineValue;
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
use Ibexa\Contracts\Core\Repository\Values\Content\ContentStruct;
use Ibexa\Contracts\Core\Repository\Values\Content\Field;
use Ibexa\Core\FieldType\EmailAddress\Value as MailValue;
use Ibexa\Core\FieldType\TextBlock\Value as TextBlockValue;
use Ibexa\Core\FieldType\TextLine\Value as TextLineValue;

/**
* Handles ezstring,eztext and ezemail
Expand Down
8 changes: 4 additions & 4 deletions src/FieldHelper/UrlFieldHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
use Elbformat\FieldHelperBundle\Data\Url;
use Elbformat\FieldHelperBundle\Exception\FieldNotFoundException;
use Elbformat\FieldHelperBundle\Exception\InvalidFieldTypeException;
use eZ\Publish\API\Repository\Values\Content\Content;
use eZ\Publish\API\Repository\Values\Content\ContentStruct;
use eZ\Publish\API\Repository\Values\Content\Field;
use eZ\Publish\Core\FieldType\Url\Value as UrlValue;
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
use Ibexa\Contracts\Core\Repository\Values\Content\ContentStruct;
use Ibexa\Contracts\Core\Repository\Values\Content\Field;
use Ibexa\Core\FieldType\Url\Value as UrlValue;

/**
* @author Hannes Giesenow <[email protected]>
Expand Down
10 changes: 5 additions & 5 deletions tests/FieldHelper/AuthorFieldHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
use Elbformat\FieldHelperBundle\Exception\FieldNotFoundException;
use Elbformat\FieldHelperBundle\Exception\InvalidFieldTypeException;
use Elbformat\FieldHelperBundle\FieldHelper\AuthorFieldHelper;
use eZ\Publish\API\Repository\Values\Content\Field;
use eZ\Publish\Core\FieldType\Author\Author;
use eZ\Publish\Core\FieldType\Author\Value;
use eZ\Publish\Core\FieldType\Float\Value as FloatValue;
use eZ\Publish\Core\Repository\Values\Content\Content;
use Ibexa\Contracts\Core\Repository\Values\Content\Field;
use Ibexa\Core\FieldType\Author\Author;
use Ibexa\Core\FieldType\Author\Value;
use Ibexa\Core\FieldType\Float\Value as FloatValue;
use Ibexa\Core\Repository\Values\Content\Content;
use PHPUnit\Framework\TestCase;

/**
Expand Down
12 changes: 6 additions & 6 deletions tests/FieldHelper/BoolFieldHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
use Elbformat\FieldHelperBundle\Exception\FieldNotFoundException;
use Elbformat\FieldHelperBundle\Exception\InvalidFieldTypeException;
use Elbformat\FieldHelperBundle\FieldHelper\BoolFieldHelper;
use eZ\Publish\API\Repository\Values\Content\Field;
use eZ\Publish\Core\FieldType\Checkbox\Value as CheckboxValue;
use eZ\Publish\Core\FieldType\Float\Value as FloatValue;
use eZ\Publish\Core\Repository\Values\Content\Content;
use eZ\Publish\Core\Repository\Values\Content\ContentCreateStruct;
use eZ\Publish\Core\Repository\Values\Content\ContentUpdateStruct;
use Ibexa\Contracts\Core\Repository\Values\Content\Field;
use Ibexa\Core\FieldType\Checkbox\Value as CheckboxValue;
use Ibexa\Core\FieldType\Float\Value as FloatValue;
use Ibexa\Core\Repository\Values\Content\Content;
use Ibexa\Core\Repository\Values\Content\ContentCreateStruct;
use Ibexa\Core\Repository\Values\Content\ContentUpdateStruct;
use PHPUnit\Framework\TestCase;

/**
Expand Down
18 changes: 9 additions & 9 deletions tests/FieldHelper/DateTimeFieldHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
use Elbformat\FieldHelperBundle\Exception\FieldNotFoundException;
use Elbformat\FieldHelperBundle\Exception\InvalidFieldTypeException;
use Elbformat\FieldHelperBundle\FieldHelper\DateTimeFieldHelper;
use eZ\Publish\API\Repository\Values\Content\Field;
use eZ\Publish\Core\FieldType\Date\Value as DateValue;
use eZ\Publish\Core\FieldType\DateAndTime\Value as DateTimeValue;
use eZ\Publish\Core\FieldType\Float\Value as FloatValue;
use eZ\Publish\Core\FieldType\Time\Value as TimeValue;
use eZ\Publish\Core\FieldType\Value;
use eZ\Publish\Core\Repository\Values\Content\Content;
use eZ\Publish\Core\Repository\Values\Content\ContentCreateStruct;
use eZ\Publish\Core\Repository\Values\Content\ContentUpdateStruct;
use Ibexa\Contracts\Core\Repository\Values\Content\Field;
use Ibexa\Core\FieldType\Date\Value as DateValue;
use Ibexa\Core\FieldType\DateAndTime\Value as DateTimeValue;
use Ibexa\Core\FieldType\Float\Value as FloatValue;
use Ibexa\Core\FieldType\Time\Value as TimeValue;
use Ibexa\Core\FieldType\Value;
use Ibexa\Core\Repository\Values\Content\Content;
use Ibexa\Core\Repository\Values\Content\ContentCreateStruct;
use Ibexa\Core\Repository\Values\Content\ContentUpdateStruct;
use PHPUnit\Framework\TestCase;

/**
Expand Down
8 changes: 4 additions & 4 deletions tests/FieldHelper/FileFieldHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
use Elbformat\FieldHelperBundle\Exception\FieldNotFoundException;
use Elbformat\FieldHelperBundle\Exception\InvalidFieldTypeException;
use Elbformat\FieldHelperBundle\FieldHelper\FileFieldHelper;
use eZ\Publish\API\Repository\Values\Content\Field;
use eZ\Publish\Core\FieldType\BinaryFile\Value;
use eZ\Publish\Core\FieldType\Float\Value as FloatValue;
use eZ\Publish\Core\Repository\Values\Content\Content;
use Ibexa\Contracts\Core\Repository\Values\Content\Field;
use Ibexa\Core\FieldType\BinaryFile\Value;
use Ibexa\Core\FieldType\Float\Value as FloatValue;
use Ibexa\Core\Repository\Values\Content\Content;
use PHPUnit\Framework\TestCase;

/**
Expand Down
Loading

0 comments on commit 54fb5a9

Please sign in to comment.