Release 2.0.29 (#4178)

- show button title if delete is used in page actions
- fix invoice due date depends on invoice date, replace DateTime with DateTimeI… 
- lowercase all font names in PDFs, otherwise they fail loading
- hide empty fieldset (work-contract page)
- activate contract_other_profile by default for admin and super-admin
- deactivate rule to check "maximum duration of entries" by default
- allow to deactivate presets in DateRange Picker (for Devs)
This commit is contained in:
Kevin Papst
2023-07-26 15:16:59 +02:00
committed by GitHub
parent 385753fbc3
commit b831532323
47 changed files with 229 additions and 266 deletions

View File

@@ -36,3 +36,7 @@
margin-right: 10px;
border-radius: var(--tblr-border-radius);
}
fieldset:empty {
display: none;
}

View File

@@ -107,7 +107,7 @@ kimai:
REPORTING: ['view_reporting','view_other_reporting','project_reporting','customer_reporting']
# permissions which are deactivated, as these features are hidden for now
# brave users can try to activate them and be surprised what happens
REGISTER_BETA: ['contract_other_profile']
REGISTER_BETA: []
# mapping a "role name" to an array of "set names"
maps:
ROLE_USER: ['TIMESHEET','PROFILE']
@@ -118,10 +118,8 @@ kimai:
roles:
ROLE_USER: ['view_team_member','time_team_project','create_tag','view_reporting']
ROLE_TEAMLEAD: ['view_rate_own_timesheet','view_rate_other_timesheet','hourly-rate_own_profile','view_team_member']
# TODO contract_other_profile
ROLE_ADMIN: ['hourly-rate_own_profile','edit_exported_timesheet','teams_own_profile','view_team_member','view_all_data']
# TODO contract_other_profile
ROLE_SUPER_ADMIN: ['hourly-rate_own_profile','hourly-rate_other_profile','roles_own_profile','system_information','system_configuration','plugins','edit_exported_timesheet','teams_own_profile','view_team_member','upload_invoice_template','view_all_data']
ROLE_ADMIN: ['hourly-rate_own_profile','edit_exported_timesheet','teams_own_profile','view_team_member','view_all_data','contract_other_profile']
ROLE_SUPER_ADMIN: ['hourly-rate_own_profile','hourly-rate_other_profile','roles_own_profile','system_information','system_configuration','plugins','edit_exported_timesheet','teams_own_profile','view_team_member','upload_invoice_template','view_all_data','contract_other_profile']
# --------------------------------------------------------------------------------

View File

@@ -4002,12 +4002,12 @@ parameters:
path: src/Invoice/Hydrator/InvoiceItemDefaultHydrator.php
-
message: "#^Parameter \\#1 \\$date of method App\\\\Invoice\\\\InvoiceFormatter\\:\\:getFormattedDateTime\\(\\) expects DateTime, DateTime\\|null given\\.$#"
message: "#^Parameter \\#1 \\$date of method App\\\\Invoice\\\\InvoiceFormatter\\:\\:getFormattedDateTime\\(\\) expects DateTimeInterface, DateTime\\|null given\\.$#"
count: 3
path: src/Invoice/Hydrator/InvoiceItemDefaultHydrator.php
-
message: "#^Parameter \\#1 \\$date of method App\\\\Invoice\\\\InvoiceFormatter\\:\\:getFormattedTime\\(\\) expects DateTime, DateTime\\|null given\\.$#"
message: "#^Parameter \\#1 \\$date of method App\\\\Invoice\\\\InvoiceFormatter\\:\\:getFormattedTime\\(\\) expects DateTimeInterface, DateTime\\|null given\\.$#"
count: 2
path: src/Invoice/Hydrator/InvoiceItemDefaultHydrator.php
@@ -4046,11 +4046,6 @@ parameters:
count: 1
path: src/Invoice/Hydrator/InvoiceModelCustomerHydrator.php
-
message: "#^Cannot call method format\\(\\) on DateTime\\|null\\.$#"
count: 3
path: src/Invoice/Hydrator/InvoiceModelDefaultHydrator.php
-
message: "#^Cannot call method getAddress\\(\\) on App\\\\Entity\\\\InvoiceTemplate\\|null\\.$#"
count: 1
@@ -4137,13 +4132,8 @@ parameters:
path: src/Invoice/Hydrator/InvoiceModelDefaultHydrator.php
-
message: "#^Parameter \\#1 \\$date of method App\\\\Invoice\\\\InvoiceFormatter\\:\\:getFormattedDateTime\\(\\) expects DateTime, DateTime\\|null given\\.$#"
count: 4
path: src/Invoice/Hydrator/InvoiceModelDefaultHydrator.php
-
message: "#^Parameter \\#1 \\$date of method App\\\\Invoice\\\\InvoiceFormatter\\:\\:getFormattedMonthName\\(\\) expects DateTime, DateTime\\|null given\\.$#"
count: 1
message: "#^Parameter \\#1 \\$date of method App\\\\Invoice\\\\InvoiceFormatter\\:\\:getFormattedDateTime\\(\\) expects DateTimeInterface, DateTime\\|null given\\.$#"
count: 2
path: src/Invoice/Hydrator/InvoiceModelDefaultHydrator.php
-

File diff suppressed because one or more lines are too long

View File

@@ -6,7 +6,7 @@
"/build/app.99c7b6b4.js"
],
"css": [
"/build/app.f82609fb.css"
"/build/app.eb575c90.css"
]
},
"export-pdf": {
@@ -64,7 +64,7 @@
"integrity": {
"/build/runtime.f0079159.js": "sha384-H22sAW1aTvyIPqvHOvGXWSWTxf0y6mptp+MsVmyXCfjx/WJjBbhX9gbUZ+qIuihV",
"/build/app.99c7b6b4.js": "sha384-bPAdOMl3I6Ia3clnHgDiwoNKKe/bKnAdHUJdl7BXbsFNMg2wHsUDrGH+uNCQowqM",
"/build/app.f82609fb.css": "sha384-X848pib0qXUB72LdaVSupYXnYPE/lNXHXNkJdlh4FRj534BVHyupi+ly3cfCkDRS",
"/build/app.eb575c90.css": "sha384-CT92SMS+AjbulH+hT+pOq4jicscpVYpl/acq388EdqruZe26icGl9sNq9xaYXH8l",
"/build/export-pdf.d367a32e.js": "sha384-Z5baqnzjI636nYFs4g63ViIKBZKRW4Jhv/7PQmTEQlqhfA7eK0vUMUtiyy0R5A9u",
"/build/export-pdf.d8a6c23b.css": "sha384-ztepocHE4rnGE9eKZ4kL6jTKaePUyiwiB9TjJjstjpf/ckcKg1HedrEOOk/8ElJg",
"/build/invoice.2604495e.js": "sha384-D6JvhGSqlx7z72b/qD3nF3QDXPy+XsCSRGtWfs1icjDKOcd2UzuXwuSa/E1Fg2TJ",

View File

@@ -1,5 +1,5 @@
{
"build/app.css": "/build/app.f82609fb.css",
"build/app.css": "/build/app.eb575c90.css",
"build/app.js": "/build/app.99c7b6b4.js",
"build/export-pdf.css": "/build/export-pdf.d8a6c23b.css",
"build/export-pdf.js": "/build/export-pdf.d367a32e.js",

View File

@@ -17,11 +17,11 @@ class Constants
/**
* The current release version
*/
public const VERSION = '2.0.28';
public const VERSION = '2.0.29';
/**
* The current release: major * 10000 + minor * 100 + patch
*/
public const VERSION_ID = 20028;
public const VERSION_ID = 20029;
/**
* The software name
*/

View File

@@ -305,7 +305,7 @@ final class Configuration implements ConfigurationInterface
->defaultValue(0)
->end()
->integerNode('long_running_duration')
->defaultValue(600)
->defaultValue(0)
->end()
->booleanNode('require_activity')
->defaultTrue()

View File

@@ -208,7 +208,7 @@ class Invoice implements EntityWithMetaFields
$this->currency = $model->getCurrency();
$createdAt = $model->getInvoiceDate();
$this->createdAt = $createdAt;
$this->createdAt = \DateTime::createFromInterface($createdAt);
$this->timezone = $createdAt->getTimezone()->getName();
$this->dueDays = $template->getDueDays();

View File

@@ -175,9 +175,9 @@ class PageActionsEvent extends ThemeEvent
public function addDelete(string $url, bool $remoteConfirm = true): void
{
if ($remoteConfirm) {
$this->addAction('trash', ['url' => $url, 'class' => 'modal-ajax-form text-red', 'translation_domain' => 'actions']);
$this->addAction('trash', ['url' => $url, 'class' => 'modal-ajax-form text-red', 'translation_domain' => 'actions', 'title' => 'trash']);
} else {
$this->addAction('trash', ['url' => $url, 'class' => 'confirmation-link text-red', 'attr' => ['data-question' => 'confirm.delete'], 'translation_domain' => 'actions']);
$this->addAction('trash', ['url' => $url, 'class' => 'confirmation-link text-red', 'attr' => ['data-question' => 'confirm.delete'], 'translation_domain' => 'actions', 'title' => 'trash']);
}
}

View File

@@ -49,6 +49,7 @@ final class DateRangeType extends AbstractType
'format' => $formFormat,
'separator' => self::DATE_SPACER,
'allow_empty' => true,
'with_presets' => true,
'attr' => [
'pattern' => $pattern . self::DATE_SPACER . $pattern
],
@@ -61,6 +62,7 @@ final class DateRangeType extends AbstractType
$user = $options['user'];
$factory = DateTimeFactory::createByUser($user);
if ($options['with_presets']) {
$ranges = [
'daterangepicker.allTime' => [null, null],
'daterangepicker.today' => [$factory->createDateTime('00:00:00'), $factory->createDateTime('23:59:59')],
@@ -80,6 +82,7 @@ final class DateRangeType extends AbstractType
$view->vars['ranges'] = $ranges;
$view->vars['rangeFormat'] = $options['format'];
}
$view->vars['attr'] = array_merge($view->vars['attr'], [
'data-separator' => $options['separator'],

View File

@@ -32,17 +32,17 @@ final class DefaultInvoiceFormatter implements InvoiceFormatter
return $this->formatter;
}
public function getFormattedDateTime(\DateTime $date): string
public function getFormattedDateTime(\DateTimeInterface $date): string
{
return (string) $this->getFormatter()->dateShort($date);
}
public function getFormattedTime(\DateTime $date): string
public function getFormattedTime(\DateTimeInterface $date): string
{
return (string) $this->getFormatter()->time($date);
}
public function getFormattedMonthName(\DateTime $date): string
public function getFormattedMonthName(\DateTimeInterface $date): string
{
return $this->getFormatter()->monthName($date);
}

View File

@@ -71,8 +71,6 @@ final class InvoiceModelDefaultHydrator implements InvoiceModelHydrator
$query = $model->getQuery();
if ($query !== null) {
$begin = $query->getBegin();
$end = $query->getEnd();
if ($begin !== null) {
$values = array_merge($values, [
'query.day' => $begin->format('d'),
@@ -88,6 +86,12 @@ final class InvoiceModelDefaultHydrator implements InvoiceModelHydrator
'query.begin_month' => $formatter->getFormattedMonthName($begin),
'query.begin_month_number' => $begin->format('m'),
'query.begin_year' => $begin->format('Y'),
]);
}
$end = $query->getEnd();
if ($end !== null) {
$values = array_merge($values, [
'query.end' => $formatter->getFormattedDateTime($end),
// since 1.9
'query.end_day' => $end->format('d'),
@@ -97,7 +101,6 @@ final class InvoiceModelDefaultHydrator implements InvoiceModelHydrator
'query.end_month_number' => $end->format('m'),
// since 1.9
'query.end_year' => $end->format('Y'),
// since 1.9
]);
}

View File

@@ -9,7 +9,7 @@
namespace App\Invoice;
use DateTime;
use DateTimeInterface;
/**
* @internal this is subject to change
@@ -20,15 +20,15 @@ interface InvoiceFormatter
public function setLocale(string $locale): void;
public function getFormattedDateTime(DateTime $date): string;
public function getFormattedDateTime(DateTimeInterface $date): string;
public function getFormattedTime(DateTime $date): string;
public function getFormattedTime(DateTimeInterface $date): string;
public function getFormattedAmount(float $amount): string;
public function getFormattedMoney(float $amount, ?string $currency, bool $withCurrency = true): string;
public function getFormattedMonthName(DateTime $date): string;
public function getFormattedMonthName(DateTimeInterface $date): string;
public function getFormattedDuration(int $seconds): string;

View File

@@ -39,7 +39,7 @@ final class InvoiceModel
private ?InvoiceTemplate $template = null;
private ?CalculatorInterface $calculator = null;
private ?NumberGeneratorInterface $generator = null;
private \DateTime $invoiceDate;
private \DateTimeInterface $invoiceDate;
private ?User $user = null;
private InvoiceFormatter $formatter;
/**
@@ -58,7 +58,7 @@ final class InvoiceModel
*/
public function __construct(InvoiceFormatter $formatter, CustomerStatisticService $customerStatistic, ProjectStatisticService $projectStatistic, ActivityStatisticService $activityStatistic)
{
$this->invoiceDate = new \DateTime();
$this->invoiceDate = new \DateTimeImmutable();
$this->formatter = $formatter;
$this->addModelHydrator(new InvoiceModelDefaultHydrator());
$this->addModelHydrator(new InvoiceModelCustomerHydrator($customerStatistic));
@@ -73,11 +73,9 @@ final class InvoiceModel
return $this->query;
}
public function setQuery(InvoiceQuery $query): InvoiceModel
public function setQuery(InvoiceQuery $query): void
{
$this->query = $query;
return $this;
}
/**
@@ -124,11 +122,9 @@ final class InvoiceModel
return $this->template;
}
public function setTemplate(InvoiceTemplate $template): InvoiceModel
public function setTemplate(InvoiceTemplate $template): void
{
$this->template = $template;
return $this;
}
public function getCustomer(): ?Customer
@@ -136,32 +132,34 @@ final class InvoiceModel
return $this->customer;
}
public function setCustomer(?Customer $customer): InvoiceModel
public function setCustomer(Customer $customer): void
{
$this->customer = $customer;
return $this;
}
public function getDueDate(): ?\DateTime
/**
* Requires the template and invoice date to be set
*/
public function getDueDate(): \DateTimeInterface
{
if (null === $this->getTemplate()) {
return null;
$date = \DateTimeImmutable::createFromInterface($this->getInvoiceDate());
$dueDays = 14;
if ($this->getTemplate() !== null) {
$dueDays = $this->getTemplate()->getDueDays();
}
return new \DateTime('+' . $this->getTemplate()->getDueDays() . ' days');
return $date->add(new \DateInterval('P' . $dueDays . 'D'));
}
public function getInvoiceDate(): \DateTime
public function getInvoiceDate(): \DateTimeInterface
{
return $this->invoiceDate;
}
public function setInvoiceDate(\DateTime $date): InvoiceModel
public function setInvoiceDate(\DateTimeInterface $date): void
{
$this->invoiceDate = $date;
return $this;
}
public function getInvoiceNumber(): string

View File

@@ -11,7 +11,10 @@ namespace App\Invoice;
use App\Activity\ActivityStatisticService;
use App\Customer\CustomerStatisticService;
use App\Entity\Customer;
use App\Entity\InvoiceTemplate;
use App\Project\ProjectStatisticService;
use App\Repository\Query\InvoiceQuery;
final class InvoiceModelFactory
{
@@ -22,8 +25,14 @@ final class InvoiceModelFactory
) {
}
public function createModel(InvoiceFormatter $formatter): InvoiceModel
public function createModel(InvoiceFormatter $formatter, Customer $customer, InvoiceTemplate $template, InvoiceQuery $query): InvoiceModel
{
return new InvoiceModel($formatter, $this->customerStatisticService, $this->projectStatisticService, $this->activityStatisticService);
$model = new InvoiceModel($formatter, $this->customerStatisticService, $this->projectStatisticService, $this->activityStatisticService);
$model->setCustomer($customer);
$model->setTemplate($template);
$model->setQuery($query);
return $model;
}
}

View File

@@ -410,12 +410,12 @@ final class ServiceInvoice
$formatter = new DefaultInvoiceFormatter($this->formatter, $template->getLanguage());
$model = $this->invoiceModelFactory->createModel($formatter);
$model
->setCustomer($customer)
->setTemplate($template)
->setQuery($query)
;
$model = $this->invoiceModelFactory->createModel(
$formatter,
$customer,
$template,
$query
);
if ($query->getInvoiceDate() !== null) {
$model->setInvoiceDate($query->getInvoiceDate());

View File

@@ -128,8 +128,14 @@ final class MPdfConverter implements HtmlToPdfConverter
$defaultFontConfig = (new FontVariables())->getDefaults();
$fontData = $defaultFontConfig['fontdata'];
// lowercase all font names, otherwise they cannot be loaded
// see https://github.com/kimai/www.kimai.org/issues/280
if (\array_key_exists('fonts', $options)) {
$fontData = array_merge($fontData, $options['fonts']);
$fonts = [];
foreach ($options['fonts'] as $name => $values) {
$fonts[strtolower($name)] = $values;
}
$fontData = array_merge($fontData, $fonts);
}
return $fontData;

View File

@@ -91,24 +91,27 @@ class InvoiceRepository extends EntityRepository
return $result['counter'];
}
public function getCounterForDay(\DateTime $date, ?Customer $customer = null, ?User $user = null): int
public function getCounterForDay(\DateTimeInterface $date, ?Customer $customer = null, ?User $user = null): int
{
$date = \DateTime::createFromInterface($date);
$start = (clone $date)->setTime(0, 0, 0);
$end = (clone $date)->setTime(23, 59, 59);
return $this->getCounterFor($start, $end, $customer, $user);
}
public function getCounterForMonth(\DateTime $date, ?Customer $customer = null, ?User $user = null): int
public function getCounterForMonth(\DateTimeInterface $date, ?Customer $customer = null, ?User $user = null): int
{
$date = \DateTime::createFromInterface($date);
$start = (clone $date)->setDate((int) $date->format('Y'), (int) $date->format('n'), 1)->setTime(0, 0, 0);
$end = (clone $date)->setDate((int) $date->format('Y'), (int) $date->format('n'), (int) $date->format('t'))->setTime(23, 59, 59);
return $this->getCounterFor($start, $end, $customer, $user);
}
public function getCounterForYear(\DateTime $date, ?Customer $customer = null, ?User $user = null): int
public function getCounterForYear(\DateTimeInterface $date, ?Customer $customer = null, ?User $user = null): int
{
$date = \DateTime::createFromInterface($date);
$start = (clone $date)->setDate((int) $date->format('Y'), 1, 1)->setTime(0, 0, 0);
$end = (clone $date)->setDate((int) $date->format('Y'), 12, 31)->setTime(23, 59, 59);

View File

@@ -4,6 +4,8 @@
{% form_theme form 'form/horizontal.html.twig' %}
{{ form_row(form._token) }}
<fieldset class="form-fieldset">
<legend>{{ 'work_times_should'|trans }}</legend>
<div class="form-text mb-3 help-text">{{ 'work_times_should.help'|trans }}</div>
@@ -17,7 +19,7 @@
</fieldset>
<fieldset class="form-fieldset">
{{ form_rest(form) }}
{{- form_rest(form) -}}
</fieldset>
{% endblock %}

View File

@@ -288,7 +288,7 @@ class ConfigurationTest extends TestCase
'allow_overbooking_budget' => true,
'lockdown_period_timezone' => null,
'break_warning_duration' => 0,
'long_running_duration' => 600,
'long_running_duration' => 0,
'require_activity' => true,
],
'duration_increment' => 15,

View File

@@ -190,11 +190,8 @@ class InvoiceTest extends TestCase
$query->setBegin(new \DateTime());
$query->setEnd(new \DateTime());
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model->setCustomer($customer);
$model->setTemplate($template);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, $template, $query);
$model->addEntries($entries);
$model->setQuery($query);
$model->setUser($user);
$model->setInvoiceDate($created);

View File

@@ -9,8 +9,11 @@
namespace App\Tests\Event;
use App\Entity\Customer;
use App\Entity\Invoice;
use App\Entity\InvoiceTemplate;
use App\Event\InvoiceCreatedEvent;
use App\Repository\Query\InvoiceQuery;
use App\Tests\Invoice\DebugFormatter;
use App\Tests\Mocks\InvoiceModelFactoryFactory;
use PHPUnit\Framework\TestCase;
@@ -23,7 +26,7 @@ class InvoiceCreatedEventTest extends TestCase
public function testDefaultValues()
{
$invoice = new Invoice();
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), new Customer('foo'), new InvoiceTemplate(), new InvoiceQuery());
$sut = new InvoiceCreatedEvent($invoice, $model);

View File

@@ -9,8 +9,11 @@
namespace App\Tests\Event;
use App\Entity\Customer;
use App\Entity\InvoiceTemplate;
use App\Event\InvoicePostRenderEvent;
use App\Model\InvoiceDocument;
use App\Repository\Query\InvoiceQuery;
use App\Tests\Invoice\DebugFormatter;
use App\Tests\Invoice\Renderer\DebugRenderer;
use App\Tests\Mocks\InvoiceModelFactoryFactory;
@@ -24,7 +27,7 @@ class InvoicePostRenderEventTest extends TestCase
{
public function testDefaultValues()
{
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), new Customer('foo'), new InvoiceTemplate(), new InvoiceQuery());
$document = new InvoiceDocument(new \SplFileInfo(__FILE__));
$renderer = new DebugRenderer();
$response = new Response();

View File

@@ -9,8 +9,11 @@
namespace App\Tests\Event;
use App\Entity\Customer;
use App\Entity\InvoiceTemplate;
use App\Event\InvoicePreRenderEvent;
use App\Model\InvoiceDocument;
use App\Repository\Query\InvoiceQuery;
use App\Tests\Invoice\DebugFormatter;
use App\Tests\Invoice\Renderer\DebugRenderer;
use App\Tests\Mocks\InvoiceModelFactoryFactory;
@@ -23,7 +26,7 @@ class InvoicePreRenderEventTest extends TestCase
{
public function testDefaultValues()
{
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), new Customer('foo'), new InvoiceTemplate(), new InvoiceQuery());
$document = new InvoiceDocument(new \SplFileInfo(__FILE__));
$renderer = new DebugRenderer();

View File

@@ -104,7 +104,7 @@ class PageActionsEventTest extends TestCase
'create' => ['url' => 'foo5', 'class' => 'modal-ajax-form', 'title' => 'create', 'accesskey' => 'a'],
'download' => ['url' => 'foo7', 'class' => 'toolbar-action', 'title' => 'export'],
'edit' => ['url' => 'trölölö', 'class' => 'modal-ajax-form', 'translation_domain' => 'actions', 'title' => 'edit'],
'trash' => ['url' => 'foo3', 'class' => 'modal-ajax-form text-red', 'translation_domain' => 'actions'],
'trash' => ['url' => 'foo3', 'class' => 'modal-ajax-form text-red', 'translation_domain' => 'actions', 'title' => 'trash'],
];
$this->assertEquals(\count($expected), $sut->countActions());

View File

@@ -56,12 +56,7 @@ abstract class AbstractCalculatorTest extends TestCase
$template = new InvoiceTemplate();
$query = new InvoiceQuery();
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model->setCustomer($customer);
$model->setTemplate($template);
$model->setQuery($query);
return $model;
return (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, $template, $query);
}
protected function assertDescription(CalculatorInterface $sut, $addProject = false, $addActivity = false): void
@@ -100,11 +95,8 @@ abstract class AbstractCalculatorTest extends TestCase
->setActivity($activity)
->setProject($project);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model->setCustomer($customer);
$model->setTemplate($template);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, $template, $query);
$model->addEntries([$timesheet]);
$model->setQuery($query);
$sut->setModel($model);
$this->assertEquals(1, \count($sut->getEntries()));

View File

@@ -135,11 +135,8 @@ class ActivityInvoiceCalculatorTest extends AbstractCalculatorTest
$query = new InvoiceQuery();
$query->addActivity($activity1);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model->setCustomer($customer);
$model->setTemplate($template);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, $template, $query);
$model->addEntries($entries);
$model->setQuery($query);
$sut = $this->getCalculator();
$sut->setModel($model);

View File

@@ -148,11 +148,8 @@ class ActivityUserInvoiceCalculatorTest extends AbstractCalculatorTest
$query = new InvoiceQuery();
$query->addActivity($activity1);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model->setCustomer($customer);
$model->setTemplate($template);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, $template, $query);
$model->addEntries($entries);
$model->setQuery($query);
$sut = $this->getCalculator();
$sut->setModel($model);

View File

@@ -108,11 +108,8 @@ class DateInvoiceCalculatorTest extends AbstractCalculatorTest
$query = new InvoiceQuery();
$query->setProjects([$project1]);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model->setCustomer($customer);
$model->setTemplate($template);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, $template, $query);
$model->addEntries($entries);
$model->setQuery($query);
$sut = $this->getCalculator();
$sut->setModel($model);

View File

@@ -111,11 +111,8 @@ class DateUserInvoiceCalculatorTest extends AbstractCalculatorTest
$query = new InvoiceQuery();
$query->setProjects([$project1]);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model->setCustomer($customer);
$model->setTemplate($template);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, $template, $query);
$model->addEntries($entries);
$model->setQuery($query);
$sut = $this->getCalculator();
$sut->setModel($model);

View File

@@ -64,11 +64,8 @@ class DefaultCalculatorTest extends AbstractCalculatorTest
$entries = [$timesheet, $timesheet2, $timesheet3];
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model->setCustomer($customer);
$model->setTemplate($template);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, $template, new InvoiceQuery());
$model->addEntries($entries);
$model->setQuery(new InvoiceQuery());
$sut = $this->getCalculator();
$sut->setModel($model);

View File

@@ -112,11 +112,8 @@ class PriceInvoiceCalculatorTest extends AbstractCalculatorTest
$query = new InvoiceQuery();
$query->setProjects([$project1]);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model->setCustomer($customer);
$model->setTemplate($template);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, $template, $query);
$model->addEntries($entries);
$model->setQuery($query);
$sut = $this->getCalculator();
$sut->setModel($model);

View File

@@ -108,11 +108,8 @@ class ProjectInvoiceCalculatorTest extends AbstractCalculatorTest
$query = new InvoiceQuery();
$query->setProjects([$project1]);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model->setCustomer($customer);
$model->setTemplate($template);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, $template, $query);
$model->addEntries($entries);
$model->setQuery($query);
$sut = $this->getCalculator();
$sut->setModel($model);

View File

@@ -111,11 +111,8 @@ class ProjectUserInvoiceCalculatorTest extends AbstractCalculatorTest
$query = new InvoiceQuery();
$query->setProjects([$project1]);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model->setCustomer($customer);
$model->setTemplate($template);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, $template, $query);
$model->addEntries($entries);
$model->setQuery($query);
$sut = $this->getCalculator();
$sut->setModel($model);

View File

@@ -92,11 +92,8 @@ class ShortInvoiceCalculatorTest extends AbstractCalculatorTest
$query = new InvoiceQuery();
$query->addActivity($activity);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model->setCustomer($customer);
$model->setTemplate($template);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, $template, $query);
$model->addEntries($entries);
$model->setQuery($query);
$sut = $this->getCalculator();
$sut->setModel($model);
@@ -174,11 +171,8 @@ class ShortInvoiceCalculatorTest extends AbstractCalculatorTest
$query = new InvoiceQuery();
$query->addActivity($activity);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model->setCustomer($customer);
$model->setTemplate($template);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, $template, $query);
$model->addEntries($entries);
$model->setQuery($query);
$sut = $this->getCalculator();
$sut->setModel($model);
@@ -253,11 +247,8 @@ class ShortInvoiceCalculatorTest extends AbstractCalculatorTest
$query = new InvoiceQuery();
$query->addActivity($activity);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model->setCustomer($customer);
$model->setTemplate($template);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, $template, $query);
$model->addEntries($entries);
$model->setQuery($query);
$sut = $this->getCalculator();
$sut->setModel($model);

View File

@@ -106,11 +106,8 @@ class UserInvoiceCalculatorTest extends AbstractCalculatorTest
$query = new InvoiceQuery();
$query->addActivity($activity);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model->setCustomer($customer);
$model->setTemplate($template);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, $template, $query);
$model->addEntries($entries);
$model->setQuery($query);
$sut = $this->getCalculator();
$sut->setModel($model);

View File

@@ -111,11 +111,8 @@ class WeeklyInvoiceCalculatorTest extends AbstractCalculatorTest
$query = new InvoiceQuery();
$query->setProjects([$project1]);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model->setCustomer($customer);
$model->setTemplate($template);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, $template, $query);
$model->addEntries($entries);
$model->setQuery($query);
$sut = $this->getCalculator();
$sut->setModel($model);

View File

@@ -13,12 +13,12 @@ use App\Invoice\InvoiceFormatter;
class DebugFormatter implements InvoiceFormatter
{
public function getFormattedDateTime(\DateTime $date): string
public function getFormattedDateTime(\DateTimeInterface $date): string
{
return $date->format('d.m.Y');
}
public function getFormattedTime(\DateTime $date): string
public function getFormattedTime(\DateTimeInterface $date): string
{
return $date->format('H:i');
}
@@ -36,7 +36,7 @@ class DebugFormatter implements InvoiceFormatter
return (string) $amount;
}
public function getFormattedMonthName(\DateTime $date): string
public function getFormattedMonthName(\DateTimeInterface $date): string
{
return $date->format('m');
}

View File

@@ -21,7 +21,7 @@ class InvoiceModelCustomerHydratorTest extends TestCase
{
use RendererTestTrait;
public function testHydrate()
public function testHydrate(): void
{
$model = $this->getInvoiceModel();
@@ -30,12 +30,36 @@ class InvoiceModelCustomerHydratorTest extends TestCase
$result = $sut->hydrate($model);
$this->assertModelStructure($result);
$model->setCustomer(null);
$result = $sut->hydrate($model);
self::assertEmpty($result);
$this->assertModelStructure($result);
self::assertEquals([
'customer.id' => null,
'customer.address' => "Foo\nStreet\n1111 City",
'customer.name' => 'customer,with/special#name',
'customer.contact' => '',
'customer.company' => '',
'customer.vat' => '',
'customer.vat_id' => '',
'customer.number' => '',
'customer.country' => null,
'customer.homepage' => '',
'customer.comment' => '',
'customer.email' => '',
'customer.fax' => '',
'customer.phone' => '',
'customer.mobile' => '',
'customer.invoice_text' => '',
'customer.budget_open' => '€0.00',
'customer.budget_open_plain' => 0.0,
'customer.time_budget_open' => '0.00',
'customer.time_budget_open_plain' => 0,
'customer.meta.foo-customer' => 'bar-customer',
], $result);
}
protected function assertModelStructure(array $model)
protected function assertModelStructure(array $model): void
{
$keys = [
'customer.id',

View File

@@ -20,7 +20,7 @@ class InvoiceModelDefaultHydratorTest extends TestCase
{
use RendererTestTrait;
public function testHydrate()
public function testHydrate(): void
{
$model = $this->getInvoiceModel();
@@ -30,7 +30,7 @@ class InvoiceModelDefaultHydratorTest extends TestCase
$this->assertModelStructure($result);
}
protected function assertModelStructure(array $model, $hasProject = true)
protected function assertModelStructure(array $model, bool $hasProject = true): void
{
$keys = [
'invoice.due_date',

View File

@@ -29,39 +29,35 @@ class InvoiceFilenameTest extends TestCase
{
$customer = new Customer('foo');
$template = new InvoiceTemplate();
$query = new InvoiceQuery();
$project = new Project();
$project->setName('Demo ProjecT1');
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$query->addProject($project);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, $template, $query);
$model->setNumberGenerator($this->getNumberGeneratorSut());
$model->setTemplate($template);
$model->setCustomer($customer);
$datePrefix = date('ymd');
$sut = new InvoiceFilename($model);
self::assertEquals($datePrefix . '-foo', $sut->getFilename());
self::assertEquals($datePrefix . '-foo', (string) $sut);
self::assertEquals($datePrefix . '-foo-Demo_ProjecT1', $sut->getFilename());
self::assertEquals($datePrefix . '-foo-Demo_ProjecT1', (string) $sut);
$customer->setCompany('barß / laölala # ldksjf 123 MyAwesome GmbH');
$sut = new InvoiceFilename($model);
self::assertEquals($datePrefix . '-barss_laolala_ldksjf_123_MyAwesome_GmbH', $sut->getFilename());
self::assertEquals($datePrefix . '-barss_laolala_ldksjf_123_MyAwesome_GmbH', (string) $sut);
self::assertEquals($datePrefix . '-barss_laolala_ldksjf_123_MyAwesome_GmbH-Demo_ProjecT1', $sut->getFilename());
self::assertEquals($datePrefix . '-barss_laolala_ldksjf_123_MyAwesome_GmbH-Demo_ProjecT1', (string) $sut);
$customer->setCompany('까깨꺄꺠꺼께껴꼐꼬꽈sssss');
$sut = new InvoiceFilename($model);
self::assertEquals($datePrefix . '-kkakkaekkyakkyaekkeokkekkyeokkyekkokkwasssss', $sut->getFilename());
self::assertEquals($datePrefix . '-kkakkaekkyakkyaekkeokkekkyeokkyekkokkwasssss-Demo_ProjecT1', $sut->getFilename());
$customer->setCompany('\"#+ß.!$%&/()=?\\n=/*-+´_<>@' . "\n");
$sut = new InvoiceFilename($model);
self::assertEquals($datePrefix . '-ss_n_-', $sut->getFilename());
$project = new Project();
$project->setName('Demo ProjecT1');
$query = new InvoiceQuery();
$query->addProject($project);
$model->setQuery($query);
self::assertEquals($datePrefix . '-ss_n_--Demo_ProjecT1', $sut->getFilename());
$customer->setCompany('\"#+ß.!$%&/()=?\\n=/*-+´_<>@' . "\n");
$sut = new InvoiceFilename($model);

View File

@@ -23,21 +23,19 @@ use PHPUnit\Framework\TestCase;
*/
class InvoiceModelTest extends TestCase
{
public function testEmptyObject()
public function testEmptyObject(): void
{
$formatter = new DebugFormatter();
$sut = (new InvoiceModelFactoryFactory($this))->create()->createModel($formatter);
$sut = (new InvoiceModelFactoryFactory($this))->create()->createModel($formatter, new Customer('foo'), new InvoiceTemplate(), new InvoiceQuery());
self::assertNotNull($sut->getQuery());
self::assertNotNull($sut->getCustomer());
self::assertNotNull($sut->getTemplate());
self::assertNull($sut->getQuery());
self::assertNull($sut->getCustomer());
self::assertNull($sut->getDueDate());
self::assertNull($sut->getCalculator());
self::assertEmpty($sut->getEntries());
self::assertIsArray($sut->getEntries());
self::assertNull($sut->getTemplate());
self::assertInstanceOf(\DateTime::class, $sut->getInvoiceDate());
self::assertInstanceOf(\DateTimeInterface::class, $sut->getInvoiceDate());
self::assertSame($formatter, $sut->getFormatter());
@@ -47,27 +45,24 @@ class InvoiceModelTest extends TestCase
self::assertSame($newFormatter, $sut->getFormatter());
}
public function testEmptyObjectThrowsExceptionOnNumberGenerator()
public function testEmptyObjectThrowsExceptionOnNumberGenerator(): void
{
$formatter = new DebugFormatter();
$sut = (new InvoiceModelFactoryFactory($this))->create()->createModel($formatter);
$sut = (new InvoiceModelFactoryFactory($this))->create()->createModel($formatter, new Customer('foo'), new InvoiceTemplate(), new InvoiceQuery());
$this->expectException(\Exception::class);
$this->expectExceptionMessage('InvoiceModel::getInvoiceNumber() cannot be called before calling setNumberGenerator()');
$sut->getInvoiceNumber();
}
public function testSetter()
public function testSetter(): void
{
$sut = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$query = new InvoiceQuery();
self::assertInstanceOf(InvoiceModel::class, $sut->setQuery($query));
self::assertSame($query, $sut->getQuery());
$customer = new Customer('foo');
self::assertInstanceOf(InvoiceModel::class, $sut->setCustomer($customer));
self::assertSame($customer, $sut->getCustomer());
$query = new InvoiceQuery();
$template = new InvoiceTemplate();
$sut = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, $template, $query);
self::assertSame($query, $sut->getQuery());
$calculator = new DefaultCalculator();
self::assertInstanceOf(InvoiceModel::class, $sut->setCalculator($calculator));
@@ -78,11 +73,28 @@ class InvoiceModelTest extends TestCase
$number = $sut->getInvoiceNumber();
self::assertEquals($number, $sut->getInvoiceNumber());
$template = new InvoiceTemplate();
self::assertNull($sut->getDueDate());
self::assertInstanceOf(InvoiceModel::class, $sut->setTemplate($template));
self::assertSame($template, $sut->getTemplate());
/* @phpstan-ignore-next-line */
self::assertInstanceOf(\DateTime::class, $sut->getDueDate());
self::assertInstanceOf(\DateTimeInterface::class, $sut->getDueDate());
}
public function testDueDate(): void
{
$customer = new Customer('foo');
$query = new InvoiceQuery();
$template = new InvoiceTemplate();
$sut = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, $template, $query);
$dueDate = $sut->getDueDate();
$dueDays = $template->getDueDays();
self::assertNotNull($dueDays);
$expected = new \DateTimeImmutable('+' . $dueDays . ' days');
self::assertEquals($expected->format('Y-m-d'), $dueDate->format('Y-m-d'));
$sut->setInvoiceDate(new \DateTimeImmutable('2022-05-23'));
$template->setDueDays(14);
$dueDate = $sut->getDueDate();
$expected = new \DateTimeImmutable('2022-06-06');
self::assertEquals($expected->format('Y-m-d'), $dueDate->format('Y-m-d'));
}
}

View File

@@ -10,9 +10,11 @@
namespace App\Tests\Invoice\NumberGenerator;
use App\Entity\Customer;
use App\Entity\InvoiceTemplate;
use App\Entity\User;
use App\Invoice\NumberGenerator\ConfigurableNumberGenerator;
use App\Repository\InvoiceRepository;
use App\Repository\Query\InvoiceQuery;
use App\Tests\Invoice\DebugFormatter;
use App\Tests\Mocks\InvoiceModelFactoryFactory;
use App\Tests\Mocks\SystemConfigurationFactory;
@@ -156,9 +158,8 @@ class ConfigurableNumberGeneratorTest extends TestCase
$user->method('getAccountNumber')->willReturn('0815');
$sut = $this->getSut($format, $counter);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, new InvoiceTemplate(), new InvoiceQuery());
$model->setInvoiceDate($invoiceDate);
$model->setCustomer($customer);
$model->setUser($user);
$sut->setModel($model);
@@ -200,9 +201,8 @@ class ConfigurableNumberGeneratorTest extends TestCase
$this->expectExceptionMessage(sprintf('Unknown %s found', $brokenPart));
$sut = $this->getSut($format);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), new Customer('foo'), new InvoiceTemplate(), new InvoiceQuery());
$model->setInvoiceDate($invoiceDate);
$model->setCustomer(new Customer('foo'));
$sut->setModel($model);
$sut->getInvoiceNumber();
@@ -235,9 +235,8 @@ class ConfigurableNumberGeneratorTest extends TestCase
$customer->setName(null);
$sut = $this->getSut($format);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), $customer, new InvoiceTemplate(), new InvoiceQuery());
$model->setInvoiceDate(new \DateTime());
$model->setCustomer($customer);
$model->setUser($user);
$sut->setModel($model);

View File

@@ -9,8 +9,11 @@
namespace App\Tests\Invoice\NumberGenerator;
use App\Entity\Customer;
use App\Entity\InvoiceTemplate;
use App\Invoice\NumberGenerator\DateNumberGenerator;
use App\Repository\InvoiceRepository;
use App\Repository\Query\InvoiceQuery;
use App\Tests\Invoice\DebugFormatter;
use App\Tests\Mocks\InvoiceModelFactoryFactory;
use PHPUnit\Framework\TestCase;
@@ -40,7 +43,7 @@ class DateNumberGeneratorTest extends TestCase
public function testGetInvoiceNumber()
{
$sut = $this->getSut(false, false);
$sut->setModel((new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter()));
$sut->setModel((new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), new Customer('foo'), new InvoiceTemplate(), new InvoiceQuery()));
$this->assertEquals(date('ymd'), $sut->getInvoiceNumber());
$this->assertEquals('date', $sut->getId());
@@ -49,7 +52,7 @@ class DateNumberGeneratorTest extends TestCase
public function testGetInvoiceNumberWithExisting()
{
$sut = $this->getSut(true, false);
$sut->setModel((new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter()));
$sut->setModel((new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), new Customer('foo'), new InvoiceTemplate(), new InvoiceQuery()));
$this->assertEquals(date('ymd-01'), $sut->getInvoiceNumber());
$this->assertEquals('date', $sut->getId());
@@ -58,7 +61,7 @@ class DateNumberGeneratorTest extends TestCase
public function testGetInvoiceNumberWithManyExisting()
{
$sut = $this->getSut(true, true);
$sut->setModel((new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter()));
$sut->setModel((new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), new Customer('foo'), new InvoiceTemplate(), new InvoiceQuery()));
$this->assertEquals(date('ymd-99'), $sut->getInvoiceNumber());
$this->assertEquals('date', $sut->getId());

View File

@@ -238,11 +238,8 @@ trait RendererTestTrait
$query->setEnd(new \DateTime());
$query->setProjects([$project, $project2]);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel($this->getFormatter());
$model->setCustomer($customer);
$model->setTemplate($template);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel($this->getFormatter(), $customer, $template, $query);
$model->addEntries($entries);
$model->setQuery($query);
$model->setUser($user);
$calculator = new DefaultCalculator();
@@ -326,11 +323,8 @@ trait RendererTestTrait
$query->setBegin(new \DateTime());
$query->setEnd(new \DateTime());
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel($this->getFormatter());
$model->setCustomer($customer);
$model->setTemplate($template);
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel($this->getFormatter(), $customer, $template, $query);
$model->addEntries($entries);
$model->setQuery($query);
$model->setUser($user);
$calculator = new DefaultCalculator();

View File

@@ -6612,11 +6612,6 @@ parameters:
count: 1
path: Invoice/Hydrator/InvoiceModelActivityHydratorTest.php
-
message: "#^Method App\\\\Tests\\\\Invoice\\\\Hydrator\\\\InvoiceModelCustomerHydratorTest\\:\\:assertModelStructure\\(\\) has no return type specified\\.$#"
count: 1
path: Invoice/Hydrator/InvoiceModelCustomerHydratorTest.php
-
message: "#^Method App\\\\Tests\\\\Invoice\\\\Hydrator\\\\InvoiceModelCustomerHydratorTest\\:\\:assertModelStructure\\(\\) has parameter \\$model with no value type specified in iterable type array\\.$#"
count: 1
@@ -6632,21 +6627,6 @@ parameters:
count: 1
path: Invoice/Hydrator/InvoiceModelCustomerHydratorTest.php
-
message: "#^Method App\\\\Tests\\\\Invoice\\\\Hydrator\\\\InvoiceModelCustomerHydratorTest\\:\\:testHydrate\\(\\) has no return type specified\\.$#"
count: 1
path: Invoice/Hydrator/InvoiceModelCustomerHydratorTest.php
-
message: "#^Method App\\\\Tests\\\\Invoice\\\\Hydrator\\\\InvoiceModelDefaultHydratorTest\\:\\:assertModelStructure\\(\\) has no return type specified\\.$#"
count: 1
path: Invoice/Hydrator/InvoiceModelDefaultHydratorTest.php
-
message: "#^Method App\\\\Tests\\\\Invoice\\\\Hydrator\\\\InvoiceModelDefaultHydratorTest\\:\\:assertModelStructure\\(\\) has parameter \\$hasProject with no type specified\\.$#"
count: 1
path: Invoice/Hydrator/InvoiceModelDefaultHydratorTest.php
-
message: "#^Method App\\\\Tests\\\\Invoice\\\\Hydrator\\\\InvoiceModelDefaultHydratorTest\\:\\:assertModelStructure\\(\\) has parameter \\$model with no value type specified in iterable type array\\.$#"
count: 1
@@ -6662,11 +6642,6 @@ parameters:
count: 1
path: Invoice/Hydrator/InvoiceModelDefaultHydratorTest.php
-
message: "#^Method App\\\\Tests\\\\Invoice\\\\Hydrator\\\\InvoiceModelDefaultHydratorTest\\:\\:testHydrate\\(\\) has no return type specified\\.$#"
count: 1
path: Invoice/Hydrator/InvoiceModelDefaultHydratorTest.php
-
message: "#^Method App\\\\Tests\\\\Invoice\\\\Hydrator\\\\InvoiceModelProjectHydratorTest\\:\\:assertModelStructure\\(\\) has no return type specified\\.$#"
count: 1
@@ -6722,21 +6697,6 @@ parameters:
count: 1
path: Invoice/InvoiceItemTest.php
-
message: "#^Method App\\\\Tests\\\\Invoice\\\\InvoiceModelTest\\:\\:testEmptyObject\\(\\) has no return type specified\\.$#"
count: 1
path: Invoice/InvoiceModelTest.php
-
message: "#^Method App\\\\Tests\\\\Invoice\\\\InvoiceModelTest\\:\\:testEmptyObjectThrowsExceptionOnNumberGenerator\\(\\) has no return type specified\\.$#"
count: 1
path: Invoice/InvoiceModelTest.php
-
message: "#^Method App\\\\Tests\\\\Invoice\\\\InvoiceModelTest\\:\\:testSetter\\(\\) has no return type specified\\.$#"
count: 1
path: Invoice/InvoiceModelTest.php
-
message: "#^Method App\\\\Tests\\\\Invoice\\\\NumberGenerator\\\\DateNumberGeneratorTest\\:\\:getSut\\(\\) has no return type specified\\.$#"
count: 1