Skip to content

Commit

Permalink
Merge branch 'main' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ramsey committed Nov 3, 2022
2 parents 3046b74 + d3a2c3f commit 7ca73fd
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "monthly"
interval: "weekly"
open-pull-requests-limit: 1
versioning-strategy: "increase-if-necessary"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
interval: "weekly"
open-pull-requests-limit: 1
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
run: "./vendor/bin/phpunit --verbose --colors=always --coverage-text --coverage-clover build/logs/clover.xml"

- name: "Publish coverage report to Codecov"
uses: "codecov/codecov-action@v2.1.0"
uses: "codecov/codecov-action@v3.1.1"

unit-tests:
name: "Unit Tests"
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/merge-me.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Merge Me! Documentation: https://github.com/ridedott/merge-me-action/

name: "Merge Dependabot PRs"

on:
workflow_run:
types:
- "completed"
workflows:
- "build"

jobs:
merge-me:
name: "Merge me!"
runs-on: "ubuntu-latest"
steps:
- name: "Auto-merge"
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: "ridedott/merge-me-action@v2.10.29"
with:
# This must be used as GitHub Actions token does not support pushing
# to protected branches.
GITHUB_TOKEN: ${{ secrets.MERGE_TOKEN }}
44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,23 @@ In Laravel:
],
```

In [roave/psr-container-doctrine](https://github.com/Roave/psr-container-doctrine):

```php
<?php
use Ramsey\Uuid\Doctrine\UuidType;

return [
'doctrine' => [
'types' => [
UuidType::NAME => UuidType::class,
],
/* ... */
],
/* ... */
];
```

### Mappings

Then, in your models, you may annotate properties by setting the `@Column`
Expand Down Expand Up @@ -108,6 +125,30 @@ class Product
}
```

or, as follows, with [PHP 8 attributes](https://www.php.net/attributes) and [type declarations](https://www.php.net/types.declarations):

``` php
use Doctrine\ORM\Mapping as ORM;
use Ramsey\Uuid\Doctrine\UuidGenerator;
use Ramsey\Uuid\UuidInterface;

#[ORM\Entity]
#[ORM\Table(name: "products")
class Product
{
#[ORM\Id]
#[ORM\Column(type: "uuid", unique: true)]
#[ORM\GeneratedValue(strategy: "CUSTOM")]
#[ORM\CustomIdGenerator(class: UuidGenerator::class)]
protected UuidInterface|string $id;

public function getId(): string
{
return $this->id;
}
}
```

If you use the XML Mapping instead of PHP annotations.

``` xml
Expand Down Expand Up @@ -307,7 +348,7 @@ Contributions are welcome! To contribute, please familiarize yourself with
Keeping user information safe and secure is a top priority, and we welcome the
contribution of external security researchers. If you believe you've found a
security issue in software that is maintained in this repository, please read
[SECURITY.md](SECURITY.md) for instructions on submitting a vulnerability report.
[SECURITY.md][] for instructions on submitting a vulnerability report.

## ramsey/uuid-doctrine for enterprise

Expand All @@ -331,3 +372,4 @@ information.
[doctrine-field-type]: https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html
[doctrine-getting-started]: https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/getting-started.html
[slide 58]: https://speakerdeck.com/ramsey/identify-all-the-things-with-uuids-true-north-php-2016?slide=58
[security.md]: https://github.com/ramsey/uuid-doctrine/blob/main/SECURITY.md
2 changes: 2 additions & 0 deletions src/UuidBinaryOrderedTimeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $pla
*
* @param string|UuidInterface|null $value
* @param AbstractPlatform $platform
* @return mixed
*
* @throws ConversionException
*/
Expand All @@ -97,6 +98,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform)
*
* @param UuidInterface|string|null $value
* @param AbstractPlatform $platform
* @return mixed
*
* @throws ConversionException
*/
Expand Down

0 comments on commit 7ca73fd

Please sign in to comment.