<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" >

  <channel>
    <title><![CDATA[Комментарии / Профиль webdev12]]></title>
    <link>https://habr.com/ru/users/webdev12/comments/</link>
    <description><![CDATA[Хабр: комментарии пользователя webdev12]]></description>
    <language>ru</language>
    <managingEditor>editor@habr.com</managingEditor>
    <generator>habr.com</generator>
    <pubDate>Sat, 02 May 2026 11:22:39 GMT</pubDate>
    
    
      <image>
        <link>https://habr.com/ru/</link>
        <url>https://habrastorage.org/webt/ym/el/wk/ymelwk3zy1gawz4nkejl_-ammtc.png</url>
        <title>Хабр</title>
      </image>
    

    
      

      
        
  
    <item>
      <title>01.02.2020 07:03:22 </title>
      <guid isPermaLink="true">https://habr.com/ru/articles/476102/#comment_21218042</guid>
      <link>https://habr.com/ru/articles/476102/#comment_21218042</link>
      <description><![CDATA[<p>Еще вам в копилку, посмотреть, как у них устроено: <a href="https://packagist.org/packages/justinrainbow/json-schema" rel="nofollow">https://packagist.org/packages/justinrainbow/json-schema</a><br>
или такое: <a href="https://github.com/cweiske/jsonmapper" rel="nofollow">https://github.com/cweiske/jsonmapper</a><br>
или такое: <a href="https://packagist.org/packages/mathielen/import-engine" rel="nofollow">https://packagist.org/packages/mathielen/import-engine</a></p>]]></description>
      <pubDate>Sat, 01 Feb 2020 07:03:22 GMT</pubDate>
      <dc:creator><![CDATA[]]></dc:creator>
    </item>
  

  
    <item>
      <title>29.11.2019 16:55:01 </title>
      <guid isPermaLink="true">https://habr.com/ru/articles/476102/#comment_20948068</guid>
      <link>https://habr.com/ru/articles/476102/#comment_20948068</link>
      <description><![CDATA[<p>Вам пожалуйста и тоже спасибо, что потрудились выложить интересную работу.</p><br>
<blockquote>Но не всегда такие линейные переливания из пустого в порожнее.</blockquote><p>И, кстати, если переливания не линейные, т.е. нужно что-то преобразовать во время переливания массива в DTO, то, скорее всего, на эти преобразования нужно сделать отдельный объект (класс), чтобы соблюсти <a href="https://en.wikipedia.org/wiki/Single_responsibility_principle">Single Responsibility Principle</a> — data transformer.</p><br>
<p>Вы посмотрите повнимательней DTO-пакет, может быть там можно через dependency injection впрыснуть свой кастомный data transformer. Или пакет форкнуть и доработать под себя.</p><br>
<p>Если нет, я бы все равно порекомендовал подумать, как вынести трансформацию в отдельный объект и проводить ее до переливания из массива в DTO (или после?).</p><br>
<p>Суть такого рефакторинга — сделать так, чтобы интеллектуальный DTO занимался только проверкой типов и, естественно, переносом данных в себе (он же data transfer object по основному назначению).</p><br>
<p>Кстати, еще по вашей задаче:</p><br>
<ul>
<li><a href="https://wiki.php.net/rfc/typed-properties">PHP 7.4 Typed properties</a> — уже день, как вышел, скоро на всех виртуальных хостингах будет, а на VPS вы сами можете поставить.</li>
<li><a href="https://github.com/phpstan/phpstan">PHP Static Analysis Tool</a> очень полезная штука сама по себе.</li>
</ul>]]></description>
      <pubDate>Fri, 29 Nov 2019 16:55:01 GMT</pubDate>
      <dc:creator><![CDATA[]]></dc:creator>
    </item>
  

  
    <item>
      <title>29.11.2019 16:09:20 </title>
      <guid isPermaLink="true">https://habr.com/ru/articles/476102/#comment_20947820</guid>
      <link>https://habr.com/ru/articles/476102/#comment_20947820</link>
      <description><![CDATA[<p>Ну у топикстартера основная цель — автоматизация type checking. В этом пакете я ее не увидел.</p>]]></description>
      <pubDate>Fri, 29 Nov 2019 16:09:20 GMT</pubDate>
      <dc:creator><![CDATA[]]></dc:creator>
    </item>
  

  
    <item>
      <title>29.11.2019 14:59:33 </title>
      <guid isPermaLink="true">https://habr.com/ru/articles/476102/#comment_20947450</guid>
      <link>https://habr.com/ru/articles/476102/#comment_20947450</link>
      <description><![CDATA[<p>Коллега правильно показывает направление.<br>
Посмотрите <a href="https://github.com/spatie/data-transfer-object">https://github.com/spatie/data-transfer-object</a> — конвертация массивов в DTO со строго типированными properties. Совмещенные с коллекциями <a href="https://github.com/tightenco/collect">https://github.com/tightenco/collect</a> — получите готовый не-велосипед.</p>]]></description>
      <pubDate>Fri, 29 Nov 2019 14:59:33 GMT</pubDate>
      <dc:creator><![CDATA[]]></dc:creator>
    </item>
  

  
    <item>
      <title>17.11.2019 14:09:52 </title>
      <guid isPermaLink="true">https://habr.com/ru/articles/476102/#comment_20895716</guid>
      <link>https://habr.com/ru/articles/476102/#comment_20895716</link>
      <description><![CDATA[<p>а также<br>
<a href="https://symfony.com/doc/current/reference/constraints/Collection.html">Symfony Collections</a>, <a href="https://symfony.com/doc/current/components/serializer.html">Symfony Serializer</a></p>]]></description>
      <pubDate>Sun, 17 Nov 2019 14:09:52 GMT</pubDate>
      <dc:creator><![CDATA[]]></dc:creator>
    </item>
  

      

      

    
  </channel>
</rss>
