Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support to php 8 attributes #40

Merged
merged 1 commit into from
Jul 15, 2021

Conversation

djpremier
Copy link
Contributor

@djpremier djpremier commented Jul 14, 2021

Add support to php 8 attributes, keeping compatibility with annotations.

use DH\Auditor\Provider\Doctrine\Auditing\Annotation as Audit;

#[
    Audit\Auditable,
    Audit\Security(
        view: [
            'ROLE_ADMIN',
        ],
    ),
]
class DummyPhp8
{
    #[Audit\Ignore]
    public string $hello = 'hi';
}

@djpremier djpremier marked this pull request as draft July 14, 2021 21:40
@djpremier djpremier force-pushed the php_attribute branch 3 times, most recently from 275bc44 to c70be96 Compare July 15, 2021 01:11
@djpremier djpremier marked this pull request as ready for review July 15, 2021 01:11
@DamienHarper
Copy link
Owner

@djpremier Thanks a lot for this PR, much appreciated!
One thing though, tests currently fail with Symfony 3.4 because of "friendsofphp/php-cs-fixer": "^3.0" which is not compatible with Symfony 3.4.

You may try something like "friendsofphp/php-cs-fixer": "^2.16|^3.0"

@djpremier
Copy link
Contributor Author

djpremier commented Jul 15, 2021

@djpremier Thanks a lot for this PR, much appreciated!
One thing though, tests currently fail with Symfony 3.4 because of "friendsofphp/php-cs-fixer": "^3.0" which is not compatible with Symfony 3.4.

You may try something like "friendsofphp/php-cs-fixer": "^2.16|^3.0"

Thanks, done.

I remove the change because on 3.0 the config file is renamed.
https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v3.0.0-rc.1/UPGRADE-v3.md

composer.json Outdated Show resolved Hide resolved
@DamienHarper DamienHarper added the enhancement New feature or request label Jul 15, 2021
Copy link
Owner

@DamienHarper DamienHarper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like tests using Symfony 3.4 and PHP 8 fail but as far as I know, PHP 8 is not supported with Symfony 3.4
Tests should not even be run with such a config.

@djpremier
Copy link
Contributor Author

Looks like tests using Symfony 3.4 and PHP 8 fail but as far as I know, PHP 8 is not supported with Symfony 3.4
Tests should not even be run with such a config.

I will check.

@DamienHarper DamienHarper merged commit 9b22c09 into DamienHarper:master Jul 15, 2021
@djpremier djpremier deleted the php_attribute branch July 15, 2021 21:26
@DamienHarper
Copy link
Owner

thanks @djpremier

@djpremier
Copy link
Contributor Author

I'm working on this change also for @Gedmo, as soon as possible I'll fix the missing part of the test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants