Skip to content

Commit 6a5c989

Browse files
authored
Composer script to clear caches (#19)
1 parent b861bd6 commit 6a5c989

File tree

3 files changed

+28
-12
lines changed

3 files changed

+28
-12
lines changed

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,10 @@
3939
"allow-plugins": {
4040
"dealerdirect/phpcodesniffer-composer-installer": true
4141
}
42+
},
43+
"scripts": {
44+
"post-autoload-dump": [
45+
"Jerodev\\DataMapper\\MapperCommands::clearCache"
46+
]
4247
}
4348
}

composer.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/MapperCommands.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Jerodev\DataMapper;
4+
5+
abstract class MapperCommands
6+
{
7+
public static function clearCache(): void
8+
{
9+
(new Mapper())->clearCache();
10+
}
11+
}

0 commit comments

Comments
 (0)