Skip to content

Commit

Permalink
ENH Use class name instead of self
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jun 5, 2024
1 parent e33c5f1 commit 202e813
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/ImportField.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,19 +387,19 @@ public function importFromPOST($tmpFile, $splitHeader = false, $publishPages = f
$els = $doc->getElementsByTagName('*');

$headingXPath = [
'self::h1',
'self::h2',
'self::h3',
'self::h4',
'self::h5',
'self::h6',
'ImportField::h1',
'ImportField::h2',
'ImportField::h3',
'ImportField::h4',
'ImportField::h5',
'ImportField::h6',
];
// Remove a bunch of unwanted elements
$clean = [
// Empty paragraphs
'//p[not(descendant-or-self::text() | descendant-or-self::img)]',
'//p[not(descendant-or-ImportField::text() | descendant-or-ImportField::img)]',
// Empty headers
'//*[' . implode(' | ', $headingXPath) . '][not(descendant-or-self::text() | descendant-or-self::img)]',
'//*[' . implode(' | ', $headingXPath) . '][not(descendant-or-ImportField::text() | descendant-or-ImportField::img)]',
// Anchors
'//a[not(@href)]',
// BR tags
Expand Down
2 changes: 1 addition & 1 deletion src/SettingsField.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class SettingsField extends CompositeField
public function __construct($children = null)
{
if ($children) {
$class = self::class;
$class = SettingsField::class;
throw new InvalidArgumentException(
"{$class}::__construct does not accept extra parameters."
);
Expand Down

0 comments on commit 202e813

Please sign in to comment.