Skip to content

complete rewrite#2

Draft
davidmondok wants to merge 6 commits intomasterfrom
dev
Draft

complete rewrite#2
davidmondok wants to merge 6 commits intomasterfrom
dev

Conversation

@davidmondok
Copy link
Copy Markdown
Member

siehe README für Doc. 1-2 Tests hab ich sogar geschrieben :)

Copy link
Copy Markdown
Member

@wolfgangschaefer wolfgangschaefer left a comment

Choose a reason for hiding this comment

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

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');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe describe format of assets.json or reference the node package that is creating this
and maybe reference to gulppress

* 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)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

* @param string $key Optional. Lookup key of hash value.
* @return $this
*/
public function addHashFile(HashFile $hashFile, string $key = ''): Asset
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

wie bei __construct (also ?string $key = null)

*/
public function addHashFile(HashFile $hashFile, string $key = ''): Asset
{
$this->hash = $hashFile->getHashValue($key ?: $this->file->getBaseName());;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

und dann wäre hier ein ??

composer.json Outdated
}
],
"require": {
"php": ">=7.2"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

in includes/HashFile.php werden json_* funktionen verwenden, also wäre auch ext-json nötig

phpstan.neon Outdated
Comment on lines +15 to +18
- '#^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\.$#'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Die ignoreErrors können raus

test/wp-mock.php Outdated
@@ -0,0 +1,75 @@
<?php
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ganze datei kann gelöscht werden (die referenzen drauf auch)

@davidmondok
Copy link
Copy Markdown
Member Author

davidmondok commented Jun 19, 2020

Hab dein Feedback noch schnell nachgezogen.

Check failt noch, weil die ganzen WordPress functions nicht erkannt werden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants