Skip to content

Commit

Permalink
Merge pull request #1 from degordian/phpcbf
Browse files Browse the repository at this point in the history
Automated style correction
  • Loading branch information
Vilim Stubičan authored Nov 3, 2017
2 parents 882203c + 68b8e2f commit 3b7fca2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/ACFDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ public function getUserField($name, $userID = null, $prefixed = true)

return '';
}
}
}
15 changes: 6 additions & 9 deletions src/AssetBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace degordian\wpHelpers;


class AssetBundle
{
protected static $includeBasePath = '/static/';
Expand All @@ -31,8 +30,8 @@ public static function register()

protected function enqueueScripts()
{
foreach($this->js as $handle => $data) {
if(isset($data['path']) === false) {
foreach ($this->js as $handle => $data) {
if (isset($data['path']) === false) {
throw new \Exception('Missing path definition for ' . $handle);
}

Expand All @@ -46,8 +45,8 @@ protected function enqueueScripts()

protected function enqueueStyles()
{
if($this->asyncCss) {
add_action('wp_head', function() {
if ($this->asyncCss) {
add_action('wp_head', function () {
?>
<script>
function loadCSS(e, n, o, t) {
Expand Down Expand Up @@ -76,8 +75,8 @@ function loadCSS(e, n, o, t) {
<?php
});
} else {
foreach($this->css as $handle => $data) {
if(isset($data['path']) === false) {
foreach ($this->css as $handle => $data) {
if (isset($data['path']) === false) {
throw new \Exception('Missing path definition for ' . $handle);
}

Expand All @@ -87,8 +86,6 @@ function loadCSS(e, n, o, t) {

wp_enqueue_style($handle, $this->getBasePath() . $path, [], $version, $inFooter);
}

}
}

}
5 changes: 1 addition & 4 deletions src/FlexibleLayoutRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace degordian\wpHelpers;


class FlexibleLayoutRenderer
{
private $basePath = '';
Expand Down Expand Up @@ -42,6 +41,4 @@ private function getPartialPath($partialName)
{
return $this->basePath . DIRECTORY_SEPARATOR . $partialName;
}


}
}
5 changes: 2 additions & 3 deletions src/SocialSharer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace degordian\wpHelpers;


class SocialSharer
{

Expand Down Expand Up @@ -38,7 +37,7 @@ public function getFBShareCount($url)
try {
$data = json_decode(@file_get_contents($link));

if(isset($data->share) && isset($data->share->share_count)) {
if (isset($data->share) && isset($data->share->share_count)) {
return $data->share->share_count;
}

Expand Down Expand Up @@ -74,4 +73,4 @@ public function getLinkedInShareCount($url)
return 0;
}
}
}
}
20 changes: 9 additions & 11 deletions src/WPSocialSharer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,65 @@ class WPSocialSharer extends SocialSharer
{
public function getFBShareLink($url = null)
{
if($url === null) {
if ($url === null) {
$url = get_permalink();
}
return parent::getFBShareLink($url);
}

public function getTwitterShareLink($url = null)
{
if($url === null) {
if ($url === null) {
$url = get_permalink();
}
return parent::getTwitterShareLink($url);
}

public function getLinkedInShareLink($url = null)
{
if($url === null) {
if ($url === null) {
$url = get_permalink();
}
return parent::getLinkedInShareLink($url);
}

public function getGooglePlusShareLink($url = null)
{
if($url === null) {
if ($url === null) {
$url = get_permalink();
}
return parent::getGooglePlusShareLink($url);
}

public function getEmailShareLink($url = null)
{
if($url === null) {
if ($url === null) {
$url = get_permalink();
}
return parent::getEmailShareLink($url);
}

public function getFBShareCount($url = null)
{
if($url === null) {
if ($url === null) {
$url = get_permalink();
}
return parent::getFBShareCount($url);
}

public function getTwitterShareCount($url = null)
{
if($url === null) {
if ($url === null) {
$url = get_permalink();
}
return parent::getTwitterShareCount($url);
}

public function getLinkedInShareCount($url = null)
{
if($url === null) {
if ($url === null) {
$url = get_permalink();
}
return parent::getLinkedInShareCount($url);
}


}
}

0 comments on commit 3b7fca2

Please sign in to comment.