Skip to content

Commit

Permalink
Use self::, not static::
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryJones committed Jun 26, 2017
1 parent f4418b8 commit 90d6db8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions src/ImageSizes.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ class ImageSizes extends Brick
*/
public function apply()
{
if ($this->config->hasKey(static::REMOVE)) {
$this->remove($this->config->getSubConfig(static::REMOVE)->getArrayCopy());
if ($this->config->hasKey(self::REMOVE)) {
$this->remove($this->config->getSubConfig(self::REMOVE)->getArrayCopy());
}

if ($this->config->hasKey(static::ADD)) {
$this->add($this->config->getSubConfig(static::ADD)->getArrayCopy());
if ($this->config->hasKey(self::ADD)) {
$this->add($this->config->getSubConfig(self::ADD)->getArrayCopy());
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/Templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Templates extends Brick
*/
public function apply()
{
if ($this->config->hasKey(static::UNREGISTER)) {
if ($this->config->hasKey(self::UNREGISTER)) {
add_filter('theme_page_templates', [$this, 'unregister']);
}
}
Expand All @@ -60,6 +60,6 @@ public function apply()
*/
public function unregister(array $page_templates)
{
return array_diff_key($page_templates, array_flip($this->config->getSubConfig(static::UNSET)->getArrayCopy()));
return array_diff_key($page_templates, array_flip($this->config->getSubConfig(self::UNSET)->getArrayCopy()));
}
}
8 changes: 4 additions & 4 deletions src/ThemeSupport.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ class ThemeSupport extends Brick
*/
public function apply()
{
if ($this->config->hasKey(static::REMOVE)) {
$this->remove($this->config->getSubConfig(static::REMOVE)->getArrayCopy());
if ($this->config->hasKey(self::REMOVE)) {
$this->remove($this->config->getSubConfig(self::REMOVE)->getArrayCopy());
}

if ($this->config->hasKey(static::ADD)) {
$this->add($this->config->getSubConfig(static::ADD)->getArrayCopy());
if ($this->config->hasKey(self::ADD)) {
$this->add($this->config->getSubConfig(self::ADD)->getArrayCopy());
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/WidgetAreas.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ class WidgetAreas extends Brick
*/
public function apply()
{
if ($this->config->hasKey(static::REGISTER)) {
$this->register($this->config->getSubConfig(static::REGISTER)->getArrayCopy());
if ($this->config->hasKey(self::REGISTER)) {
$this->register($this->config->getSubConfig(self::REGISTER)->getArrayCopy());
}

if ($this->config->hasKey(static::UNREGISTER)) {
$this->unregister($this->config->getSubConfig(static::UNREGISTER)->getArrayCopy());
if ($this->config->hasKey(self::UNREGISTER)) {
$this->unregister($this->config->getSubConfig(self::UNREGISTER)->getArrayCopy());
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/Widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ class Widgets extends Brick
*/
public function apply()
{
if ($this->config->hasKey(static::UNREGISTER)) {
if ($this->config->hasKey(self::UNREGISTER)) {
add_action('widgets_init', [$this, 'unregister'], 15);
}

if ($this->config->hasKey(static::REGISTER)) {
if ($this->config->hasKey(self::REGISTER)) {
add_action('widgets_init', [$this, 'register'], 15);
}
}
Expand All @@ -63,14 +63,14 @@ public function apply()
*/
public function register()
{
array_map('register_widget', $this->config->getSubConfig(static::REGISTER)->getArrayCopy());
array_map('register_widget', $this->config->getSubConfig(self::REGISTER)->getArrayCopy());
}

/**
* Unregister widgets.
*/
public function unregister()
{
array_map('unregister_widget', $this->config->getSubConfig(static::UNREGISTER)->getArrayCopy());
array_map('unregister_widget', $this->config->getSubConfig(self::UNREGISTER)->getArrayCopy());
}
}

0 comments on commit 90d6db8

Please sign in to comment.