Serializer
Psalm
Serializer | Psalm | |
---|---|---|
9 | 45 | |
2,303 | 5,453 | |
- | 0.7% | |
7.9 | 9.9 | |
2 months ago | 8 days ago | |
PHP | PHP | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Serializer
- Data-Mapper: A package for fast mapping of strong-typed objects
- brick/json-mapper: map JSON data to strongly typed PHP DTOs
-
Design Decisions: Why use final classes
Making a class "final" is always a bad decision IMO. You would never know how will other people use your library. For example, we used JMSSerializerBundle and wanted to extend DateHandler to make it not to throw exceptions if a date string is invalid. But the class is final. So we had to just copy-paste it :(
- Symfony serializer is tedious
-
Array -> Entity
Or this popular alternative: https://jmsyst.com/libs/serializer
-
PHP libraries and tools
JMS Serializer: This library allows you to (de-)serialize data of any complexity. Currently, it supports XML and JSON.
-
Yet another Data-Transfer-Object package
Only took a very brief look, but it looks nice. I like that the DTO class isn't required to extend anything, and that it seems to be for real DTOs used for actual transfer of data between systems - not 'local dtos'. It feels like this might be more comparable to something like schmittjoh/serializer rather than spatie/data-transfer-object.
-
PHP foreach loop to XML
When it's time to create the PDF, convert the object structure to an XML using an already existing serializer (like JMS or symfony serializer) or do this by hand.
-
Is there a better way to connect to an API?
One frequently used serializer is JMS Serializer which allows you to convert JSON or XML to objects (or the other way around if needed). You can then use the objects in your application.
Psalm
-
Laravel code-quality tools
Psalm is a static analysis tool for PHP. Much like PHPStan is to Larastan, Psalm has a plugin called Laravel Psalm that allows you to easily use it in Laravel projects.
- PHP 8.3
-
PHP libraries and tools
Psalm: A static analysis tool for finding errors in PHP applications. Plugins: boesing/psalm-plugin-stringf: Psalm plugin to provide more details for sprintf, printf, sscanf and fscanf functions. hectorj/safe-php-psalm-plugin: vimeo/psalm plugin for thecodingmachine/safe. marartner/psalm-no-empty: Psalm plugin to detect usage of empty(). marartner/psalm-strict-equality: Psalm plugin to enforce strict equality. psalm/plugin-phpunit: A PHPUnit plugin for Psalm. psalm/plugin-symfony: Psalm Plugin for Symfony. weirdan/doctrine-psalm-plugin: Stubs to let Psalm understand Doctrine better. ghostwriter/psalm-plugin: Provides an ALL-IN-ONE plugin for Psalm
-
PHP-Tokio – Use any async Rust library from PHP
PHP 8 is the best version of PHP yet, and the main reason why it's so good is precisely because it got rid of a huge amount of ugly, legacy behavior.
Upgrading a codebase to PHP 8 is not an insurmountable task, I've upgraded our 1 million SLOC codebase at work in just a few weeks, with the help of tools like https://psalm.dev and our own strict coding standard.
- Devs interesados en aprender
-
Top 6 PHP code quality tools 2023
Psalm is a static analysis tool specifically designed for PHP. It performs advanced type inference and checks for various types of errors, including type errors, undefined variables, incorrect function calls, and more. It provides comprehensive code analysis and helps improve code quality and maintainability. Documentation: You can find more information about Psalm, including installation instructions and usage details, in the official repository: Psalm Repository
-
Avoiding empty() in PHP
vimeo/psalm
- [Laravel] Maintenant que PHPStorm prend en charge le Psaume et le PHPSTAN, lequel utilisez-vous / recommandez-vous pour les projets Laravel?
- TIL how PHP type hinting works
-
Templates available in Yii3.
Static analysis - Psalm .
What are some alternatives?
Fractal - Output complex, flexible, AJAX/RESTful data structures.
PHPStan - PHP Static Analysis Tool - discover bugs in your code without running it!
JsonMapper - Map nested JSON structures onto PHP classes
phan - Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.
data-transfer-object - Data transfer objects with batteries included
Rector - Instant Upgrades and Automated Refactoring of any PHP 5.3+ code
Ardent - A Collections library for PHP.
PHPCompatibility - PHP Compatibility check for PHP_CodeSniffer
Arrayy - 🗃 Array manipulation library for PHP, called Arrayy!
PHP Code Sniffer - PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
CRUDlex - CRUDlex is an easy to use CRUD generator for Symfony 4 and Silex 2 which is great for auto generated admin pages
Qodana - 📝 Source repository of Qodana Help