Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit970ed8b

Browse files
authored
Merge pull requestyajra#42 from yajra/analysis-XlElYN
Apply fixes from StyleCI
2 parentsd9e359e +0672e3a commit970ed8b

File tree

5 files changed

+33
-33
lines changed

5 files changed

+33
-33
lines changed

‎src/Html/Builder.php‎

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
namespaceYajra\DataTables\Html;
44

5-
useCollective\Html\HtmlBuilder;
6-
useIlluminate\Contracts\Config\Repository;
7-
useIlluminate\Contracts\View\Factory;
85
useIlluminate\Support\Arr;
6+
useIlluminate\Support\Str;
7+
useCollective\Html\HtmlBuilder;
98
useIlluminate\Support\Collection;
109
useIlluminate\Support\HtmlString;
11-
useIlluminate\Support\Str;
10+
useIlluminate\Contracts\View\Factory;
1211
useIlluminate\Support\Traits\Macroable;
12+
useIlluminate\Contracts\Config\Repository;
1313

1414
class Builder
1515
{
@@ -86,10 +86,10 @@ class Builder
8686
*/
8787
publicfunction__construct(Repository$config,Factory$view,HtmlBuilder$html)
8888
{
89-
$this->config =$config;
90-
$this->view =$view;
91-
$this->html =$html;
92-
$this->collection =newCollection;
89+
$this->config=$config;
90+
$this->view=$view;
91+
$this->html=$html;
92+
$this->collection=newCollection;
9393
$this->tableAttributes =$this->config->get('datatables-html.table', []);
9494
}
9595

@@ -157,7 +157,7 @@ public function parameterize($attributes = [])
157157
$values = [];
158158
$replacements = [];
159159
foreach ($parametersas$key => &$value) {
160-
if (!is_array($value)) {
160+
if (!is_array($value)) {
161161
if (strpos($value,'$.') ===0) {
162162
// Store function string.
163163
$values[] =$value;
@@ -169,8 +169,8 @@ public function parameterize($attributes = [])
169169
}
170170
}
171171

172-
list($ajaxDataFunction,$parameters) =$this->encodeAjaxDataFunction($parameters);
173-
list($columnFunctions,$parameters) =$this->encodeColumnFunctions($parameters);
172+
list($ajaxDataFunction,$parameters)=$this->encodeAjaxDataFunction($parameters);
173+
list($columnFunctions,$parameters)=$this->encodeColumnFunctions($parameters);
174174
list($callbackFunctions,$parameters) =$this->encodeCallbackFunctions($parameters);
175175

176176
$json =json_encode($parameters);
@@ -247,7 +247,7 @@ public function setTableId($id)
247247
*/
248248
publicfunctiongetTableAttribute($attribute)
249249
{
250-
if (!array_key_exists($attribute,$this->tableAttributes)) {
250+
if (!array_key_exists($attribute,$this->tableAttributes)) {
251251
thrownew \Exception("Table attribute '{$attribute}' does not exist.");
252252
}
253253

@@ -262,11 +262,11 @@ public function getTableAttribute($attribute)
262262
*/
263263
publicfunctionaddTableClass($class)
264264
{
265-
$class =is_array($class) ?implode('',$class) :$class;
265+
$class=is_array($class) ?implode('',$class) :$class;
266266
$currentClass = Arr::get(array_change_key_case($this->tableAttributes),'class');
267267

268268
$classes =preg_split('#\s+#',$currentClass.''.$class,null,PREG_SPLIT_NO_EMPTY);
269-
$class =implode('',array_unique($classes));
269+
$class=implode('',array_unique($classes));
270270

271271
return$this->setTableAttribute('class',$class);
272272
}
@@ -279,7 +279,7 @@ public function addTableClass($class)
279279
*/
280280
publicfunctionremoveTableClass($class)
281281
{
282-
$class =is_array($class) ?implode('',$class) :$class;
282+
$class=is_array($class) ?implode('',$class) :$class;
283283
$currentClass = Arr::get(array_change_key_case($this->tableAttributes),'class');
284284

285285
$classes =array_diff(
@@ -305,7 +305,7 @@ public function addColumn(array $attributes)
305305
}
306306

307307
/**
308-
* Add a Column object at the beginning of collection
308+
* Add a Column object at the beginning of collection.
309309
*
310310
* @param \Yajra\DataTables\Html\Column $column
311311
* @return $this
@@ -354,7 +354,7 @@ public function columns(array $columns)
354354
$this->collection =newCollection;
355355

356356
foreach ($columnsas$key =>$value) {
357-
if (!is_a($value, Column::class)) {
357+
if (!is_a($value, Column::class)) {
358358
if (is_array($value)) {
359359
$attributes =array_merge(['name' =>$key,'data' =>$key],$this->setTitle($key,$value));
360360
}else {
@@ -383,7 +383,7 @@ public function columns(array $columns)
383383
*/
384384
publicfunctionsetTitle($title,array$attributes)
385385
{
386-
if (!isset($attributes['title'])) {
386+
if (!isset($attributes['title'])) {
387387
$attributes['title'] =$this->getQualifiedTitle($title);
388388
}
389389

@@ -477,7 +477,7 @@ public function addIndex(array $attributes = [])
477477
}
478478

479479
/**
480-
* Setup ajax parameter for datatables pipeline plugin
480+
* Setup ajax parameter for datatables pipeline plugin.
481481
*
482482
* @param string $url
483483
* @param string $pages
@@ -491,7 +491,7 @@ public function pipeline($url, $pages)
491491
}
492492

493493
/**
494-
* Setup ajax parameter
494+
* Setup ajax parameter.
495495
*
496496
* @param string|array $attributes
497497
* @return $this
@@ -521,7 +521,7 @@ public function table(array $attributes = [], $drawFooter = false, $drawSearch =
521521
$tableHtml ='<table' .$htmlAttr .'>';
522522
$searchHtml =$drawSearch ?'<tr class="search-filter">' .implode('',
523523
$this->compileTableSearchHeaders()) .'</tr>' :'';
524-
$tableHtml.='<thead><tr>' .implode('',$th) .'</tr>' .$searchHtml .'</thead>';
524+
$tableHtml .='<thead><tr>' .implode('',$th) .'</tr>' .$searchHtml .'</thead>';
525525
if ($drawFooter) {
526526
$tf =$this->compileTableFooter();
527527
$tableHtml .='<tfoot><tr>' .implode('',$tf) .'</tr></tfoot>';
@@ -601,16 +601,16 @@ public function minifiedAjax($url = '', $script = null, $data = [])
601601
$this->ajax['url'] =$url;
602602
$this->ajax['type'] ='GET';
603603
if (isset($this->attributes['serverSide']) ?$this->attributes['serverSide'] :true) {
604-
$this->ajax['data'] ="function(data) {
604+
$this->ajax['data'] ='function(data) {
605605
for (var i = 0, len = data.columns.length; i < len; i++) {
606606
if (!data.columns[i].search.value) delete data.columns[i].search;
607607
if (data.columns[i].searchable === true) delete data.columns[i].searchable;
608608
if (data.columns[i].orderable === true) delete data.columns[i].orderable;
609609
if (data.columns[i].data === data.columns[i].name) delete data.columns[i].name;
610610
}
611-
delete data.search.regex;";
611+
delete data.search.regex;';
612612
}else {
613-
$this->ajax['data'] ="function(data){";
613+
$this->ajax['data'] ='function(data){';
614614
}
615615

616616
if ($appendData) {
@@ -621,7 +621,7 @@ public function minifiedAjax($url = '', $script = null, $data = [])
621621
$this->ajax['data'] .=$script;
622622
}
623623

624-
$this->ajax['data'] .="}";
624+
$this->ajax['data'] .='}';
625625

626626
return$this;
627627
}
@@ -637,7 +637,7 @@ protected function encodeAjaxDataFunction($parameters)
637637
$ajaxData ='';
638638
if (isset($parameters['ajax']['data'])) {
639639
$ajaxData =$parameters['ajax']['data'];
640-
$parameters['ajax']['data'] ="#ajax_data#";
640+
$parameters['ajax']['data'] ='#ajax_data#';
641641
}
642642

643643
return [$ajaxData,$parameters];
@@ -694,7 +694,7 @@ protected function encodeCallbackFunctions(array $parameters)
694694
*/
695695
protectedfunctiondecodeAjaxDataFunction($function,$json)
696696
{
697-
returnstr_replace("\"#ajax_data#\"",$function,$json);
697+
returnstr_replace('"#ajax_data#"',$function,$json);
698698
}
699699

700700
/**
@@ -794,7 +794,7 @@ private function compileTableHeaders()
794794
}
795795

796796
/**
797-
* Compile table search headers
797+
* Compile table search headers.
798798
*
799799
* @return array
800800
*/

‎src/HtmlServiceProvider.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespaceYajra\DataTables;
44

5-
useCollective\Html\HtmlServiceProviderasCollectiveHtml;
65
useIlluminate\Support\ServiceProvider;
6+
useCollective\Html\HtmlServiceProviderasCollectiveHtml;
77

88
class HtmlServiceProviderextends ServiceProvider
99
{

‎src/resources/config/config.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
return [
4-
/**
4+
/*
55
* Default table attributes when generating the table.
66
*/
77
'table' => [

‎tests/HtmlBuilderTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

3-
usePHPUnit\Framework\TestCase;
43
useYajra\DataTables\Factory;
4+
usePHPUnit\Framework\TestCase;
55
useYajra\DataTables\Html\Column;
66

77
require_once'helper.php';

‎tests/helper.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ function app($instance, $config = [])
2929

3030
functionview($view =null,array$data = [])
3131
{
32-
if (!$view) {
32+
if (!$view) {
3333
returnnewBladeView();
3434
}
3535

3636
return (newBladeView())->exists($view);
3737
}
3838

3939
/**
40-
* Blade View Stub
40+
* Blade View Stub.
4141
*/
4242
class BladeView
4343
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp