Skip to content

Commit

Permalink
Fixed Style CI: Stage 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Fiscaletti committed May 8, 2019
1 parent 404e643 commit 198ce49
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
3 changes: 1 addition & 2 deletions example/test.php
Expand Up @@ -40,8 +40,7 @@

// Add a custom plugin to parse URLs.
->addPlugin(
new class extends \Spackle\Plugin
{
new class extends \Spackle\Plugin {
public $start_key = 'url';
public $end_key = 'url';

Expand Down
23 changes: 11 additions & 12 deletions src/Spackle/Plugin.php
Expand Up @@ -2,13 +2,13 @@

namespace Spackle;

use \Spackle\Plugins\CodeBlockParser;
use Spackle\Plugins\CodeBlockParser;

abstract class Plugin
{
/**
* The current parser for this Plugin.
*
*
* @var \Spackle\TemplateParser
*/
protected $parser;
Expand All @@ -35,7 +35,7 @@ abstract class Plugin
*
* @return string
*/
public abstract function parse($data);
abstract public function parse($data);

/**
* Set the parser for the Plugin.
Expand All @@ -49,14 +49,14 @@ public function setParser($parser)

/**
* The current plugins loaded for Spackle.
*
*
* @var array[\Spackle\Plugin]
*/
private static $plugins = [];

/**
* Add a plugin.
*
*
* @param \Spackle\Plugin $plugin
*/
public static function add($plugin)
Expand Down Expand Up @@ -85,7 +85,7 @@ public static function add($plugin)

/**
* Retrieve the current plugins.
*
*
* @return array[\Spackle\Plugin]
*/
public static function plugins()
Expand All @@ -103,12 +103,11 @@ public static function plugins()
*/
public static function getIgnoredKeys($position)
{
$ignored = ($position == 'start') ? ">" : "<";
foreach (self::plugins() as $plugin)
{
$ignored .= '|'.(($position == 'start')?$plugin->start_key:$plugin->end_key);
$ignored = ($position == 'start') ? '>' : '<';
foreach (self::plugins() as $plugin) {
$ignored .= '|'.(($position == 'start') ? $plugin->start_key : $plugin->end_key);
}

return $ignored;
}
}
}
6 changes: 3 additions & 3 deletions src/Spackle/Plugins/CodeBlockParser.php
Expand Up @@ -9,7 +9,7 @@ class CodeBlockParser extends Plugin
/**
* The current parser for this CodeBlockParser.
* Used during the eval of the code.
*
*
* @var \Spackle\TemplateParser
*/
public static $current_parser;
Expand Down Expand Up @@ -44,7 +44,7 @@ public function parse($data)
$bound = str_replace('$this', '\Spackle\Plugins\CodeBlockParser::$current_parser', $data);
if (
! is_null(
CodeBlockParser::$current_parser->currently_bound_object
self::$current_parser->currently_bound_object
)
) {
$bound = str_replace(
Expand All @@ -61,4 +61,4 @@ public function parse($data)

return $result;
}
}
}

0 comments on commit 198ce49

Please sign in to comment.