Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_url "https://raw.githubusercontent.com/cachix/devenv/95f329d49a8a5289d31e0982652f7058a189bfca/direnvrc" "sha256-d+8cBpDfDBj41inrADaJt+bDWhOktwslgoP5YiGJ1v0="

use devenv
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@ build/
vendor/
.phpunit.result.cache
tests/cache
# Devenv
.devenv*
devenv.local.nix

# direnv
.direnv

# pre-commit
.pre-commit-config.yaml
122 changes: 122 additions & 0 deletions devenv.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
"nodes": {
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1720180409,
"owner": "cachix",
"repo": "devenv",
"rev": "7b3ed618571f0d14655b05f7b1c6ef600904383a",
"treeHash": "14b4b6bc32582a78300257c3b618d821557eb530",
"type": "github"
},
"original": {
"dir": "src/modules",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"treeHash": "2addb7b71a20a25ea74feeaf5c2f6a6b30898ecb",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"treeHash": "ca14199cabdfe1a06a7b1654c76ed49100a689f9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1716977621,
"owner": "cachix",
"repo": "devenv-nixpkgs",
"rev": "4267e705586473d3e5c8d50299e71503f16a6fb6",
"treeHash": "6d9f1f7ca0faf1bc2eeb397c78a49623260d3412",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "rolling",
"repo": "devenv-nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1719957072,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7144d6241f02d171d25fba3edeaf15e0f2592105",
"treeHash": "415bf0e03835797927c1b2cb46a557bcecc36673",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1719259945,
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07",
"treeHash": "1a76ff89a9d4017b48abbb1bad8837b35d604ffc",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
}
}
},
"root": "root",
"version": 7
}
26 changes: 26 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{ pkgs, lib, config, inputs, ... }:

{
languages.php = {
enable = true;
version = lib.mkDefault "8.2";
extensions = [ "xdebug" ];

ini = ''
memory_limit = -1
opcache.enable = 1
opcache.revalidate_freq = 0
opcache.validate_timestamps = 1
opcache.max_accelerated_files = 30000
opcache.memory_consumption = 256M
opcache.interned_strings_buffer = 20
realpath_cache_ttl = 3600
xdebug.idekey = "PHPSTORM"
xdebug.start_with_request = "yes"
zend.assertions = 1
date.timezone = "Europe/Paris"
xdebug.output_dir = ".devenv/state/xdebug"
xdebug.mode = "off"
'';
};
}
15 changes: 15 additions & 0 deletions devenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
inputs:
nixpkgs:
url: github:cachix/devenv-nixpkgs/rolling

# If you're using non-OSS software, you can set allowUnfree to true.
# allowUnfree: true

# If you're willing to use a package that's vulnerable
# permittedInsecurePackages:
# - "openssl-1.1.1w"

# If you have more than one devenv you can merge them
#imports:
# - ./backend
14 changes: 14 additions & 0 deletions src/Attribute/Cache/Tag.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

namespace OpenClassrooms\ServiceProxy\Attribute\Cache;

#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY | \Attribute::IS_REPEATABLE)]
final class Tag
{
public function __construct(
public readonly ?string $prefix = null
) {
}
}
9 changes: 5 additions & 4 deletions src/Helper/TypesExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,11 @@ private function getPhpDocTypesNames(string $classContext, string $docComment, a
$types = $this->typeHelper->getTypes($tag->value, $nameScope);
foreach ($types as $type) {
$classNames[] = $type->getClassName() ?? $type->getBuiltinType();
if ($type->isCollection()) {
foreach ($type->getCollectionValueTypes() as $collectionValueType) {
$classNames[] = $collectionValueType->getClassName() ?? $collectionValueType->getBuiltinType();
}
foreach ($type->getCollectionValueTypes() as $collectionType) {
$classNames[] = $collectionType->getClassName() ?? $collectionType->getBuiltinType();
}
foreach ($type->getCollectionKeyTypes() as $collectionType) {
$classNames[] = $collectionType->getClassName() ?? $collectionType->getBuiltinType();
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/Interceptor/Contract/Cache/AutoTaggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

interface AutoTaggable
{
public function getId(): string|int;
}
Loading