Conversation
wolfgangschaefer
left a comment
There was a problem hiding this comment.
Top! Ein paar Änderungen habe ich vorgeschlagen, aber das ganze schaut super aus!
| use Woda\WordPress\ScriptsStylesLoader\Style; | ||
|
|
||
| // Import a json containing cache busting hash values, versions, etc. | ||
| $scriptsHashFile = new HashFile(get_stylesheet_directory() . '/assets/js/.assets.json'); |
There was a problem hiding this comment.
maybe describe format of assets.json or reference the node package that is creating this
and maybe reference to gulppress
includes/Asset.php
Outdated
| * number is automatically added equal to current installed WordPress version. | ||
| * If set to null, no version is added. | ||
| */ | ||
| public function __construct(string $src, ?array $deps = [], ?string $handle = '', $ver = false) |
There was a problem hiding this comment.
Alle optionalen params mit = null initialisieren und dann im __construct body $deps ?? [] machen.
Das macht die Benutzung einfacher wenn man nicht die default values setzen (& wissen) muss.
includes/Asset.php
Outdated
| * @param string $key Optional. Lookup key of hash value. | ||
| * @return $this | ||
| */ | ||
| public function addHashFile(HashFile $hashFile, string $key = ''): Asset |
There was a problem hiding this comment.
wie bei __construct (also ?string $key = null)
includes/Asset.php
Outdated
| */ | ||
| public function addHashFile(HashFile $hashFile, string $key = ''): Asset | ||
| { | ||
| $this->hash = $hashFile->getHashValue($key ?: $this->file->getBaseName());; |
There was a problem hiding this comment.
und dann wäre hier ein ??
composer.json
Outdated
| } | ||
| ], | ||
| "require": { | ||
| "php": ">=7.2" |
There was a problem hiding this comment.
in includes/HashFile.php werden json_* funktionen verwenden, also wäre auch ext-json nötig
phpstan.neon
Outdated
| - '#^Access to property \$(hide|add|populate) on an unknown class PostTypes\\PostTypes\\Columns\.$#' | ||
| - '#^Call to method (hide|add|populate)\(\) on an unknown class PostTypes\\PostTypes\\Columns\.$#' | ||
| - '#^Call to an undefined method Carbon_Fields\\#' | ||
| - '#carbon_(get|set)_post_meta not found\.$#' |
There was a problem hiding this comment.
Die ignoreErrors können raus
test/wp-mock.php
Outdated
| @@ -0,0 +1,75 @@ | |||
| <?php | |||
There was a problem hiding this comment.
Ganze datei kann gelöscht werden (die referenzen drauf auch)
|
Hab dein Feedback noch schnell nachgezogen. Check failt noch, weil die ganzen WordPress functions nicht erkannt werden. |
siehe README für Doc. 1-2 Tests hab ich sogar geschrieben :)