Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Commit

Permalink
Merge pull request #27 from acelaya/feature/2.2.1
Browse files Browse the repository at this point in the history
Feature/2.2.1
  • Loading branch information
acelaya committed Sep 2, 2018
2 parents 60830ab + 18b66b5 commit a7980b2
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 7 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,31 @@
## CHANGELOG


## 2.2.1 - 2018-09-02

#### Added

* *Nothing*

#### Changed

* [#24](https://github.com/acelaya/doctrine-enum-type/issues/24) Documented how to register custom types for schema operations.
* [#25](https://github.com/acelaya/doctrine-enum-type/issues/25) Updated to Infection 0.10
* [#26](https://github.com/acelaya/doctrine-enum-type/issues/26) Improved badges in readme file.

#### Deprecated

* *Nothing*

#### Removed

* *Nothing*

#### Fixed

* *Nothing*


## 2.2.0 - 2018-03-12

#### Added
Expand Down
17 changes: 12 additions & 5 deletions README.md
@@ -1,12 +1,14 @@
# Doctrine Enum Type

[![Build Status](https://img.shields.io/travis/acelaya/doctrine-enum-type/master.svg?style=flat-square)](https://travis-ci.org/acelaya/doctrine-enum-type)
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/acelaya/doctrine-enum-type.svg?style=flat-square)](https://scrutinizer-ci.com/g/acelaya/doctrine-enum-type/?branch=master)
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/acelaya/doctrine-enum-type.svg?style=flat-square)](https://scrutinizer-ci.com/g/acelaya/doctrine-enum-type/?branch=master)
[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat-square)](https://github.com/phpstan/phpstan)
[![Latest Stable Version](https://poser.pugx.org/acelaya/doctrine-enum-type/v/stable?format=flat-square)](https://github.com/acelaya/doctrine-enum-type/releases/latest)
[![Total Downloads](https://poser.pugx.org/acelaya/doctrine-enum-type/downloads?format=flat-square)](https://packagist.org/packages/acelaya/doctrine-enum-type)
[![License](https://poser.pugx.org/acelaya/doctrine-enum-type/license?format=flat-square)](https://github.com/acelaya/doctrine-enum-type/blob/master/LICENSE)
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/acelaya/doctrine-enum-type.svg?style=flat-square)](https://scrutinizer-ci.com/g/acelaya/doctrine-enum-type/?branch=master)
[![Infection](https://img.shields.io/badge/Infection-enabled-blue.svg?style=flat-square)](https://github.com/infection/infection)
[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-blue.svg?style=flat-square)](https://github.com/phpstan/phpstan)
[![Latest Stable Version](https://img.shields.io/github/release/acelaya/doctrine-enum-type.svg?style=flat-square)](https://github.com/acelaya/doctrine-enum-type/releases/latest)
[![Total Downloads](https://img.shields.io/packagist/dt/acelaya/doctrine-enum-type.svg?style=flat-square)](https://packagist.org/packages/acelaya/doctrine-enum-type)
[![License](https://img.shields.io/github/license/acelaya/doctrine-enum-type.svg?style=flat-square)](https://github.com/acelaya/doctrine-enum-type/blob/master/LICENSE)
[![Paypal Donate](https://img.shields.io/badge/Donate-paypal-blue.svg?style=flat-square&logo=paypal&colorA=cccccc)](https://acel.me/donate)

This package provides a base implementation to define doctrine entity column types that are mapped to `MyCLabs\Enum\Enum` objects. That class is defined in the fantastic [myclabs/php-enum](https://github.com/myclabs/php-enum) package.

Expand Down Expand Up @@ -124,6 +126,11 @@ use Acelaya\Enum\Gender;
// Register my types
PhpEnumType::registerEnumType(Action::class);
PhpEnumType::registerEnumType('php_enum_gender', Gender::class);

// Don't forget to register the enums for schema operations
$platform = $em->getConnection()->getDatabasePlatform();
$platform->registerDoctrineTypeMapping('VARCHAR', Action::class);
$platform->registerDoctrineTypeMapping('VARCHAR', 'php_enum_gender');
```

That will internally register a customized doctrine type. As you can see, it its possible to just pass the FQCN of the enum, making the type use it as the name, but you can also provide a different name.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -19,7 +19,7 @@
"myclabs/php-enum": "^1.4"
},
"require-dev": {
"infection/infection": "^0.9.0",
"infection/infection": "^0.10.0",
"phpstan/phpstan": "^0.10.0",
"phpunit/phpunit": "^7.0",
"slevomat/coding-standard": "^4.0",
Expand Down
3 changes: 2 additions & 1 deletion infection.json
Expand Up @@ -15,6 +15,7 @@
},
"mutators": {
"@default": true,
"IdenticalEqual": false
"IdenticalEqual": false,
"NotIdenticalNotEqual": false
}
}
3 changes: 3 additions & 0 deletions phpstan.neon
@@ -0,0 +1,3 @@
parameters:
ignoreErrors:
- '#Call to function method_exists#'

0 comments on commit a7980b2

Please sign in to comment.