diff --git a/UPGRADING.md b/UPGRADING.md index f6fa35a3..a120fcd6 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -10,7 +10,10 @@ Perform EACH version specific task between your version and the new one, otherwi ## [1.4](https://github.com/kevinpapst/kimai2/releases/tag/1.4) -[Update as usual](https://www.kimai.org/documentation/updates.html), nothing special for this release if you upgrade from 1.0 / 1.0.1. +### Possible BC breaks + +- Activate Javascript select component by default +- Switched to Symfony 4.3 event types, this could fail in plugins only if they didn't use the official constants for event names ## [1.3](https://github.com/kevinpapst/kimai2/releases/tag/1.3) diff --git a/composer.json b/composer.json index 214f3248..a59b8dee 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "gedmo/doctrine-extensions": "^2.4", "jms/metadata": "^2.0", "jms/serializer-bundle": "^3.2", - "kevinpapst/adminlte-bundle": "~2.6", + "kevinpapst/adminlte-bundle": "~3.0", "kimai/kimai2-composer": "^0.1", "mpdf/mpdf": "^7.1", "nelmio/api-doc-bundle": "^3.2", diff --git a/composer.lock b/composer.lock index 3dc3ef73..c655f3be 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "668ca17f66c2121beab3c867b7aa21f9", + "content-hash": "36497a607713888a9a39731a007a9b90", "packages": [ { "name": "beberlei/doctrineextensions", @@ -1070,16 +1070,16 @@ }, { "name": "doctrine/orm", - "version": "v2.6.3", + "version": "v2.6.4", "source": { "type": "git", "url": "https://github.com/doctrine/orm.git", - "reference": "434820973cadf2da2d66e7184be370084cc32ca8" + "reference": "b52ef5a1002f99ab506a5a2d6dba5a2c236c5f43" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/orm/zipball/434820973cadf2da2d66e7184be370084cc32ca8", - "reference": "434820973cadf2da2d66e7184be370084cc32ca8", + "url": "https://api.github.com/repos/doctrine/orm/zipball/b52ef5a1002f99ab506a5a2d6dba5a2c236c5f43", + "reference": "b52ef5a1002f99ab506a5a2d6dba5a2c236c5f43", "shasum": "" }, "require": { @@ -1094,9 +1094,8 @@ "symfony/console": "~3.0|~4.0" }, "require-dev": { - "doctrine/coding-standard": "^1.0", - "phpunit/phpunit": "^6.5", - "squizlabs/php_codesniffer": "^3.2", + "doctrine/coding-standard": "^5.0", + "phpunit/phpunit": "^7.5", "symfony/yaml": "~3.4|~4.0" }, "suggest": { @@ -1121,6 +1120,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -1129,10 +1132,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -1148,7 +1147,7 @@ "database", "orm" ], - "time": "2018-11-20T23:46:46+00:00" + "time": "2019-09-20T14:30:26+00:00" }, { "name": "doctrine/persistence", @@ -2596,16 +2595,16 @@ }, { "name": "jms/metadata", - "version": "2.0.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/schmittjoh/metadata.git", - "reference": "e918c3a65105f73b74d94a0837b9f7d611d5bf0c" + "reference": "8d8958103485c2cbdd9a9684c3869312ebdaf73a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/e918c3a65105f73b74d94a0837b9f7d611d5bf0c", - "reference": "e918c3a65105f73b74d94a0837b9f7d611d5bf0c", + "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/8d8958103485c2cbdd9a9684c3869312ebdaf73a", + "reference": "8d8958103485c2cbdd9a9684c3869312ebdaf73a", "shasum": "" }, "require": { @@ -2633,13 +2632,13 @@ "MIT" ], "authors": [ - { - "name": "Asmir Mustafic", - "email": "goetas@gmail.com" - }, { "name": "Johannes M. Schmitt", "email": "schmittjoh@gmail.com" + }, + { + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" } ], "description": "Class/method/property metadata management in PHP", @@ -2649,20 +2648,20 @@ "xml", "yaml" ], - "time": "2018-11-09T13:57:43+00:00" + "time": "2019-09-17T15:30:40+00:00" }, { "name": "jms/serializer", - "version": "3.2.0", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/schmittjoh/serializer.git", - "reference": "89fc2a7f53ae63b513e2339fdb6db6e49bfbc749" + "reference": "4c1e4296734385af7718ca71ec0febb4815b4a87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/89fc2a7f53ae63b513e2339fdb6db6e49bfbc749", - "reference": "89fc2a7f53ae63b513e2339fdb6db6e49bfbc749", + "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/4c1e4296734385af7718ca71ec0febb4815b4a87", + "reference": "4c1e4296734385af7718ca71ec0febb4815b4a87", "shasum": "" }, "require": { @@ -2702,7 +2701,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2733,7 +2732,7 @@ "serialization", "xml" ], - "time": "2019-09-04T10:17:24+00:00" + "time": "2019-09-20T14:24:07+00:00" }, { "name": "jms/serializer-bundle", @@ -2810,23 +2809,23 @@ }, { "name": "kevinpapst/adminlte-bundle", - "version": "2.8.5", + "version": "3.0", "source": { "type": "git", "url": "https://github.com/kevinpapst/AdminLTEBundle.git", - "reference": "12c5deaad9276458a2536da281732d70e5255441" + "reference": "d1e0d21b497b7bf864138aba4b645379e6b51b83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kevinpapst/AdminLTEBundle/zipball/12c5deaad9276458a2536da281732d70e5255441", - "reference": "12c5deaad9276458a2536da281732d70e5255441", + "url": "https://api.github.com/repos/kevinpapst/AdminLTEBundle/zipball/d1e0d21b497b7bf864138aba4b645379e6b51b83", + "reference": "d1e0d21b497b7bf864138aba4b645379e6b51b83", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/config": ">4.0", + "symfony/config": ">4.1", "symfony/dependency-injection": ">4.0", - "symfony/event-dispatcher": ">4.0", + "symfony/event-dispatcher": ">4.3", "symfony/http-foundation": ">4.0", "symfony/http-kernel": ">4.0", "symfony/options-resolver": ">4.0", @@ -2838,7 +2837,7 @@ "knplabs/knp-menu-bundle": "^2.2", "phpspec/prophecy": "^1.6", "phpstan/phpstan": "^0.11.8", - "phpstan/phpstan-phpunit": "^0.11.2", + "phpstan/phpstan-phpunit": "^0.11", "phpunit/phpunit": "^7.3", "symfony/framework-bundle": ">4.0" }, @@ -2871,7 +2870,7 @@ } ], "description": "Admin theme bundle for Symfony 4 based on AdminLTE 2.4.8 with FOSUserBundle support", - "time": "2019-08-08T08:09:47+00:00" + "time": "2019-09-25T16:11:41+00:00" }, { "name": "kimai/kimai2-composer", @@ -5459,16 +5458,16 @@ }, { "name": "symfony/flex", - "version": "v1.4.5", + "version": "v1.4.6", "source": { "type": "git", "url": "https://github.com/symfony/flex.git", - "reference": "4467ab35c82edebac58fe58c22cea166a805eb1f" + "reference": "133e649fdf08aeb8741be1ba955ccbe5cd17c696" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/flex/zipball/4467ab35c82edebac58fe58c22cea166a805eb1f", - "reference": "4467ab35c82edebac58fe58c22cea166a805eb1f", + "url": "https://api.github.com/repos/symfony/flex/zipball/133e649fdf08aeb8741be1ba955ccbe5cd17c696", + "reference": "133e649fdf08aeb8741be1ba955ccbe5cd17c696", "shasum": "" }, "require": { @@ -5504,7 +5503,7 @@ } ], "description": "Composer plugin for Symfony", - "time": "2019-07-19T08:59:18+00:00" + "time": "2019-09-19T14:55:57+00:00" }, { "name": "symfony/form", @@ -10080,16 +10079,16 @@ }, { "name": "phpstan/phpstan", - "version": "0.11.15", + "version": "0.11.16", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "1be5b3a706db16ac472a4c40ec03cf4c810b118d" + "reference": "635cf20f3b92ce34ee94a8d2f282d62eb9dc6e1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1be5b3a706db16ac472a4c40ec03cf4c810b118d", - "reference": "1be5b3a706db16ac472a4c40ec03cf4c810b118d", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/635cf20f3b92ce34ee94a8d2f282d62eb9dc6e1b", + "reference": "635cf20f3b92ce34ee94a8d2f282d62eb9dc6e1b", "shasum": "" }, "require": { @@ -10141,8 +10140,7 @@ "autoload": { "psr-4": { "PHPStan\\": [ - "src/", - "build/PHPStan" + "src/" ] } }, @@ -10151,7 +10149,7 @@ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", - "time": "2019-08-18T20:51:53+00:00" + "time": "2019-09-17T11:19:51+00:00" }, { "name": "phpstan/phpstan-doctrine", @@ -10548,16 +10546,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "3.1.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "e899757bb3df5ff6e95089132f32cd59aac2220a" + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e899757bb3df5ff6e95089132f32cd59aac2220a", - "reference": "e899757bb3df5ff6e95089132f32cd59aac2220a", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", "shasum": "" }, "require": { @@ -10593,7 +10591,7 @@ "keywords": [ "tokenizer" ], - "time": "2019-07-25T05:29:42+00:00" + "time": "2019-09-17T06:23:10+00:00" }, { "name": "phpunit/phpunit", diff --git a/src/Controller/DashboardController.php b/src/Controller/DashboardController.php index 4c303159..7c793fe4 100644 --- a/src/Controller/DashboardController.php +++ b/src/Controller/DashboardController.php @@ -88,7 +88,7 @@ class DashboardController extends AbstractController $event->addSection($row); } - $this->eventDispatcher->dispatch($event, DashboardEvent::DASHBOARD); + $this->eventDispatcher->dispatch($event); $sections = $event->getSections(); diff --git a/src/Controller/ProfileController.php b/src/Controller/ProfileController.php index a8c72821..956045c7 100644 --- a/src/Controller/ProfileController.php +++ b/src/Controller/ProfileController.php @@ -207,7 +207,7 @@ class ProfileController extends AbstractController { // we need to prepare the user preferences, which is done via an EventSubscriber $event = new PrepareUserEvent($profile); - $this->dispatcher->dispatch($event, PrepareUserEvent::PREPARE); + $this->dispatcher->dispatch($event); $original = []; foreach ($profile->getPreferences() as $preference) { @@ -303,7 +303,7 @@ class ProfileController extends AbstractController { // we need to prepare the user preferences, which is done via an EventSubscriber $event = new PrepareUserEvent($user); - $this->dispatcher->dispatch($event, PrepareUserEvent::PREPARE); + $this->dispatcher->dispatch($event); return $this->createForm( UserPreferencesForm::class, diff --git a/src/Controller/SystemConfigurationController.php b/src/Controller/SystemConfigurationController.php index 09d39fa0..8645a1e6 100644 --- a/src/Controller/SystemConfigurationController.php +++ b/src/Controller/SystemConfigurationController.php @@ -169,7 +169,7 @@ class SystemConfigurationController extends AbstractController $types = $this->getConfigurationTypes(); $event = new SystemConfigurationEvent($types); - $this->eventDispatcher->dispatch($event, SystemConfigurationEvent::CONFIGURE); + $this->eventDispatcher->dispatch($event); foreach ($event->getConfigurations() as $configs) { foreach ($configs->getConfiguration() as $config) { diff --git a/src/Event/ConfigureMainMenuEvent.php b/src/Event/ConfigureMainMenuEvent.php index 1f6fa6f5..5dd26fb2 100644 --- a/src/Event/ConfigureMainMenuEvent.php +++ b/src/Event/ConfigureMainMenuEvent.php @@ -19,7 +19,10 @@ use Symfony\Contracts\EventDispatcher\Event; */ final class ConfigureMainMenuEvent extends Event { - public const CONFIGURE = 'app.main_menu_configure'; + /** + * @deprecated since 1.4, will be removed with 2.0 + */ + public const CONFIGURE = ConfigureMainMenuEvent::class; /** * @var Request diff --git a/src/Event/DashboardEvent.php b/src/Event/DashboardEvent.php index 2b4205a2..f12ee5cf 100644 --- a/src/Event/DashboardEvent.php +++ b/src/Event/DashboardEvent.php @@ -15,7 +15,10 @@ use Symfony\Contracts\EventDispatcher\Event; final class DashboardEvent extends Event { - public const DASHBOARD = 'app.dashboard'; + /** + * @deprecated since 1.4, will be removed with 2.0 + */ + public const DASHBOARD = DashboardEvent::class; /** * @var User diff --git a/src/Event/PrepareUserEvent.php b/src/Event/PrepareUserEvent.php index 706b3092..40245b82 100644 --- a/src/Event/PrepareUserEvent.php +++ b/src/Event/PrepareUserEvent.php @@ -17,7 +17,10 @@ use Symfony\Contracts\EventDispatcher\Event; */ final class PrepareUserEvent extends Event { - public const PREPARE = 'app.prepare_user'; + /** + * @deprecated since 1.4, will be removed with 2.0 + */ + public const PREPARE = PrepareUserEvent::class; /** * @var User diff --git a/src/Event/SystemConfigurationEvent.php b/src/Event/SystemConfigurationEvent.php index d845997a..222b769a 100644 --- a/src/Event/SystemConfigurationEvent.php +++ b/src/Event/SystemConfigurationEvent.php @@ -17,7 +17,10 @@ use Symfony\Contracts\EventDispatcher\Event; */ final class SystemConfigurationEvent extends Event { - public const CONFIGURE = 'app.system_configuration'; + /** + * @deprecated since 1.4, will be removed with 2.0 + */ + public const CONFIGURE = SystemConfigurationEvent::class; /** * @var SystemConfiguration[] diff --git a/src/Event/UserPreferenceEvent.php b/src/Event/UserPreferenceEvent.php index 8b42f197..89bf7ba8 100644 --- a/src/Event/UserPreferenceEvent.php +++ b/src/Event/UserPreferenceEvent.php @@ -18,7 +18,10 @@ use Symfony\Contracts\EventDispatcher\Event; */ final class UserPreferenceEvent extends Event { - public const CONFIGURE = 'app.user_preferences'; + /** + * @deprecated since 1.4, will be removed with 2.0 + */ + public const CONFIGURE = UserPreferenceEvent::class; /** * @var User diff --git a/src/EventSubscriber/MenuBuilderSubscriber.php b/src/EventSubscriber/MenuBuilderSubscriber.php index e0d30972..567d2cba 100644 --- a/src/EventSubscriber/MenuBuilderSubscriber.php +++ b/src/EventSubscriber/MenuBuilderSubscriber.php @@ -11,7 +11,6 @@ namespace App\EventSubscriber; use App\Event\ConfigureMainMenuEvent; use KevinPapst\AdminLTEBundle\Event\SidebarMenuEvent; -use KevinPapst\AdminLTEBundle\Event\ThemeEvents; use KevinPapst\AdminLTEBundle\Model\MenuItemModel; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -48,7 +47,7 @@ class MenuBuilderSubscriber implements EventSubscriberInterface public static function getSubscribedEvents(): array { return [ - ThemeEvents::THEME_SIDEBAR_SETUP_MENU => ['onSetupNavbar', 100], + SidebarMenuEvent::class => ['onSetupNavbar', 100], ]; } @@ -72,7 +71,7 @@ class MenuBuilderSubscriber implements EventSubscriberInterface new MenuItemModel('system', 'menu.system', '') ); - $this->eventDispatcher->dispatch($menuEvent, ConfigureMainMenuEvent::CONFIGURE); + $this->eventDispatcher->dispatch($menuEvent); if ($menuEvent->getAdminMenu()->hasChildren()) { $event->addItem(new MenuItemModel('admin', 'menu.admin', '')); diff --git a/src/EventSubscriber/UserPreferenceSubscriber.php b/src/EventSubscriber/UserPreferenceSubscriber.php index 75a901b8..33a31d4a 100644 --- a/src/EventSubscriber/UserPreferenceSubscriber.php +++ b/src/EventSubscriber/UserPreferenceSubscriber.php @@ -163,7 +163,7 @@ class UserPreferenceSubscriber implements EventSubscriberInterface } $event = new UserPreferenceEvent($user, $this->getDefaultPreferences($user)); - $this->eventDispatcher->dispatch($event, UserPreferenceEvent::CONFIGURE); + $this->eventDispatcher->dispatch($event); foreach ($event->getPreferences() as $preference) { /* @var UserPreference[] $prefs */ diff --git a/src/EventSubscriber/UserProfileSubscriber.php b/src/EventSubscriber/UserProfileSubscriber.php index 8040fb57..b675d318 100644 --- a/src/EventSubscriber/UserProfileSubscriber.php +++ b/src/EventSubscriber/UserProfileSubscriber.php @@ -62,7 +62,7 @@ class UserProfileSubscriber implements EventSubscriberInterface $user = $this->storage->getToken()->getUser(); $event = new PrepareUserEvent($user); - $this->eventDispatcher->dispatch($event, PrepareUserEvent::PREPARE); + $this->eventDispatcher->dispatch($event); } /** diff --git a/src/Repository/TimesheetRepository.php b/src/Repository/TimesheetRepository.php index 749fb58a..5251d19a 100644 --- a/src/Repository/TimesheetRepository.php +++ b/src/Repository/TimesheetRepository.php @@ -750,7 +750,7 @@ class TimesheetRepository extends EntityRepository ->orderBy('t.end', 'DESC') ; - return $this->getHydratedResultsByQuery($qb, false); + return $this->getHydratedResultsByQuery($qb, true); } /** diff --git a/tests/Event/PrepareUserEventTest.php b/tests/Event/PrepareUserEventTest.php index 41a1866c..8627f8bd 100644 --- a/tests/Event/PrepareUserEventTest.php +++ b/tests/Event/PrepareUserEventTest.php @@ -22,7 +22,7 @@ class PrepareUserEventTest extends TestCase { $user = new User(); $sut = new PrepareUserEvent($user); - $this->assertEquals('app.prepare_user', PrepareUserEvent::PREPARE); + $this->assertEquals(PrepareUserEvent::class, PrepareUserEvent::PREPARE); $this->assertSame($user, $sut->getUser()); } }