Common and useful classes, methods, exceptions etc.
-
All the
*Type
classes, that extendMeritoo\Common\Type\Base\BaseType
class, have been replaced by enumerationsBefore After Meritoo\Common\Type\DatePartType
Meritoo\Common\Enums\Date\DatePart
Meritoo\Common\Type\DatePeriod
Meritoo\Common\Enums\Date\DatePeriod
Meritoo\Common\Type\OopVisibilityType
Meritoo\Common\Enums\OopVisibility
-
Other than that:
- The
Meritoo\Common\Type\DatePartType
class has been moved toMeritoo\Common\ValueObject\DatePeriod
- Exceptions that extend
Meritoo\Common\Exception\Base\UnknownTypeException
has been removed as not needed anymore - The following classes have been removed as not needed anymore:
Meritoo\Common\Exception\Base\UnknownTypeException
Meritoo\Common\Test\Base\BaseTypeTestCase
Meritoo\Common\Traits\Test\Base\BaseTypeTestCaseTrait
Meritoo\Common\Type\Base\BaseType
-
Arguments passed to the
Meritoo\Common\Utilities\Miscellaneous::concatenatePaths()
should bestring
s. The method does not acceptarray
of strings anymore.Before:
$result = Miscellaneous::concatenatePaths([ 'first/directory', 'second/one', 'and/the/third', ]);
After:
$result = Miscellaneous::concatenatePaths( 'first/directory', 'second/one', 'and/the/third', );
-
Support integers by the
BaseType::isCorrectType()
method -
Add PHPStan to GitHub Actions
-
Fix PHPStan errors - level
1
-
Make the
BaseType::isCorrectType()
static method non-staticBefore:
if (DatePartType::isCorrectType('day')) { // ... }
After:
if ((new DatePartType())->isCorrectType('day')) { // ... }
-
Change of
Meritoo\Common\Utilities\Regex::arrayFilter()
method signature:- 3rd argument, the filter, is now a
\Closure|string
. Previously it wasstring
. - 4th argument has been removed (not necessary).
Before:
public static function arrayFilter(array $array, string $arrayColumnKey, string $filterExpression, bool $itsRegularExpression = false): array
After:
public static function arrayFilter(array $array, string $arrayColumnKey, \Closure|string $filter): array
- 3rd argument, the filter, is now a
- Refactor the
Reflection
class for PHP8.0
+
- Bump packages versions to the latest stable and supported by PHP
8.0
+
- Support PHP
8.0
+
- Remove old, unnecessary methods. Implement setUp() methods. Increase code coverage.
- [Composer] Upgrade all dev packages (to the latest, stable versions for PHP
7.4
) - [BaseCollection] Interfaces of different types of collections. May be used to build specific collections.
- [Arrays] Allow to define a key of next level elements in a function that returns elements from given level
- [Arrays] Function that returns elements from given level
- [BaseCollection] Prepare elements while adding them by
addMultiple()
method in the same way as passing them in constructor.
- [BaseCollection] Fix incorrectly working limit() method
- Move
Renderable
class:Meritoo\Common
->Meritoo\Common\Contract
- Create and implement
CollectionInterface
as contract of all collections (e.g. based on theBaseCollection
class)
- Change mode of
Xdebug
tocoverage
in Docker's configuration to make it possible to generate code coverage byPHPUnit
- Mark PHPUnit test as risky when it does not have a
@covers
annotation
- [BaseCollection] Treat the
null
index as "no index" only while adding new element, iow. do not treat empty string as "no index" behaviour. - [Miscellaneous] [Regex] Use simpler & stronger pattern to match name of file
- Do not install
hirak/prestissimo
package while running Travis CI (incompatible with your PHP version, PHP extensions and Composer version) - Use PHP
7.4
while running build in Travis CI
- Rename Meritoo\Common\Collection\Collection class to Meritoo\Common\Collection\BaseCollection. Add BaseCollection:: isValidType() method to validate type of element before add it to collection. Add BaseCollection ::prepareElements() method to allow preparation of elements in custom way.
- Use
.env
instead of.env.dist
- Docker > use images (instead of Dockerfiles)
- composer > squizlabs/php_codesniffer package > use ^3.4 (instead of ^2.9)
- Do not require name of class by BaseTestCaseTrait::assertMethodVisibilityAndArguments() method
- PHP CS Fixer > configuration > make more readable & remove unnecessary code
- Update .gitignore, docker-compose.yml, phpunit.xml.dist
- Collection > trait > return "void" where "self" causes type hinting problem and is not required
- PHP Coding Standards Fixer > update configuration
- Phing > tests > add task for Psalm (https://psalm.dev)
- Collection > trait > split into smaller traits (to make it more flexible)
- Travis CI > run many tasks using Phing > update configuration
- Template with placeholders > verification of placeholders without values > make stronger and point out which are missing
- Reflection > getPropertyValue() method > look for the property in parent classes
- Phing > remove old and unused tools
- Phing > configuration > minor updates
- Implement Mutation Testing Framework (infection/infection package)
- Travis CI > run many tasks using Phing (instead of PHPUnit only)
- Fix integration with Coveralls (available as the badge in README.md)
- Implement PHPStan
- PHPUnit > execute tests in random order
- Implement Psalm
- Infection (Mutation Testing Framework) > fix bugs while running (generate proper code coverage, bugs while running tests randomly)
- Phing > php-coveralls > add task
- Regex > make compatible with PHP 7.3 Tests > Regex > fix "preg_match(): Compilation failed: invalid range in character class at offset 4" bug
- Collection/storage of templates
- Template with placeholders that may be filled by real data
- RenderableInterface > something that may be rendered
- Composer > support/require PHP 7.2+ (instead of 5.6+)
- Size, e.g. of image
- Collection > create trait (to make it more flexible)
- Arrays > refactoring & more tests
- ValueObject > Human > represents a human
- Tests > use
Meritoo\Test\Common
namespace (instead ofMeritoo\Common\Test
) - Tests > use @dataProvider
- Tests > Date > one more test case
- Phing > update configuration
- Miscellaneous > variableDump() method > remove, because unnecessary
- Regex > createSlug() method > returns slug for given value
- Arrays > getNonEmptyValues() method > returns non-empty values, e.g. without "" (empty string), null or []
- Arrays > getNonEmptyValuesAsString() method > returns non-empty values concatenated by given separator
- ValueObject > Company > represents a company
- ValueObject > BankAccount > represents bank account
- ValueObject > Address > represents address of company, institution, user etc.
- Phing > update configuration
- Utilities > Date > update descriptions of methods
- Docker > docker-compose.yml > add "phpunit" service > used to run PHPUnit's tests
- Reflection > setPropertiesValues() method > sets values of properties in given object
- Tests > refactoring & minor improvements
- Utilities > CssSelector > useful methods related to CSS selectors
- Utilities > Bootstrap4CssSelector > useful methods related to CSS selectors and the Bootstrap4 (front-end component library)
- Documentation > Value Objects
- Docker > improve performance
- Utilities > Reflection > setPropertyValue() method > sets value of given property
- TravisCI > run using PHP 7.2 too
- ValueObject > class Version > represents version of software
- Move version of this package to
VERSION
file (fromcomposer.json
file)
- Composer > support/require PHP 5.6+ (instead of 5.5.9+)
- Docker > rename
php-cli
service tophp
- Exceptions > create instance of exception using static
create()
method (instead of constructor) - Documentation > Exceptions
- Composer > require ext-pcre
- Arrays > minor refactoring
- Update @author and @copyright in classes' descriptions
- Collection > add() method > treat empty string as not provided index (same as null)
- Add this changelog
- Reorganize documentation & update Readme
- Docker: use project-related binaries globally
- StyleCI & PHP Coding Standards Fixer: update configuration
- Documentation > Docker > add paragraph for PHP Coding Standards Fixer
- Coding standard > fix automatically
- StyleCI configuration > fix bug "The provided fixer 'binary_operator_spaces' cannot be enabled again because it was already enabled"
- StyleCI > disable & remove