Skip to content

Commit

Permalink
chore: Bumped
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Feb 9, 2024
1 parent 64fd973 commit 2da526a
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .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.1', '8.2', '8.3']
php-version: ['8.0', '8.1']
steps:
- uses: shivammathur/setup-php@v2
with:
Expand Down
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: php
sudo: required
php:
- 8.0
- 8.1
- nightly
env:
- XDEBUG_MODE=coverage
install:
- curl -s http://getcomposer.org/installer | php
- php composer.phar install --dev --no-interaction
script:
- vendor/bin/phpcs --report=full --report-file=./report.txt --extensions=php --warning-severity=0 --standard=PSR12 -p ./src
- vendor/bin/phpstan analyse -c phpstan.neon
- vendor/bin/atoum -f tests/units/*
jobs:
allow_failures:
- php: nightly
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Roadiz

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:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 0 additions & 9 deletions LICENSE.md

This file was deleted.

6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
],
"require": {
"php": ">=8.1",
"php": ">=8.0",
"ext-json": "*",
"roadiz/nodetype-contracts": "~1.1.2",
"symfony/string": "5.4.*",
Expand All @@ -37,8 +37,8 @@
},
"extra": {
"branch-alias": {
"dev-main": "2.2.x-dev",
"dev-develop": "2.3.x-dev"
"dev-main": "2.1.x-dev",
"dev-develop": "2.2.x-dev"
}
}
}
6 changes: 3 additions & 3 deletions src/EntityGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ protected function getClassHeader(): string
];

if ($this->options['use_api_platform_filters'] === true) {
$useStatements[] = 'use ApiPlatform\Metadata\ApiFilter;';
$useStatements[] = 'use ApiPlatform\Doctrine\Orm\Filter as OrmFilter;';
$useStatements[] = 'use ApiPlatform\Serializer\Filter\PropertyFilter;';
$useStatements[] = 'use ApiPlatform\Core\Annotation\ApiFilter;';
$useStatements[] = 'use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter as OrmFilter;';
$useStatements[] = 'use ApiPlatform\Core\Serializer\Filter\PropertyFilter;';
}
/*
* BE CAREFUL, USE statements are required for field generators which
Expand Down
12 changes: 12 additions & 0 deletions src/Field/NonVirtualFieldGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@ protected function getFieldLength(): ?int
};
}

protected function getMaxDefaultValuesLength(): int
{
// get max length of exploded default values
$max = 0;
foreach (explode(',', $this->field->getDefaultValues()) as $value) {

Check failure on line 59 in src/Field/NonVirtualFieldGenerator.php

View workflow job for this annotation

GitHub Actions / run-tests (8.0)

Parameter #2 $string of function explode expects string, string|null given.

Check failure on line 59 in src/Field/NonVirtualFieldGenerator.php

View workflow job for this annotation

GitHub Actions / run-tests (8.1)

Parameter #2 $string of function explode expects string, string|null given.
$value = trim($value);
$max = max($max, \mb_strlen($value));
}

return $max > 0 ? $max : 250;
}

protected function isExcludingFieldFromJmsSerialization(): bool
{
return false;
Expand Down
6 changes: 3 additions & 3 deletions tests/mocks/GeneratedNodesSources/NSMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
use Symfony\Component\Serializer\Annotation as SymfonySerializer;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;
use ApiPlatform\Metadata\ApiFilter;
use ApiPlatform\Doctrine\Orm\Filter as OrmFilter;
use ApiPlatform\Serializer\Filter\PropertyFilter;
use ApiPlatform\Core\Annotation\ApiFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter as OrmFilter;
use ApiPlatform\Core\Serializer\Filter\PropertyFilter;

/**
* DO NOT EDIT
Expand Down
6 changes: 3 additions & 3 deletions tests/mocks/GeneratedNodesSourcesWithRepository/NSMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
use Symfony\Component\Serializer\Annotation as SymfonySerializer;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;
use ApiPlatform\Metadata\ApiFilter;
use ApiPlatform\Doctrine\Orm\Filter as OrmFilter;
use ApiPlatform\Serializer\Filter\PropertyFilter;
use ApiPlatform\Core\Annotation\ApiFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter as OrmFilter;
use ApiPlatform\Core\Serializer\Filter\PropertyFilter;

/**
* DO NOT EDIT
Expand Down

0 comments on commit 2da526a

Please sign in to comment.