Skip to content

Commit

Permalink
[Feature] Add note resolver (#35)
Browse files Browse the repository at this point in the history
* Add note resolver

* Add new line

* Update CS-Fixer

* Apply php-cs-fixer changes

---------

Co-authored-by: mattamon <mattamon@users.noreply.github.com>
  • Loading branch information
mattamon and mattamon authored May 22, 2024
1 parent 9017a24 commit f6ed76a
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 16 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/php-cs-fixer.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
name: "PHP-CS-Fixer"

on:
pull_request:
branches:
- "*"
push:
branches:
- "[0-9]+.[0-9]+"
- "[0-9]+.x"
- "*_actions"
- "feature-*"

permissions:
contents: read

jobs:
php-cs-fixer:
permissions:
contents: write # for stefanzweifel/git-auto-commit-action to push code in repo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga:latest

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply php-cs-fixer changes
php-style:
uses: pimcore/workflows-collection-public/.github/workflows/reusable-php-style.yaml@main
secrets:
PHP_CS_FIXER_GITHUB_TOKEN: ${{ secrets.PHP_CS_FIXER_GITHUB_TOKEN }}
with:
head_ref: ${{ github.ref }}
config_file: .php-cs-fixer.dist.php
27 changes: 27 additions & 0 deletions src/Models/Element/NoteResolver.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);

/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Commercial License (PCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Bundle\StaticResolverBundle\Models\Element;

use Pimcore\Model\Element\Note;

final class NoteResolver implements NoteResolverInterface
{
public function getById(int $id): ?Note
{
return Note::getById($id);
}
}
24 changes: 24 additions & 0 deletions src/Models/Element/NoteResolverInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);

/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Commercial License (PCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Bundle\StaticResolverBundle\Models\Element;

use Pimcore\Model\Element\Note;

interface NoteResolverInterface
{
public function getById(int $id): ?Note;
}
1 change: 0 additions & 1 deletion src/Proxy/Service/ProxyService.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public function getProxyObject(string $className, string $method, array $args =
} catch (Throwable $exception) {
throw new InvalidServiceException($exception->getMessage());
}

}

public function getStrictProxyObject(
Expand Down

0 comments on commit f6ed76a

Please sign in to comment.