Brick\Money
A money and currency library for PHP (by brick)
PHPStan
PHP Static Analysis Tool - discover bugs in your code without running it! (by phpstan)
Brick\Money | PHPStan | |
---|---|---|
15 | 62 | |
1,769 | 13,474 | |
0.3% | 0.6% | |
6.2 | 9.9 | |
4 months ago | 1 day ago | |
PHP | PHP | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
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.
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.
Brick\Money
Posts with mentions or reviews of Brick\Money.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2024-05-18.
-
Introducing Bag 1.0: Immutable Values Objects for PHP
For the last couple of years I’ve been using Value Objects in my projects to bring language-level strict types to what would typically be array data structures in my code. From method inputs to JSON API responses, value objects have almost entirely replaced arrays throughout. The ability to get runtime type checking and IDE auto-complete has eliminated many potential bugs, from key typos, to assigning an incorrectly typed value by accident: what type is an “amount” property in a credit card transaction API response? An integer of cents (or other minor units), a Money object such as brick/money or moneyphp/money? Or worst of all, a float?
-
PHP libraries and tools
brick/money: A money and currency library for PHP
-
Weekly help thread
1 - Floating point is not always great for money operations and can introduce odd rounding errors - https://www.php.net/manual/en/language.types.float.php - you might want to use something like this: https://github.com/brick/money
-
PHP is trolling me
He should have said to use Brick/Money https://github.com/brick/money which is based on Brick/Math but is specifically money related.
-
How to format prices?
If you don’t want to do the integer conversions yourself, I highly recommend looking at: https://github.com/brick/money
-
Which native PHP features do you regret not knowing about/adapting earlier?
brick/date-time is great! I personally prefer its interface and functionality over Carbon's. I also really like his money library
- Financial values in PHP
-
Best way to handle PHP float issue
Is the most popular, but https://github.com/brick/money is preferrable IMO. One of the reasons is that it handles not just money, but all arbitrary precision calculations independent of currecy via brick/math.
- Dealing with money
- Weekly "ask anything" thread
PHPStan
Posts with mentions or reviews of PHPStan.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2025-03-04.
-
PHP: errors to avoid with constructors
PHPStan: composer require --dev phpstan/phpstan
-
Build a Symfony 7 boilerplate using FrankenPHP, Docker, PostgreSQL and php 8.4
To do so simply install the runtime/frankenphp-symfony composer package. Then we install the bare minimum for a kick ass developer experience, a linter using Code Sniffer, phpstan as code quality audit tool, Rector to ease and automate code maintenance, some useful Symfony components and package and of course the Doctrine ORM. Here the composer.json file located at the symfony folder root.
-
How to Avoid Adding New Code that Uses Deprecated Code?
At DinnerBooking, we've tackled this challenge using PHPStan. Here’s how:
-
Rector keeps your PHP code base fresh and perfect
As part of the journey to PHP perfection, you should embrace Rector. It's a amazing, free, and open-source tool for migrations, code quality, type coverage, pushing PHPStan to the highest levels, and yes, it can even auto-fix your existing code! It seamlessly integrates into the CI process, making your development workflow smoother than ever.
-
8 Essential Tools Every PHP Developer Needs
PHPStan focuses on finding errors in PHP code without running it. It captures all types of errors, even before you write tests. It brings PHP closer to compiled languages by checking the correctness of each line of code before execution.
-
Laravel code-quality tools
PHPStan is a static analysis tool for PHP. Larastan is a package built on top of PHPStan to make it easier to integrate with Laravel projects. PHPStan works by "sniffing" the code using the various rulesets applied to it and determine if it follows the standards. However, Larastan doesn't fully follow the definition of "static analysis" since it has to boot the application's container and resolve the types that can only be computed at runtime. This is why Larastan is called a "code analysis" tool rather than a "static analysis" tool.
- PHP 8.3
-
PHP libraries and tools
PHPStan: PHP Static Analysis Tool - discover bugs in your code without running it! Plugins: ergebnis/phpstan-rules: Provides additional rules for phpstan/phpstan. spaze/phpstan-disallowed-calls: PHPStan rules to detect disallowed calls and constant & namespace usages roave/no-floaters: static analysis rules to prevent IEEE-754 floating point errors. dave-liddament/php-language-extensions: Attributes to define PHP language extensions (to be enforced by static analysis) sidz/phpstan-rules: Additional rules for phpstan/phpstan. staabm/phpstan-baseline-analysis: Analyzes PHPStan baseline files and creates aggregated error trend-reports More extensions
-
Writing Custom PHPStan Rule to prohibit business logic in controllers
So, in this article we have written a fairly simple but functional rule for PHPStan. We have discussed the basics of PHPStan and now we can cover our project with more complex tests. I also recommend reading the developer documentation. It won't take you long to learn more rule development features.
-
Secure coding
You could try something like PHP Stan. It scans your code for defects and lists them all for you. It probably won't catch everything, but it'll certainly help, and it's free
What are some alternatives?
When comparing Brick\Money and PHPStan you can also consider the following projects:
Money - PHP implementation of Fowler's Money pattern.
Psalm - A PHP static analysis tool for finding errors and security vulnerabilities in PHP applications
Brick\Money - A money and currency library for PHP
phan - Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.
Laravel - The Laravel Framework.
PHP CS Fixer - A tool to automatically fix PHP Coding Standards issues