diff --git a/LICENSE b/LICENSE index aa5d828..eee7a09 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016-present Mark Scherer +Copyright (c) 2019-present Mark Scherer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 2e0af23..88dfc4e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# CakePHP DTO plugin +# DTO Generator for PHP [![Build Status](https://travis-ci.org/dereuromark/cakephp-dto.svg?branch=master)](https://travis-ci.org/dereuromark/cakephp-dto) [![codecov](https://img.shields.io/codecov/c/github/dereuromark/cakephp-dto/master.svg)](https://codecov.io/gh/dereuromark/cakephp-dto) @@ -26,7 +26,7 @@ For more see [Motivation and Background](/docs/Motivation.md). This plugin will provide you with a tool to quickly generate custom and optimized DTOs for your special use cases. -This branch is for use with **CakePHP 4.0+**. +This branch is for use with **PHP 7.2+**. ## Examples @@ -44,15 +44,9 @@ You can install this plugin into your CakePHP application using [Composer](https The recommended way to install is: ``` -composer require dereuromark/cakephp-dto +composer require dereuromark/dto ``` -Then load the plugin with the following command: -``` -bin/cake plugin load CakeDto -b -``` -The bootstrap is needed for the TwigView events to be set up. If you already included TwigView, you might not need the bootstrap. - ## Usage diff --git a/composer.json b/composer.json index 9998ea3..3336566 100644 --- a/composer.json +++ b/composer.json @@ -1,9 +1,9 @@ { "name": "dereuromark/cakephp-dto", - "description": "CakePHP DTO Plugin", - "type": "cakephp-plugin", - "keywords": ["cakephp", "dto", "plugin"], - "homepage": "https://github.com/dereuromark/cakephp-dto/", + "description": "DTO Generator for PHP", + "type": "library", + "keywords": ["php", "dto", "generator"], + "homepage": "https://github.com/dereuromark/dto/", "license": "MIT", "authors": [ { @@ -18,24 +18,25 @@ }, { "name": "Other contributors", - "homepage": "https://github.com/dereuromark/cakephp-dto/graphs/contributors", + "homepage": "https://github.com/dereuromark/dto/graphs/contributors", "role": "Developer" } ], "support": { - "issues": "https://github.com/dereuromark/cakephp-dto/issues", - "source": "https://github.com/dereuromark/cakephp-dto/" + "issues": "https://github.com/dereuromark/dto/issues", + "source": "https://github.com/dereuromark/dto/" }, "require": { + "ext-json": "*", "php": ">=7.2", - "cakephp/cakephp": "4.x-dev as 4.0.0", - "wyrihaximus/twig-view": "dev-master", + "twig/twig": "^2.10", "sebastian/diff": "^3.0" }, "require-dev": { "ext-dom": "*", "ext-libxml": "*", "nette/neon": "^2.4", + "cakephp/collection": "4.x-dev as 4.0.0", "fig-r/psr2r-sniffer": "dev-master" }, "suggest": { @@ -43,15 +44,13 @@ }, "autoload": { "psr-4": { - "CakeDto\\": "src/" + "Dto\\": "src/" } }, "autoload-dev": { "psr-4": { - "CakeDto\\Test\\": "tests/", - "Cake\\Test\\": "vendor/cakephp/cakephp/tests/", - "TestApp\\": "tests/test_app/src/", - "Sandbox\\": "tests/test_app/plugins/Sandbox/src/" + "Dto\\Test\\": "tests/", + "TestApp\\": "tests/test_app/src/" } }, "scripts": { diff --git a/config/bootstrap.php b/config/bootstrap.php index b707cd0..7933b8a 100644 --- a/config/bootstrap.php +++ b/config/bootstrap.php @@ -3,5 +3,5 @@ use WyriHaximus\TwigView\Event\ExtensionsListener; use WyriHaximus\TwigView\Event\TokenParsersListener; -EventManager::instance()->on(new ExtensionsListener()); -EventManager::instance()->on(new TokenParsersListener()); +//EventManager::instance()->on(new ExtensionsListener()); +//EventManager::instance()->on(new TokenParsersListener()); diff --git a/docs/README.md b/docs/README.md index 224223c..dd279c0 100644 --- a/docs/README.md +++ b/docs/README.md @@ -276,7 +276,7 @@ Objects, which are not DTOs or Collections, can get lost here. If you have value objects (especially immutable ones), implement the `FromArrayToArrayInterface` here: ```php -use CakeDto\Dto\FromArrayToArrayInterface; +use Dto\Dto\FromArrayToArrayInterface; final class Paint implements FromArrayToArrayInterface {} ``` diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 3a88acc..af2a2ba 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -15,7 +15,7 @@ - + tests/TestCase/ diff --git a/src/Console/Io.php b/src/Console/Io.php index cf13945..4d4515e 100644 --- a/src/Console/Io.php +++ b/src/Console/Io.php @@ -1,5 +1,5 @@ count()) { $values = $this->transformCollectiontoArray($value, $values, $key, $touched ? 'touchedToArray' : 'toArray', $type); } elseif ($this->_metadata[$field]['serializable']) { - /** @var \CakeDto\Dto\FromArrayToArrayInterface $value */ + /** @var \Dto\Dto\FromArrayToArrayInterface $value */ $values[$key] = $value->toArray(); } elseif ($this->_metadata[$field]['toArray']) { // This will not be transformable in the other direction - /** @var \CakeDto\Dto\FromArrayToArrayInterface $value */ + /** @var \Dto\Dto\FromArrayToArrayInterface $value */ $values[$key] = $value->toArray(); } else { $values[$key] = $value; @@ -278,7 +278,7 @@ protected function createCakeCollection($elementType, $arrayObject, $ignoreMissi } if (array_values($arrayElement) !== $arrayElement) { - /** @var \CakeDto\Dto\Dto $dto */ + /** @var \Dto\Dto\Dto $dto */ $dto = new $elementType($arrayElement, $ignoreMissing, $type); $collection = $collection->appendItem($dto); @@ -286,7 +286,7 @@ protected function createCakeCollection($elementType, $arrayObject, $ignoreMissi } foreach ($arrayElement as $arrayElementItem) { - /** @var \CakeDto\Dto\Dto $dto */ + /** @var \Dto\Dto\Dto $dto */ $dto = new $elementType($arrayElementItem, $ignoreMissing, $type); $collection = $collection->appendItem($dto); } @@ -301,10 +301,10 @@ protected function createCakeCollection($elementType, $arrayObject, $ignoreMissi * @param bool $ignoreMissing * @param string $type * - * @return \CakeDto\Dto\Dto + * @return \Dto\Dto\Dto */ protected function createDto($field, $value, $ignoreMissing, $type) { - /** @var \CakeDto\Dto\AbstractDto $dto */ + /** @var \Dto\Dto\AbstractDto $dto */ $className = $this->_metadata[$field]['type']; if (is_array($value)) { @@ -318,10 +318,10 @@ protected function createDto($field, $value, $ignoreMissing, $type) { * @param string $field * @param mixed $value * - * @return \CakeDto\Dto\Dto + * @return \Dto\Dto\Dto */ protected function createObject($field, $value) { - /** @var \CakeDto\Dto\FromArrayToArrayInterface $className */ + /** @var \Dto\Dto\FromArrayToArrayInterface $className */ $className = $this->_metadata[$field]['type']; if (is_array($value)) { @@ -350,7 +350,7 @@ protected function createCollection($collectionType, $elementType, $arrayObject, } if (array_values($arrayElement) !== $arrayElement) { - /** @var \CakeDto\Dto\Dto $dto */ + /** @var \Dto\Dto\Dto $dto */ $dto = new $elementType($arrayElement, $ignoreMissing, $type); $collection->append($dto); @@ -358,7 +358,7 @@ protected function createCollection($collectionType, $elementType, $arrayObject, } foreach ($arrayElement as $arrayElementItem) { - /** @var \CakeDto\Dto\Dto $dto */ + /** @var \Dto\Dto\Dto $dto */ $dto = new $elementType($arrayElementItem, $ignoreMissing, $type); $collection->append($dto); } @@ -385,7 +385,7 @@ protected function createArrayCollection($elementType, $arrayObject, $ignoreMiss } if (array_values($arrayElement) !== $arrayElement) { - /** @var \CakeDto\Dto\Dto $dto */ + /** @var \Dto\Dto\Dto $dto */ $dto = new $elementType($arrayElement, $ignoreMissing, $type); $collection = $this->addValueToArrayCollection($collection, $dto, $arrayElement, $index, $key); @@ -393,7 +393,7 @@ protected function createArrayCollection($elementType, $arrayObject, $ignoreMiss } foreach ($arrayElement as $arrayElementItem) { - /** @var \CakeDto\Dto\Dto $dto */ + /** @var \Dto\Dto\Dto $dto */ $dto = new $elementType($arrayElementItem, $ignoreMissing, $type); $collection = $this->addValueToArrayCollection($collection, $dto, $arrayElement, $index, $key); } diff --git a/src/Dto/FromArrayToArrayInterface.php b/src/Dto/FromArrayToArrayInterface.php index d0a8084..45d61b5 100644 --- a/src/Dto/FromArrayToArrayInterface.php +++ b/src/Dto/FromArrayToArrayInterface.php @@ -1,6 +1,6 @@ _compareBasePath . $path; + } + + if ($this->_updateComparisons === null) { + $this->_updateComparisons = (bool)getenv('UPDATE_TEST_COMPARISON_FILES'); + } + + if ($this->_updateComparisons) { + file_put_contents($path, $result); + } + + $expected = file_get_contents($path); + $this->assertStringContainsString($expected, $result); + } +} diff --git a/src/View/DtoView.php b/src/View/DtoView.php index 8802c91..ee5e129 100644 --- a/src/View/DtoView.php +++ b/src/View/DtoView.php @@ -1,5 +1,5 @@ _start($count); - - $count = (int)$count ?: 1; - for ($i = 0; $i < $count; $i++) { - $this->_runArrays(); - } - - $this->_end(); - } - - /** - * @param int|null $count - * @return int|null - */ - public function dtos($count = null) { - $this->_start($count); - - $count = (int)$count ?: 1; - for ($i = 0; $i < $count; $i++) { - $this->_runDtos(); - } - - $this->_end(); - } - - /** - * @return void - */ - protected function _runArrays() { - $array = []; - $array['foo']['bar'] = 'x'; - $array['baz']['bar'] = 'x'; - - $x = $array['baz']['bar']; - } - - /** - * @return void - */ - protected function _runDtos() { - $car = new CarDto(); - $car2 = new CarDto(); - - $x = $car2->getDistanceTravelled(); - } - - /** - * @param int|null $count - * @return void - */ - protected function _start($count) { - $current = DebugMemory::getCurrent(); - $peak = DebugMemory::getPeak(); - - $count = (int)$count ?: 1; - - $this->out('Memory: ' . Number::toReadableSize($current) . ' | Peak: ' . Number::toReadableSize($peak)); - - $this->out('... Starting (' . $count . ' runs)'); - - DebugTimer::start('dto'); - } - - /** - * @return void - */ - protected function _end() { - DebugTimer::stop('dto'); - - $this->out('... Stopped'); - - $current = DebugMemory::getCurrent(); - $peak = DebugMemory::getPeak(); - - $this->out('Memory: ' . Number::toReadableSize($current) . ' | Peak: ' . Number::toReadableSize($peak)); - - $time = DebugTimer::elapsedTime('dto'); - $this->warn(Number::format($time) . 's'); - } - - /** - * @return \Cake\Console\ConsoleOptionParser - */ - public function getOptionParser() { - $parser = parent::getOptionParser(); - - $parser - ->addSubcommand('arrays') - ->addSubcommand('dtos') - ->addSubcommand('immutable'); - - return $parser; - } - -} diff --git a/tests/benchmark/README.md b/tests/benchmark/README.md deleted file mode 100644 index 522c7b4..0000000 --- a/tests/benchmark/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Benchmark Shell - -Copy over the shell into the plugin's `src/Shell/` dir, or into the one in your app (But then fix `namespace CakeDto\Shell;` to `namespace App\Shell;`). - -Then run it as -``` -bin/cake dto_benchmark arrays 10000 - -bin/cake dto_benchmark dtos 10000 -``` - -Adjust the `10000` if needed. - -## Better to use in real life -The results of doing the same operation again multiple times is often not too helpful. -So best to just using them in a project and see what kind of impact actual use cases make. diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 94922b8..1d1e397 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -4,13 +4,6 @@ define('DS', DIRECTORY_SEPARATOR); } define('ROOT', dirname(__DIR__)); -define('APP_DIR', 'src'); - -define('APP', rtrim(sys_get_temp_dir(), DS) . DS . APP_DIR . DS); -if (!is_dir(APP)) { - mkdir(APP, 0770, true); -} - define('TMP', ROOT . DS . 'tmp' . DS); if (!is_dir(TMP)) { mkdir(TMP, 0770, true); @@ -21,29 +14,7 @@ define('LOGS', TMP . 'logs' . DS); define('CACHE', TMP . 'cache' . DS); -define('CAKE_CORE_INCLUDE_PATH', ROOT . '/vendor/cakephp/cakephp'); -define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS); -define('CAKE', CORE_PATH . APP_DIR . DS); - require dirname(__DIR__) . '/vendor/autoload.php'; -require CORE_PATH . 'config/bootstrap.php'; require CONFIG . 'bootstrap.php'; -Cake\Core\Configure::write('App', [ - 'namespace' => 'App', - 'encoding' => 'utf-8', - 'paths' => [ - 'templates' => [ - ROOT . DS . 'templates' . DS, - ROOT . DS . 'tests' . DS . 'test_app' . DS . 'templates' . DS - ], - ] -]); - -Cake\Core\Configure::write('CakeDto', [ -]); - -Cake\Core\Configure::write('debug', true); - -Cake\Core\Plugin::getCollection()->add(new CakeDto\Plugin()); -//Cake\Core\Plugin::load('WyriHaximus/TwigView', ['path' => ROOT . DS . 'vendor/wyrihaximus/twig-view/', 'autoload' => true, 'bootstrap' => true]); +//Cake\Core\Configure::write('CakeDto', []); diff --git a/tests/generate.php b/tests/generate.php index 5160bc9..01f242b 100644 --- a/tests/generate.php +++ b/tests/generate.php @@ -2,11 +2,11 @@ require 'bootstrap.php'; -use CakeDto\Console\Io; -use CakeDto\Engine\XmlEngine; -use CakeDto\Generator\Builder; -use CakeDto\Generator\Generator; -use CakeDto\View\Renderer; +use Dto\Console\Io; +use Dto\Engine\XmlEngine; +use Dto\Generator\Builder; +use Dto\Generator\Generator; +use Dto\View\Renderer; use Cake\Console\ConsoleIo; use Cake\Console\ConsoleOutput; use Cake\Core\Configure; diff --git a/tests/test_app/plugins/Sandbox/src/Dto/Github/BaseDto.php b/tests/test_app/plugins/Sandbox/src/Dto/Github/BaseDto.php index d65714c..e954a98 100644 --- a/tests/test_app/plugins/Sandbox/src/Dto/Github/BaseDto.php +++ b/tests/test_app/plugins/Sandbox/src/Dto/Github/BaseDto.php @@ -14,7 +14,7 @@ * @property \Sandbox\Dto\Github\UserDto $user * @property \Sandbox\Dto\Github\RepoDto $repo */ -class BaseDto extends \CakeDto\Dto\AbstractDto { +class BaseDto extends \Dto\Dto\AbstractDto { public const FIELD_REF = 'ref'; public const FIELD_SHA = 'sha'; diff --git a/tests/test_app/plugins/Sandbox/src/Dto/Github/HeadDto.php b/tests/test_app/plugins/Sandbox/src/Dto/Github/HeadDto.php index 089c9e2..48b6475 100644 --- a/tests/test_app/plugins/Sandbox/src/Dto/Github/HeadDto.php +++ b/tests/test_app/plugins/Sandbox/src/Dto/Github/HeadDto.php @@ -14,7 +14,7 @@ * @property \Sandbox\Dto\Github\UserDto $user * @property \Sandbox\Dto\Github\RepoDto $repo */ -class HeadDto extends \CakeDto\Dto\AbstractDto { +class HeadDto extends \Dto\Dto\AbstractDto { public const FIELD_REF = 'ref'; public const FIELD_SHA = 'sha'; diff --git a/tests/test_app/plugins/Sandbox/src/Dto/Github/LabelDto.php b/tests/test_app/plugins/Sandbox/src/Dto/Github/LabelDto.php index 44efb6f..9c58018 100644 --- a/tests/test_app/plugins/Sandbox/src/Dto/Github/LabelDto.php +++ b/tests/test_app/plugins/Sandbox/src/Dto/Github/LabelDto.php @@ -12,7 +12,7 @@ * @property string|null $name * @property string|null $color */ -class LabelDto extends \CakeDto\Dto\AbstractDto { +class LabelDto extends \Dto\Dto\AbstractDto { public const FIELD_NAME = 'name'; public const FIELD_COLOR = 'color'; diff --git a/tests/test_app/plugins/Sandbox/src/Dto/Github/PullRequestDto.php b/tests/test_app/plugins/Sandbox/src/Dto/Github/PullRequestDto.php index 5b0e458..86e10ee 100644 --- a/tests/test_app/plugins/Sandbox/src/Dto/Github/PullRequestDto.php +++ b/tests/test_app/plugins/Sandbox/src/Dto/Github/PullRequestDto.php @@ -20,7 +20,7 @@ * @property \Sandbox\Dto\Github\HeadDto|null $head * @property \Sandbox\Dto\Github\BaseDto|null $base */ -class PullRequestDto extends \CakeDto\Dto\AbstractDto { +class PullRequestDto extends \Dto\Dto\AbstractDto { public const FIELD_URL = 'url'; public const FIELD_NUMBER = 'number'; diff --git a/tests/test_app/plugins/Sandbox/src/Dto/Github/RepoDto.php b/tests/test_app/plugins/Sandbox/src/Dto/Github/RepoDto.php index 1be60ab..058e88f 100644 --- a/tests/test_app/plugins/Sandbox/src/Dto/Github/RepoDto.php +++ b/tests/test_app/plugins/Sandbox/src/Dto/Github/RepoDto.php @@ -14,7 +14,7 @@ * @property bool $private * @property \Sandbox\Dto\Github\UserDto $owner */ -class RepoDto extends \CakeDto\Dto\AbstractDto { +class RepoDto extends \Dto\Dto\AbstractDto { public const FIELD_NAME = 'name'; public const FIELD_HTML_URL = 'html_url'; diff --git a/tests/test_app/plugins/Sandbox/src/Dto/Github/UserDto.php b/tests/test_app/plugins/Sandbox/src/Dto/Github/UserDto.php index 047bf6c..fa95467 100644 --- a/tests/test_app/plugins/Sandbox/src/Dto/Github/UserDto.php +++ b/tests/test_app/plugins/Sandbox/src/Dto/Github/UserDto.php @@ -13,7 +13,7 @@ * @property string $html_url * @property string $type */ -class UserDto extends \CakeDto\Dto\AbstractDto { +class UserDto extends \Dto\Dto\AbstractDto { public const FIELD_LOGIN = 'login'; public const FIELD_HTML_URL = 'html_url'; diff --git a/tests/test_app/plugins/Sandbox/src/Dto/Jira/IssueDto.php b/tests/test_app/plugins/Sandbox/src/Dto/Jira/IssueDto.php index 39de1d7..1e3d59a 100644 --- a/tests/test_app/plugins/Sandbox/src/Dto/Jira/IssueDto.php +++ b/tests/test_app/plugins/Sandbox/src/Dto/Jira/IssueDto.php @@ -16,7 +16,7 @@ * @property string $summary * @property string|null $version */ -class IssueDto extends \CakeDto\Dto\AbstractDto { +class IssueDto extends \Dto\Dto\AbstractDto { public const FIELD_ID = 'id'; public const FIELD_KEY = 'key'; diff --git a/tests/test_app/src/Dto/ArticleDto.php b/tests/test_app/src/Dto/ArticleDto.php index 2772761..b6735f8 100644 --- a/tests/test_app/src/Dto/ArticleDto.php +++ b/tests/test_app/src/Dto/ArticleDto.php @@ -16,7 +16,7 @@ * @property \TestApp\Dto\TagDto[] $tags * @property string[] $meta */ -class ArticleDto extends \CakeDto\Dto\AbstractImmutableDto { +class ArticleDto extends \Dto\Dto\AbstractImmutableDto { const FIELD_ID = 'id'; const FIELD_AUTHOR = 'author'; diff --git a/tests/test_app/src/Dto/AuthorDto.php b/tests/test_app/src/Dto/AuthorDto.php index 24abb55..48d651b 100644 --- a/tests/test_app/src/Dto/AuthorDto.php +++ b/tests/test_app/src/Dto/AuthorDto.php @@ -13,7 +13,7 @@ * @property string $name * @property string|null $email */ -class AuthorDto extends \CakeDto\Dto\AbstractImmutableDto { +class AuthorDto extends \Dto\Dto\AbstractImmutableDto { const FIELD_ID = 'id'; const FIELD_NAME = 'name'; diff --git a/tests/test_app/src/Dto/BookDto.php b/tests/test_app/src/Dto/BookDto.php index 94b5fbf..93c227a 100644 --- a/tests/test_app/src/Dto/BookDto.php +++ b/tests/test_app/src/Dto/BookDto.php @@ -11,7 +11,7 @@ * * @property \TestApp\Dto\PageDto[]|\Cake\Collection\Collection $pages */ -class BookDto extends \CakeDto\Dto\AbstractImmutableDto { +class BookDto extends \Dto\Dto\AbstractImmutableDto { const FIELD_PAGES = 'pages'; diff --git a/tests/test_app/src/Dto/CarDto.php b/tests/test_app/src/Dto/CarDto.php index 42170c1..89c2adc 100644 --- a/tests/test_app/src/Dto/CarDto.php +++ b/tests/test_app/src/Dto/CarDto.php @@ -17,7 +17,7 @@ * @property \Cake\I18n\FrozenDate|null $manufactured * @property \TestApp\Dto\OwnerDto|null $owner */ -class CarDto extends \CakeDto\Dto\AbstractDto { +class CarDto extends \Dto\Dto\AbstractDto { const FIELD_COLOR = 'color'; const FIELD_IS_NEW = 'isNew'; diff --git a/tests/test_app/src/Dto/CarsDto.php b/tests/test_app/src/Dto/CarsDto.php index dc0f86e..ca7f4ae 100644 --- a/tests/test_app/src/Dto/CarsDto.php +++ b/tests/test_app/src/Dto/CarsDto.php @@ -11,7 +11,7 @@ * * @property \TestApp\Dto\CarDto[]|\ArrayObject $cars */ -class CarsDto extends \CakeDto\Dto\AbstractDto { +class CarsDto extends \Dto\Dto\AbstractDto { const FIELD_CARS = 'cars'; diff --git a/tests/test_app/src/Dto/CustomerAccountDto.php b/tests/test_app/src/Dto/CustomerAccountDto.php index 16a6b3a..7c3d1b6 100644 --- a/tests/test_app/src/Dto/CustomerAccountDto.php +++ b/tests/test_app/src/Dto/CustomerAccountDto.php @@ -12,7 +12,7 @@ * @property string $customerName * @property int|null $birthYear */ -class CustomerAccountDto extends \CakeDto\Dto\AbstractDto { +class CustomerAccountDto extends \Dto\Dto\AbstractDto { const FIELD_CUSTOMER_NAME = 'customerName'; const FIELD_BIRTH_YEAR = 'birthYear'; diff --git a/tests/test_app/src/Dto/EmptyOneDto.php b/tests/test_app/src/Dto/EmptyOneDto.php index 6896b12..000c7ad 100644 --- a/tests/test_app/src/Dto/EmptyOneDto.php +++ b/tests/test_app/src/Dto/EmptyOneDto.php @@ -10,7 +10,7 @@ * EmptyOne DTO * */ -class EmptyOneDto extends \CakeDto\Dto\AbstractDto { +class EmptyOneDto extends \Dto\Dto\AbstractDto { /** diff --git a/tests/test_app/src/Dto/MutableMetaDto.php b/tests/test_app/src/Dto/MutableMetaDto.php index a32badb..b57f39c 100644 --- a/tests/test_app/src/Dto/MutableMetaDto.php +++ b/tests/test_app/src/Dto/MutableMetaDto.php @@ -12,7 +12,7 @@ * @property string $title * @property string[] $meta */ -class MutableMetaDto extends \CakeDto\Dto\AbstractDto { +class MutableMetaDto extends \Dto\Dto\AbstractDto { const FIELD_TITLE = 'title'; const FIELD_META = 'meta'; diff --git a/tests/test_app/src/Dto/OwnerDto.php b/tests/test_app/src/Dto/OwnerDto.php index 8e28053..b7d0d6e 100644 --- a/tests/test_app/src/Dto/OwnerDto.php +++ b/tests/test_app/src/Dto/OwnerDto.php @@ -12,7 +12,7 @@ * @property string|null $name * @property int|null $birthYear */ -class OwnerDto extends \CakeDto\Dto\AbstractDto { +class OwnerDto extends \Dto\Dto\AbstractDto { const FIELD_NAME = 'name'; const FIELD_BIRTH_YEAR = 'birthYear'; diff --git a/tests/test_app/src/Dto/PageDto.php b/tests/test_app/src/Dto/PageDto.php index 90f9a54..ce5c946 100644 --- a/tests/test_app/src/Dto/PageDto.php +++ b/tests/test_app/src/Dto/PageDto.php @@ -12,7 +12,7 @@ * @property int $number * @property string|null $content */ -class PageDto extends \CakeDto\Dto\AbstractImmutableDto { +class PageDto extends \Dto\Dto\AbstractImmutableDto { const FIELD_NUMBER = 'number'; const FIELD_CONTENT = 'content'; diff --git a/tests/test_app/src/Dto/TagDto.php b/tests/test_app/src/Dto/TagDto.php index a864e0c..43a7867 100644 --- a/tests/test_app/src/Dto/TagDto.php +++ b/tests/test_app/src/Dto/TagDto.php @@ -13,7 +13,7 @@ * @property string $name * @property int $weight */ -class TagDto extends \CakeDto\Dto\AbstractImmutableDto { +class TagDto extends \Dto\Dto\AbstractImmutableDto { const FIELD_ID = 'id'; const FIELD_NAME = 'name'; diff --git a/tests/test_app/src/Dto/TransactionDto.php b/tests/test_app/src/Dto/TransactionDto.php index 0edc8f2..f352538 100644 --- a/tests/test_app/src/Dto/TransactionDto.php +++ b/tests/test_app/src/Dto/TransactionDto.php @@ -14,7 +14,7 @@ * @property string|null $comment * @property \Cake\I18n\FrozenDate $created */ -class TransactionDto extends \CakeDto\Dto\AbstractImmutableDto { +class TransactionDto extends \Dto\Dto\AbstractImmutableDto { const FIELD_CUSTOMER_ACCOUNT = 'customerAccount'; const FIELD_VALUE = 'value'; diff --git a/tests/test_app/src/ValueObject/Paint.php b/tests/test_app/src/ValueObject/Paint.php index 90b6100..25b925c 100644 --- a/tests/test_app/src/ValueObject/Paint.php +++ b/tests/test_app/src/ValueObject/Paint.php @@ -2,7 +2,7 @@ namespace TestApp\ValueObject; -use CakeDto\Dto\FromArrayToArrayInterface; +use Dto\Dto\FromArrayToArrayInterface; /** * Subclassing a Value Object is rare, so we cut out this scenario