Completed
Push — master ( 14b417...4b9e38 )
by Denis
01:33
created
src/functions.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
  * @return \Woo\GridView\GridView
7 7
  */
8 8
 function grid(array $config) {
9
-    return \Woo\GridView\GridView::make($config);
9
+	return \Woo\GridView\GridView::make($config);
10 10
 }
11 11
\ No newline at end of file
Please login to merge, or discard this patch.
src/DataProviders/DataProviderInterface.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -4,24 +4,24 @@
 block discarded – undo
4 4
 
5 5
 interface DataProviderInterface
6 6
 {
7
-    /**
8
-     * Should return total amount of rows
9
-     * @return int
10
-     */
11
-    public function getCount() : int;
7
+	/**
8
+	 * Should return total amount of rows
9
+	 * @return int
10
+	 */
11
+	public function getCount() : int;
12 12
 
13
-    /**
14
-     * Should return amount of pages
15
-     * @param int $perPage - amount of records per page
16
-     * @return int
17
-     */
18
-    public function getTotalPages(int $perPage) : int;
13
+	/**
14
+	 * Should return amount of pages
15
+	 * @param int $perPage - amount of records per page
16
+	 * @return int
17
+	 */
18
+	public function getTotalPages(int $perPage) : int;
19 19
 
20
-    /**
21
-     * Should return a list of data for current page
22
-     * @param int $page
23
-     * @param int $perPage - amount of records per page
24
-     * @return mixed
25
-     */
26
-    public function getData(int $page, int $perPage);
20
+	/**
21
+	 * Should return a list of data for current page
22
+	 * @param int $page
23
+	 * @param int $perPage - amount of records per page
24
+	 * @return mixed
25
+	 */
26
+	public function getData(int $page, int $perPage);
27 27
 }
28 28
\ No newline at end of file
Please login to merge, or discard this patch.
src/DataProviders/EloquentDataProvider.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -6,38 +6,38 @@
 block discarded – undo
6 6
 
7 7
 class EloquentDataProvider implements DataProviderInterface
8 8
 {
9
-    protected $query;
9
+	protected $query;
10 10
 
11
-    /**
12
-     * EloquentDataProvider constructor.
13
-     * @param Builder $query
14
-     */
15
-    public function __construct(Builder $query)
16
-    {
17
-        $this->query = $query;
18
-    }
11
+	/**
12
+	 * EloquentDataProvider constructor.
13
+	 * @param Builder $query
14
+	 */
15
+	public function __construct(Builder $query)
16
+	{
17
+		$this->query = $query;
18
+	}
19 19
 
20
-    /**
21
-     * @inheritdoc
22
-     */
23
-    public function getCount(): int
24
-    {
25
-        return $this->query->count();
26
-    }
20
+	/**
21
+	 * @inheritdoc
22
+	 */
23
+	public function getCount(): int
24
+	{
25
+		return $this->query->count();
26
+	}
27 27
 
28
-    /**
29
-     * @inheritdoc
30
-     */
31
-    public function getTotalPages(int $perPage): int
32
-    {
33
-        return ceil($this->getCount() / $perPage);
34
-    }
28
+	/**
29
+	 * @inheritdoc
30
+	 */
31
+	public function getTotalPages(int $perPage): int
32
+	{
33
+		return ceil($this->getCount() / $perPage);
34
+	}
35 35
 
36
-    /**
37
-     * @inheritdoc
38
-     */
39
-    public function getData(int $page, int $perPage)
40
-    {
41
-        return (clone $this->query)->paginate($perPage, ['*'], 'page', $page);
42
-    }
36
+	/**
37
+	 * @inheritdoc
38
+	 */
39
+	public function getData(int $page, int $perPage)
40
+	{
41
+		return (clone $this->query)->paginate($perPage, ['*'], 'page', $page);
42
+	}
43 43
 }
44 44
\ No newline at end of file
Please login to merge, or discard this patch.
src/GridViewServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 	 */
14 14
 	public function boot()
15 15
 	{
16
-		$this->loadViewsFrom(__DIR__.'/../views', 'woo_gridview');
16
+		$this->loadViewsFrom(__DIR__ . '/../views', 'woo_gridview');
17 17
 
18 18
 		require_once __DIR__ . '/functions.php';
19 19
 	}
Please login to merge, or discard this patch.
src/traits/Configurable.php 2 patches
Doc Comments   -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,6 @@  discard block
 block discarded – undo
8 8
 {
9 9
     /**
10 10
      * Allows to load config into object properties
11
-     * @param object $object
12 11
      * @param array $config
13 12
      * @throws GridViewConfigException
14 13
      */
@@ -36,7 +35,6 @@  discard block
 block discarded – undo
36 35
     /**
37 36
      * Allows to test attributes and types in config
38 37
      * @param $object
39
-     * @param array $tests
40 38
      * @throws GridViewConfigException
41 39
      */
42 40
     protected function testConfig()
Please login to merge, or discard this patch.
Indentation   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -6,83 +6,83 @@
 block discarded – undo
6 6
 
7 7
 trait Configurable
8 8
 {
9
-    /**
10
-     * Allows to load config into object properties
11
-     * @param object $object
12
-     * @param array $config
13
-     * @throws GridViewConfigException
14
-     */
15
-    public function loadConfig(array $config)
16
-    {
17
-        foreach ($config as $key => $value) {
18
-
19
-            if (property_exists($this, $key)) {
20
-                $this->$key = $value;
21
-            }
22
-        }
23
-
24
-        $this->testConfig();
25
-    }
26
-
27
-    /**
28
-     * Override this method in classes
29
-     * @return array
30
-     */
31
-    protected function configTests() : array
32
-    {
33
-        return [];
34
-    }
35
-
36
-    /**
37
-     * Allows to test attributes and types in config
38
-     * @param $object
39
-     * @param array $tests
40
-     * @throws GridViewConfigException
41
-     */
42
-    protected function testConfig()
43
-    {
44
-        foreach ($this->configTests() as $property => $test) {
45
-
46
-            if (!property_exists($this, $property)) {
47
-                throw new GridViewConfigException(
48
-                    'Unable to test ' . get_class($this) . ': property ' . $property . ' does not exist'
49
-                );
50
-            }
51
-
52
-            if (is_scalar($test)) {
53
-
54
-                $testPassed = true;
55
-
56
-                switch ($test) {
57
-                    case 'int':
58
-                        $testPassed = is_numeric($this->$property);
59
-                        break;
60
-
61
-                    case 'string':
62
-                        $testPassed = is_string($this->$property);
63
-                        break;
64
-
65
-                    case 'array':
66
-                        $testPassed = is_array($this->$property);
67
-                        break;
68
-
69
-                    case 'closure':
70
-                        $testPassed = $this->$property instanceof \Closure;
71
-                        break;
72
-
73
-                    case 'any':
74
-                        break;
75
-
76
-                    default:
77
-                        $testPassed = is_subclass_of($this->$property, $test);
78
-                }
79
-
80
-                if (!$testPassed) {
81
-                    throw new GridViewConfigException('
9
+	/**
10
+	 * Allows to load config into object properties
11
+	 * @param object $object
12
+	 * @param array $config
13
+	 * @throws GridViewConfigException
14
+	 */
15
+	public function loadConfig(array $config)
16
+	{
17
+		foreach ($config as $key => $value) {
18
+
19
+			if (property_exists($this, $key)) {
20
+				$this->$key = $value;
21
+			}
22
+		}
23
+
24
+		$this->testConfig();
25
+	}
26
+
27
+	/**
28
+	 * Override this method in classes
29
+	 * @return array
30
+	 */
31
+	protected function configTests() : array
32
+	{
33
+		return [];
34
+	}
35
+
36
+	/**
37
+	 * Allows to test attributes and types in config
38
+	 * @param $object
39
+	 * @param array $tests
40
+	 * @throws GridViewConfigException
41
+	 */
42
+	protected function testConfig()
43
+	{
44
+		foreach ($this->configTests() as $property => $test) {
45
+
46
+			if (!property_exists($this, $property)) {
47
+				throw new GridViewConfigException(
48
+					'Unable to test ' . get_class($this) . ': property ' . $property . ' does not exist'
49
+				);
50
+			}
51
+
52
+			if (is_scalar($test)) {
53
+
54
+				$testPassed = true;
55
+
56
+				switch ($test) {
57
+					case 'int':
58
+						$testPassed = is_numeric($this->$property);
59
+						break;
60
+
61
+					case 'string':
62
+						$testPassed = is_string($this->$property);
63
+						break;
64
+
65
+					case 'array':
66
+						$testPassed = is_array($this->$property);
67
+						break;
68
+
69
+					case 'closure':
70
+						$testPassed = $this->$property instanceof \Closure;
71
+						break;
72
+
73
+					case 'any':
74
+						break;
75
+
76
+					default:
77
+						$testPassed = is_subclass_of($this->$property, $test);
78
+				}
79
+
80
+				if (!$testPassed) {
81
+					throw new GridViewConfigException('
82 82
                         Test ' . $test . ' has failed on ' . get_class($this) . '::' . $property
83
-                    );
84
-                }
85
-            }
86
-        }
87
-    }
83
+					);
84
+				}
85
+			}
86
+		}
87
+	}
88 88
 }
89 89
\ No newline at end of file
Please login to merge, or discard this patch.
src/Columns/AttributeColumn.php 1 patch
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -7,47 +7,47 @@
 block discarded – undo
7 7
 
8 8
 class AttributeColumn extends BaseColumn
9 9
 {
10
-    /**
11
-     * AttributeColumn constructor.
12
-     * @param $config
13
-     * @throws GridViewConfigException
14
-     */
15
-    public function __construct($config)
16
-    {
17
-        parent::__construct($config);
18
-
19
-        if (empty($this->title)) {
20
-            $this->title = ucfirst(str_replace('_', ' ', $this->value));
21
-        }
22
-    }
23
-
24
-    /**
25
-     * @return array
26
-     */
27
-    protected function configTests(): array
28
-    {
29
-        return array_merge(parent::configTests(), [
30
-            'value' => 'string',
31
-        ]);
32
-    }
33
-
34
-    /**
35
-     * @inheritdoc
36
-     * @throws ColumnRenderException
37
-     * @throws GridViewConfigException
38
-     */
39
-    public function _renderValue($row)
40
-    {
41
-        if (is_array($row)) {
42
-
43
-            if (isset($row[$this->value]) && $row[$this->value] !== null) {
44
-                return $row[$this->value];
45
-            }
46
-
47
-        } elseif (isset($row->{$this->value}) && $row->{$this->value} !== null) {
48
-            return $row->{$this->value};
49
-        }
50
-
51
-        return $this->emptyValue;
52
-    }
10
+	/**
11
+	 * AttributeColumn constructor.
12
+	 * @param $config
13
+	 * @throws GridViewConfigException
14
+	 */
15
+	public function __construct($config)
16
+	{
17
+		parent::__construct($config);
18
+
19
+		if (empty($this->title)) {
20
+			$this->title = ucfirst(str_replace('_', ' ', $this->value));
21
+		}
22
+	}
23
+
24
+	/**
25
+	 * @return array
26
+	 */
27
+	protected function configTests(): array
28
+	{
29
+		return array_merge(parent::configTests(), [
30
+			'value' => 'string',
31
+		]);
32
+	}
33
+
34
+	/**
35
+	 * @inheritdoc
36
+	 * @throws ColumnRenderException
37
+	 * @throws GridViewConfigException
38
+	 */
39
+	public function _renderValue($row)
40
+	{
41
+		if (is_array($row)) {
42
+
43
+			if (isset($row[$this->value]) && $row[$this->value] !== null) {
44
+				return $row[$this->value];
45
+			}
46
+
47
+		} elseif (isset($row->{$this->value}) && $row->{$this->value} !== null) {
48
+			return $row->{$this->value};
49
+		}
50
+
51
+		return $this->emptyValue;
52
+	}
53 53
 }
54 54
\ No newline at end of file
Please login to merge, or discard this patch.
src/Columns/BaseColumn.php 1 patch
Indentation   +114 added lines, -114 removed lines patch added patch discarded remove patch
@@ -8,119 +8,119 @@
 block discarded – undo
8 8
 
9 9
 abstract class BaseColumn
10 10
 {
11
-    use Configurable;
12
-
13
-    /**
14
-     * @var string
15
-     */
16
-    public $title = '';
17
-
18
-    /**
19
-     * @var string|mixed
20
-     */
21
-    public $value = '';
22
-
23
-    /**
24
-     * @var array
25
-     */
26
-    public $headerHtmlOptions = [];
27
-
28
-    /**
29
-     * @var array
30
-     */
31
-    public $contentHtmlOptions = [];
32
-
33
-    /**
34
-     * @var string - allowed: raw, url, email, text, image
35
-     */
36
-    public $contentFormat = 'text';
37
-
38
-    /**
39
-     * Value when
40
-     * @var string
41
-     */
42
-    public $emptyValue = '-';
43
-
44
-    /**
45
-     * BaseColumn constructor.
46
-     * @param array $config
47
-     * @throws \Woo\GridView\Exceptions\GridViewConfigException
48
-     */
49
-    public function __construct(array $config)
50
-    {
51
-        $this->loadConfig($config);
52
-    }
53
-
54
-    /**
55
-     * @return array
56
-     */
57
-    protected function configTests(): array
58
-    {
59
-        return [
60
-            'title' => 'string',
61
-            'value' => 'any',
62
-            'headerHtmlOptions' => 'array',
63
-            'contentHtmlOptions' => 'array',
64
-            'contentFormat' => 'string',
65
-            'emptyValue' => 'string',
66
-        ];
67
-    }
68
-
69
-    /**
70
-     * Formatted header html options
71
-     * @return string
72
-     */
73
-    public function headerHtmlOptions() : string
74
-    {
75
-        return GridViewHelper::htmlOptionsToString($this->headerHtmlOptions);
76
-    }
77
-
78
-    /**
79
-     * Formatted content html options
80
-     * @param array $context
81
-     * @return string
82
-     */
83
-    public function contentHtmlOptions(array $context) : string
84
-    {
85
-        return GridViewHelper::htmlOptionsToString($this->contentHtmlOptions, $context);
86
-    }
87
-
88
-    /**
89
-     * Render column value for row
90
-     * @param array|object $row
91
-     * @return string|mixed
92
-     */
93
-    protected abstract function _renderValue($row);
94
-
95
-    /**
96
-     * Renders column content
97
-     * @param $row
98
-     * @return string
99
-     * @throws GridViewConfigException
100
-     */
101
-    public function renderValue($row)
102
-    {
103
-        $value = $this->_renderValue($row);
104
-
105
-        switch ($this->contentFormat) {
106
-            case 'raw':
107
-                return $value;
108
-
109
-            case 'text':
110
-                return htmlentities($value);
111
-
112
-            case 'url':
113
-                return '<a href="' . htmlspecialchars($value, ENT_QUOTES) . '">' . htmlentities($value) . '</a>';
114
-
115
-            case 'email':
116
-                return '<a href="mailto:' . htmlspecialchars($value, ENT_QUOTES) . '">' . htmlentities($value) . '</a>';
117
-
118
-            case 'image':
119
-                return '<img src="' . htmlspecialchars($value, ENT_QUOTES) . '">';
120
-
121
-            default:
122
-                throw new GridViewConfigException('Invalid content format for attribute collumn: ' . $this->value);
123
-        }
124
-    }
11
+	use Configurable;
12
+
13
+	/**
14
+	 * @var string
15
+	 */
16
+	public $title = '';
17
+
18
+	/**
19
+	 * @var string|mixed
20
+	 */
21
+	public $value = '';
22
+
23
+	/**
24
+	 * @var array
25
+	 */
26
+	public $headerHtmlOptions = [];
27
+
28
+	/**
29
+	 * @var array
30
+	 */
31
+	public $contentHtmlOptions = [];
32
+
33
+	/**
34
+	 * @var string - allowed: raw, url, email, text, image
35
+	 */
36
+	public $contentFormat = 'text';
37
+
38
+	/**
39
+	 * Value when
40
+	 * @var string
41
+	 */
42
+	public $emptyValue = '-';
43
+
44
+	/**
45
+	 * BaseColumn constructor.
46
+	 * @param array $config
47
+	 * @throws \Woo\GridView\Exceptions\GridViewConfigException
48
+	 */
49
+	public function __construct(array $config)
50
+	{
51
+		$this->loadConfig($config);
52
+	}
53
+
54
+	/**
55
+	 * @return array
56
+	 */
57
+	protected function configTests(): array
58
+	{
59
+		return [
60
+			'title' => 'string',
61
+			'value' => 'any',
62
+			'headerHtmlOptions' => 'array',
63
+			'contentHtmlOptions' => 'array',
64
+			'contentFormat' => 'string',
65
+			'emptyValue' => 'string',
66
+		];
67
+	}
68
+
69
+	/**
70
+	 * Formatted header html options
71
+	 * @return string
72
+	 */
73
+	public function headerHtmlOptions() : string
74
+	{
75
+		return GridViewHelper::htmlOptionsToString($this->headerHtmlOptions);
76
+	}
77
+
78
+	/**
79
+	 * Formatted content html options
80
+	 * @param array $context
81
+	 * @return string
82
+	 */
83
+	public function contentHtmlOptions(array $context) : string
84
+	{
85
+		return GridViewHelper::htmlOptionsToString($this->contentHtmlOptions, $context);
86
+	}
87
+
88
+	/**
89
+	 * Render column value for row
90
+	 * @param array|object $row
91
+	 * @return string|mixed
92
+	 */
93
+	protected abstract function _renderValue($row);
94
+
95
+	/**
96
+	 * Renders column content
97
+	 * @param $row
98
+	 * @return string
99
+	 * @throws GridViewConfigException
100
+	 */
101
+	public function renderValue($row)
102
+	{
103
+		$value = $this->_renderValue($row);
104
+
105
+		switch ($this->contentFormat) {
106
+			case 'raw':
107
+				return $value;
108
+
109
+			case 'text':
110
+				return htmlentities($value);
111
+
112
+			case 'url':
113
+				return '<a href="' . htmlspecialchars($value, ENT_QUOTES) . '">' . htmlentities($value) . '</a>';
114
+
115
+			case 'email':
116
+				return '<a href="mailto:' . htmlspecialchars($value, ENT_QUOTES) . '">' . htmlentities($value) . '</a>';
117
+
118
+			case 'image':
119
+				return '<img src="' . htmlspecialchars($value, ENT_QUOTES) . '">';
120
+
121
+			default:
122
+				throw new GridViewConfigException('Invalid content format for attribute collumn: ' . $this->value);
123
+		}
124
+	}
125 125
 
126 126
 }
127 127
\ No newline at end of file
Please login to merge, or discard this patch.
src/Columns/RawColumn.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -4,26 +4,26 @@
 block discarded – undo
4 4
 
5 5
 class RawColumn extends BaseColumn
6 6
 {
7
-    /**
8
-     * @var string
9
-     */
10
-    public $contentFormat = 'raw';
7
+	/**
8
+	 * @var string
9
+	 */
10
+	public $contentFormat = 'raw';
11 11
 
12
-    /**
13
-     * @return array
14
-     */
15
-    protected function configTests(): array
16
-    {
17
-        return array_merge(parent::configTests(), [
18
-            'value' => 'closure',
19
-        ]);
20
-    }
12
+	/**
13
+	 * @return array
14
+	 */
15
+	protected function configTests(): array
16
+	{
17
+		return array_merge(parent::configTests(), [
18
+			'value' => 'closure',
19
+		]);
20
+	}
21 21
 
22
-    /**
23
-     * @inheritdoc
24
-     */
25
-    public function _renderValue($row)
26
-    {
27
-        return call_user_func($this->value, $row);
28
-    }
22
+	/**
23
+	 * @inheritdoc
24
+	 */
25
+	public function _renderValue($row)
26
+	{
27
+		return call_user_func($this->value, $row);
28
+	}
29 29
 }
30 30
\ No newline at end of file
Please login to merge, or discard this patch.
src/Columns/ActionsColumn.php 1 patch
Indentation   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -6,81 +6,81 @@
 block discarded – undo
6 6
 
7 7
 class ActionsColumn extends BaseColumn
8 8
 {
9
-    /**
10
-     * By default is empty for this column
11
-     * @var string
12
-     */
13
-    public $title = '';
9
+	/**
10
+	 * By default is empty for this column
11
+	 * @var string
12
+	 */
13
+	public $title = '';
14 14
 
15
-    /**
16
-     * Value contains short codes for actions
17
-     * @var string
18
-     */
19
-    public $value = '{show} {edit} {delete}';
15
+	/**
16
+	 * Value contains short codes for actions
17
+	 * @var string
18
+	 */
19
+	public $value = '{show} {edit} {delete}';
20 20
 
21
-    /**
22
-     * Additional actions could be added, key is short-code and value is callback
23
-     * @var array
24
-     */
25
-    public $additionalActions = [];
21
+	/**
22
+	 * Additional actions could be added, key is short-code and value is callback
23
+	 * @var array
24
+	 */
25
+	public $additionalActions = [];
26 26
 
27
-    /**
28
-     * @var \Closure|null
29
-     */
30
-    public $actionsUrls;
27
+	/**
28
+	 * @var \Closure|null
29
+	 */
30
+	public $actionsUrls;
31 31
 
32
-    /**
33
-     * @var string
34
-     */
35
-    public $contentFormat = 'raw';
32
+	/**
33
+	 * @var string
34
+	 */
35
+	public $contentFormat = 'raw';
36 36
 
37
-    /**
38
-     * @return array
39
-     */
40
-    protected function configTests(): array
41
-    {
42
-        return array_merge(parent::configTests(), [
43
-            'value' => 'string',
44
-            'additionalActions' => 'array',
45
-            'actionsUrls' => 'any',
46
-        ]);
47
-    }
37
+	/**
38
+	 * @return array
39
+	 */
40
+	protected function configTests(): array
41
+	{
42
+		return array_merge(parent::configTests(), [
43
+			'value' => 'string',
44
+			'additionalActions' => 'array',
45
+			'actionsUrls' => 'any',
46
+		]);
47
+	}
48 48
 
49
-    /**
50
-     * @return array
51
-     */
52
-    public function basicActions()
53
-    {
54
-        return [
55
-            'show' => function($model) {
56
-                return '<a href="' . call_user_func($this->actionsUrls, $model)['show'] . '">View</a>';
57
-            },
58
-            'edit' => function($model) {
59
-                return '<a href="' . call_user_func($this->actionsUrls, $model)['edit'] . '">Edit</a>';
60
-            },
61
-            'delete' => function($model) {
62
-                return '<a href="' . call_user_func($this->actionsUrls, $model)['delete'] . '">Delete</a>';
63
-            },
64
-        ];
65
-    }
49
+	/**
50
+	 * @return array
51
+	 */
52
+	public function basicActions()
53
+	{
54
+		return [
55
+			'show' => function($model) {
56
+				return '<a href="' . call_user_func($this->actionsUrls, $model)['show'] . '">View</a>';
57
+			},
58
+			'edit' => function($model) {
59
+				return '<a href="' . call_user_func($this->actionsUrls, $model)['edit'] . '">Edit</a>';
60
+			},
61
+			'delete' => function($model) {
62
+				return '<a href="' . call_user_func($this->actionsUrls, $model)['delete'] . '">Delete</a>';
63
+			},
64
+		];
65
+	}
66 66
 
67
-    /**
68
-     * @inheritdoc
69
-     */
70
-    public function _renderValue($row)
71
-    {
72
-        $result = $this->value;
67
+	/**
68
+	 * @inheritdoc
69
+	 */
70
+	public function _renderValue($row)
71
+	{
72
+		$result = $this->value;
73 73
 
74
-        $actions = array_merge($this->basicActions(), $this->additionalActions);
74
+		$actions = array_merge($this->basicActions(), $this->additionalActions);
75 75
 
76
-        foreach ($actions as $key => $action) {
77
-            if (strpos($result, '{' . $key . '}') === false) {
78
-                continue;
79
-            }
76
+		foreach ($actions as $key => $action) {
77
+			if (strpos($result, '{' . $key . '}') === false) {
78
+				continue;
79
+			}
80 80
 
81
-            $result = str_replace('{' . $key . '}', $action($row), $result);
82
-        }
81
+			$result = str_replace('{' . $key . '}', $action($row), $result);
82
+		}
83 83
 
84
-        return $result;
85
-    }
84
+		return $result;
85
+	}
86 86
 }
87 87
\ No newline at end of file
Please login to merge, or discard this patch.